/**
 * Authentication Styles - OTP Login Only
 * Fixed button designs with !important rules
 */

/* Main Wrapper */
.cfp-auth-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    background: #f8f9fa !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Auth Container */
.cfp-auth-container {
    width: 100% !important;
    max-width: 440px !important;
    background: white !important;
    border-radius: 20px !important;
    padding: 40px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
}

/* Logo Image */
.cfp-auth-header {
    text-align: center !important;
    margin-bottom: 32px !important;
}

.cfp-logo {
    max-width: 180px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Form Sections */
.cfp-auth-form {
    display: none !important;
}

.cfp-auth-form.active {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out !important;
}

.cfp-auth-form h2 {
    font-size: clamp(24px, 4vw, 28px) !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin: 0 0 8px 0 !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

.cfp-auth-subtitle {
    font-size: clamp(14px, 2vw, 16px) !important;
    color: #666 !important;
    text-align: center !important;
    margin: 0 0 32px 0 !important;
    line-height: 1.5 !important;
    font-size: 12px !important;
}

/* Form Elements */
.cfp-form {
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

.cfp-form-group {
    margin-bottom: 20px !important;
    width: 100% !important;
}

.cfp-form-group label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 8px !important;
}

.cfp-form-group input[type="email"],
.cfp-form-group input[type="text"] {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    background: #fafafa !important;
}

.cfp-form-group input:focus {
    outline: none !important;
    border-color: #4888E8 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(72, 136, 232, 0.1) !important;
}

.cfp-form-group input::placeholder {
    color: #999 !important;
}

/* Form Row (Send OTP button) */
.cfp-form-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 24px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
}

/* SEND OTP BUTTON - FIXED DESIGN */
.cfp-btn-send-otp {
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: white !important;
    background: linear-gradient(90deg, #4A8FED 0%, #2DC76D 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    margin: 0 !important;
    display: inline-block !important;
    text-align: center !important;
    box-shadow: 0 4px 15px rgba(74, 143, 237, 0.3) !important;
    width: auto !important;
    min-width: 120px !important;
}

.cfp-btn-send-otp:hover:not(:disabled) {
    background: linear-gradient(90deg, #3D7DD9 0%, #25B05E 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(74, 143, 237, 0.4) !important;
}

.cfp-btn-send-otp:active:not(:disabled) {
    transform: translateY(0) !important;
}

.cfp-btn-send-otp:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background: linear-gradient(90deg, #9CA3AF 0%, #6B7280 100%) !important;
    box-shadow: none !important;
}

.cfp-btn-send-otp.loading {
    cursor: not-allowed !important;
}

/* LOGIN BUTTON - FIXED DESIGN */
.cfp-btn-login {
    width: 100% !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
    background: linear-gradient(90deg, #4A8FED 0%, #2DC76D 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    font-family: inherit !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 24px auto !important;
    box-shadow: 0 4px 15px rgba(74, 143, 237, 0.3) !important;
    box-sizing: border-box !important;
}

.cfp-btn-login:hover:not(:disabled) {
    background: linear-gradient(90deg, #3D7DD9 0%, #25B05E 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(74, 143, 237, 0.4) !important;
}

.cfp-btn-login:active:not(:disabled) {
    transform: translateY(0) !important;
}

.cfp-btn-login:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background: linear-gradient(90deg, #3D7DD9 0%, #25B05E 100%) !important;
    box-shadow: none !important;
}

.cfp-btn-login.loading {
    cursor: not-allowed !important;
}

.cfp-btn-login .cfp-btn-loader {
    display: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 3px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: white !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
    margin: 0 auto !important;
}

.cfp-btn-login.loading .cfp-btn-text {
    display: none !important;
}

.cfp-btn-login.loading .cfp-btn-loader {
    display: block !important;
}

/* Secondary Button (if needed for other purposes) */
.cfp-btn-secondary {
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #4888E8 !important;
    background: #f3f4f6 !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    margin: 0 !important;
    display: inline-block !important;
    text-align: center !important;
}

.cfp-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb !important;
}

.cfp-btn-secondary:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Resend OTP Link */
.cfp-resend-otp-link {
    font-size: 14px !important;
    color: #4888E8 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
    white-space: nowrap !important;
}

.cfp-resend-otp-link:hover {
    color: #357ABD !important;
    text-decoration: underline !important;
}

.cfp-resend-otp-link:active {
    color: #2c5da0 !important;
}

/* OTP Timer */
.cfp-otp-timer {
    text-align: center !important;
    margin: 15px 0 !important;
    font-size: 14px !important;
    color: #666 !important;
    display: none !important;
}

#timer-countdown {
    font-weight: bold !important;
    color: #4A8FED !important;
}

/* OTP Hint */
.cfp-otp-hint {
    font-size: 12px !important;
    color: #666 !important;
    margin-top: 5px !important;
    font-style: italic !important;
}

/* Messages */
.cfp-auth-message {
    text-align: center !important;
    animation: fadeIn 0.3s ease-in-out !important;
    padding: 20px !important;
    width: 100% !important;
    display: none !important;
}

.cfp-message-icon {
    margin: 0 auto 20px !important;
    width: 60px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cfp-auth-message h3 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin: 0 0 12px 0 !important;
}

.cfp-auth-message p {
    font-size: 14px !important;
    color: #666 !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.5 !important;
}

/* Temporary Messages */
.cfp-temp-message {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    z-index: 10000 !important;
    display: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.cfp-temp-success {
    background: #10b981 !important;
    color: white !important;
}

.cfp-temp-error {
    background: #ef4444 !important;
    color: white !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .cfp-auth-wrapper {
        padding: 15px !important;
        align-items: flex-start !important;
        min-height: 100vh !important;
    }

    .cfp-auth-container {
        padding: 30px 25px !important;
        border-radius: 16px !important;
        max-width: 400px !important;
    }

    .cfp-logo {
        max-width: 160px !important;
    }

    .cfp-form-group input[type="email"],
    .cfp-form-group input[type="text"] {
        padding: 16px !important;
        font-size: 16px !important;
    }

    .cfp-btn-login {
        padding: 16px !important;
        font-size: 16px !important;
        width: 100% !important;
    }

    .cfp-btn-send-otp {
        padding: 12px 20px !important;
        font-size: 14px !important;
        min-width: 110px !important;
    }

    .cfp-form-row {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
}

@media (max-width: 480px) {
    .cfp-auth-wrapper {
        padding: 10px !important;
    }

    .cfp-auth-container {
        padding: 25px 20px !important;
        border-radius: 12px !important;
        max-width: 100% !important;
    }

    .cfp-logo {
        max-width: 140px !important;
    }

    .cfp-auth-form h2 {
        font-size: 22px !important;
    }

    .cfp-auth-subtitle {
        font-size: 14px !important;
    }

    .cfp-form-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    .cfp-btn-send-otp {
        width: 100% !important;
        text-align: center !important;
    }

    .cfp-resend-otp-link {
        align-self: center !important;
        text-align: center !important;
        display: inline-block !important;
    }

    .cfp-btn-login {
        padding: 16px 20px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 360px) {
    .cfp-auth-container {
        padding: 20px 15px !important;
    }

    .cfp-logo {
        max-width: 120px !important;
    }

    .cfp-auth-form h2 {
        font-size: 20px !important;
    }

    .cfp-btn-login {
        padding: 14px !important;
        font-size: 15px !important;
    }

    .cfp-btn-send-otp {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

/* Focus state for accessibility */
.cfp-btn-login:focus,
.cfp-btn-send-otp:focus,
.cfp-form-group input:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(74, 143, 237, 0.3) !important;
}

/* Loading state */
.cfp-btn-login.loading .cfp-btn-text,
.cfp-btn-send-otp.loading .cfp-btn-text {
    display: none !important;
}

.cfp-btn-login.loading .cfp-btn-loader,
.cfp-btn-send-otp.loading .cfp-btn-loader {
    display: block !important;
}

/* Ensure all buttons have consistent gradient */
button.cfp-btn-login,
button.cfp-btn-send-otp,
input[type="submit"].cfp-btn-login,
input[type="button"].cfp-btn-send-otp {
    background: linear-gradient(90deg, #4A8FED 0%, #2DC76D 100%) !important;
    color: white !important;
    border: none !important;
}

/* Override any potential conflicting styles */
#cfp-send-otp-btn,
#cfp-login-submit {
    all: unset !important;
}

#cfp-send-otp-btn {
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: white !important;
    background: linear-gradient(90deg, #4A8FED 0%, #2DC76D 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    margin: 0 !important;
    display: inline-block !important;
    text-align: center !important;
    box-shadow: 0 4px 15px rgba(74, 143, 237, 0.3) !important;
    width: auto !important;
    min-width: 120px !important;
}

#cfp-login-submit {
    width: 100% !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
    background: linear-gradient(90deg, #4A8FED 0%, #2DC76D 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    font-family: inherit !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 24px auto !important;
    box-shadow: 0 4px 15px rgba(74, 143, 237, 0.3) !important;
    box-sizing: border-box !important;
}

#cfp-send-otp-btn:hover:not(:disabled) {
    background: linear-gradient(90deg, #3D7DD9 0%, #25B05E 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px (90deg, #3D7DD9 0%, #25B05E 100%) !important;
}

#cfp-login-submit:hover:not(:disabled) {
    background: linear-gradient(90deg, #3D7DD9 0%, #25B05E 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px (90deg, #3D7DD9 0%, #25B05E 100%) !important;
}

#cfp-send-otp-btn:disabled,
#cfp-login-submit:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background: linear-gradient(90deg, #3D7DD9 0%, #25B05E 100%) !important;
    box-shadow: none !important;
}

/* ... (keep all existing styles) ... */

/* OTP Input Group - Hidden by default */
.cfp-otp-input-group {
    display: none;
    animation: slideDown 0.3s ease-out;
}

.cfp-otp-input-group.show {
    display: block !important;
}

/* Resend OTP Link - Better visibility */
.cfp-resend-otp-link {
    font-size: 14px !important;
    color: #4888E8 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

.cfp-resend-otp-link:hover {
    color: #357ABD !important;
    text-decoration: underline !important;
}

.cfp-resend-otp-link:active {
    color: #2c5da0 !important;
}

/* Ensure login button is hidden by default */
#cfp-login-submit {
    display: none;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* =========================================================
   TWO-COLUMN AUTH LAYOUT (UPDATED - LESS GAP)
========================================================= */
.cfp-auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    background: #FFFFFF;
    padding: 20px;
    gap: 20px;
    /* ↓ Reduced from 40px */
}

/* Reduce left side width */
.cfp-auth-left {
    flex: 0.9;
    /* ↓ Earlier 1 (makes too wide), now slightly smaller */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reduce image size slightly */
.cfp-auth-side-image {
    max-width: 80%;
    /* ↓ from 90% */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Right form */
.cfp-auth-right {
    flex: 0.8;
    /* ↓ earlier 1 */
    display: flex;
    justify-content: center;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .cfp-auth-layout {
        flex-direction: column-reverse;
        padding: 20px;
        gap: 10px;
    }

    .cfp-auth-left,
    .cfp-auth-right {
        flex: initial;
        width: 100%;
    }

    .cfp-auth-side-image {
        max-width: 100%;
        margin-top: 10px;
    }
}

/* Checkbox Groups for Terms and Newsletter */
.cfp-checkbox-group {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    text-align: left !important;
}

.cfp-checkbox-group input[type="checkbox"] {
    min-width: 20px !important;
    width: 20px !important;
    height: 20px !important;
    margin-top: 2px !important;
    cursor: pointer !important;
    accent-color: #4888E8;
}

.cfp-checkbox-group label {
    font-size: 14px !important;
    color: #1a1a1a !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    cursor: pointer !important;
    margin: 0 !important;
    display: inline !important;
    /* Override block from .cfp-form-group label */
}

.cfp-checkbox-group a {
    color: #2E6DB5 !important;
    text-decoration: underline !important;
}