#icai-verification-container {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background-color: #f8f9fa;
    order: -1; /* Ensure it appears first */
}

/* OTP Section Styling */
.otp-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #d1d5db;
}

.otp-fields-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.otp-actions-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.otp-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.otp-input {
    width: 100px !important;
    text-align: center;
    letter-spacing: 2px;
    font-size: 18px;
    font-weight: bold;
}

.otp-message {
    margin-top: 10px;
}

.otp-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.otp-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.otp-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

/* Side-by-side fields layout */
.verification-fields-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    align-items: flex-end;
}

.otp-fields-row {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    align-items: flex-end;
}

.verification-button-row,
.otp-actions-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.all-fields-row {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    align-items: flex-end;
    overflow-x: auto; /* Allow horizontal scroll if needed */
    min-width: 0; /* Prevent flex items from overflowing */
}

.field-group {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}

.field-group.membership-field {
    max-width: 170px;
    min-width: 170px;
}

.field-group.mobile-field {
    max-width: 160px;
    min-width: 160px;
}

.field-group.otp-field {
    max-width: 80px;
}

.field-group .ff-el-input--label {
    margin-bottom: 8px;
}

.field-group .ff-el-input--label label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    display: block;
}

.field-group .ff-el-input--content {
    width: 100%;
}

.field-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.field-group input:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.field-group input:read-only {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

/* Button styling */
.verification-button-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 15px;
}

.verify-btn, 
#send-otp-btn,
#verify-otp-btn {
    padding: 8px 12px !important;
    font-weight: 600;
    min-width: 80px;
    border-radius: 20px;
    transition: all 0.15s ease-in-out;
    font-size: 13px;
    white-space: nowrap;
}

.verify-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
}

/* Message styling */
.verification-message {
    margin-top: 10px;
}

.verification-loading {
    color: #007cba;
    font-size: 14px;
    padding: 12px 16px;
    background-color: #e7f3ff;
    border-left: 4px solid #007cba;
    border-radius: 6px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.verification-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.verification-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.ff-btn-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    border-radius: 20px !important;
}

.ff-btn-primary {
    border-radius: 20px !important;
}

.ff-btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ff-btn-disabled:hover {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Required field asterisk styling */
.ff-el-required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Force the ICAI field to be at the top */
.fluentform #icai-verification-container {
    display: block !important;
    position: relative;
    z-index: 10;
}


/* Make calendar navigation buttons always visible */
.calendar_nav button {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Optional: give them a slight background or border if invisible due to design */
.calendar_nav button svg {
    fill: #333 !important; /* or your preferred color */
    width: 20px;
    height: 20px;
}

/* Optional: add hover effect */
.calendar_nav button:hover {
    background-color: #e6f0ff;
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive design - REPLACE EXISTING MEDIA QUERIES */
@media (max-width: 768px) {
    .all-fields-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .field-group {
        flex: 1 1 calc(50% - 7.5px);
        min-width: calc(50% - 7.5px);
        max-width: none;
    }
    
    .field-group.membership-field,
    .field-group.dob-field {
        flex: 1 1 calc(60% - 8.5px);
        max-width: none;
        min-width: 170px;
    }
    
    .verify-btn {
        flex: 1 1 100%;
        width: 100%;
        margin-top: 10px;
        border-radius: 20px;
    }
    
    .field-group.mobile-field {
        flex: 1 1 calc(50% - 7.5px);
        max-width: none;
        min-width: 160px;
    }
    
    .field-group.otp-field {
        flex: 1 1 calc(50% - 7.5px);
        max-width: none;
    }
    
    #send-otp-btn,
    #verify-otp-btn {
        flex: 1 1 100%;
        width: 100%;
        margin-top: 10px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .all-fields-row {
        // flex-direction: column;
        gap: 15px;
    }
    
    .field-group {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    #icai-verification-container {
        padding: 15px 10px;
        margin: 0 -10px 20px -10px;
    }
    
    .field-group input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 12px;
    }
    
    .verify-btn,
    #send-otp-btn,
    #verify-otp-btn {
        width: 100%;
        padding: 12px 16px !important;
        font-size: 14px;
        border-radius: 20px;
    }
}