/**
 * Oralyze Auth Security, OTP & Captcha Styles
 * Luxury Editorial Aesthetic matching Wonder / Nook
 * 
 * Palette:
 * - Oralyze Periwinkle: #767EFC
 * - Deep Indigo (Action): #393CAD / #2D308C
 * - Ink (Body): #20213A
 * - Warm White: #FAF9F6
 * - Pale Lilac: #F0EFFF
 * - WhatsApp Green: #25D366 / #20BA59 / #E7F9EE
 * - Gold Accent: #FCB40D
 */

/* ==========================================================================
   1. Multi-Channel Method Switcher Navigation (Mobile vs Email)
   ========================================================================== */
.oralyze-auth-methods-nav {
    display: flex;
    background: #F0EFFF;
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 22px;
    gap: 4px;
    position: relative;
    box-sizing: border-box;
}

.oralyze-method-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-family: var(--ow-font-sans, "Mona Sans", -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #555770;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.oralyze-method-btn:hover {
    color: var(--ow-color-action, #393CAD);
}

.oralyze-method-btn.is-active {
    background: #FFFFFF;
    color: var(--ow-color-action, #393CAD);
    box-shadow: 0 2px 8px rgba(57, 60, 173, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.oralyze-method-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.oralyze-method-btn:hover svg {
    transform: scale(1.08);
}

/* Method Badge Pills */
.method-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 999px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.method-badge-pill--whatsapp {
    background: #E7F9EE;
    color: #128C7E;
}

.oralyze-method-btn.is-active .method-badge-pill--whatsapp {
    background: #25D366;
    color: #FFFFFF;
    box-shadow: 0 1px 4px rgba(37, 211, 102, 0.35);
}

.method-badge-pill--subtle {
    background: #E8E7EE;
    color: #555770;
}

.oralyze-method-btn.is-active .method-badge-pill--subtle {
    background: var(--ow-color-action, #393CAD);
    color: #FFFFFF;
}

/* Method Pane Visibility */
.oralyze-aisensy-login {
    display: grid;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
}

.oralyze-aisensy-login [hidden] {
    display: none !important;
}

.oralyze-aisensy-login .auth-label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.oralyze-aisensy-login input,
.oralyze-aisensy-login button {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.auth-method-pane {
    display: none;
}

.auth-method-pane.is-active {
    display: block;
    animation: oralyzeFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes oralyzeFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   2. Email Sub-mode Switcher (Instant OTP vs Password)
   ========================================================================== */
.email-subnav {
    display: flex;
    background: #FAF9F6;
    border: 1px solid #E8E7EE;
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 18px;
    gap: 3px;
}

.email-mode-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    font-family: var(--ow-font-sans, "Mona Sans", sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: #555770;
    background: transparent;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.email-mode-btn:hover {
    color: var(--ow-color-action, #393CAD);
}

.email-mode-btn.is-active {
    background: #FFFFFF;
    color: var(--ow-color-action, #393CAD);
    box-shadow: 0 1px 4px rgba(57, 60, 173, 0.08);
}

.email-subpane {
    animation: oralyzeFadeIn 0.22s ease;
}


/* ==========================================================================
   3. OTP Form Inputs & Country Code
   ========================================================================== */
.oralyze-otp-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.phone-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.phone-country-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: #F4F4F7;
    border: 1px solid #E2E1EC;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #20213A;
    user-select: none;
    flex-shrink: 0;
}

.phone-country-code .flag-emoji {
    font-size: 15px;
}

.phone-number-input,
.email-otp-input {
    flex: 1;
}


/* ==========================================================================
   4. Action Buttons (WhatsApp Primary, SMS Secondary, Email)
   ========================================================================== */
.otp-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

/* Primary WhatsApp CTA Button */
.ow-btn-send-whatsapp {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 22px;
    background: #25D366;
    color: #FFFFFF;
    font-family: var(--ow-font-sans, "Mona Sans", sans-serif);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.25);
}

.ow-btn-send-whatsapp:hover:not(:disabled) {
    background: #20BA59;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}

.ow-btn-send-whatsapp:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.ow-btn-send-whatsapp svg {
    flex-shrink: 0;
}

/* Primary Email CTA Button */
.ow-btn-send-email {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    background: var(--ow-color-action, #393CAD);
    color: #FFFFFF;
    font-family: var(--ow-font-sans, "Mona Sans", sans-serif);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(57, 60, 173, 0.18);
}

.ow-btn-send-email:hover:not(:disabled) {
    background: #2D308C;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(57, 60, 173, 0.28);
}

.ow-btn-send-email:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Secondary / Fallback SMS Container */
.otp-channel-fallback,
.otp-send-action-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
}

.fallback-note {
    color: #8E8EA0;
}

.btn-fallback-channel,
.ow-btn-fallback-sms {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: var(--ow-color-action, #393CAD);
    font-family: var(--ow-font-sans, "Mona Sans", sans-serif);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.18s ease;
}

.btn-fallback-channel:hover,
.ow-btn-fallback-sms:hover {
    color: #2D308C;
}

.btn-fallback-channel svg,
.ow-btn-fallback-sms svg {
    flex-shrink: 0;
}

.channel-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.channel-dot--whatsapp {
    background: #25D366;
    box-shadow: 0 0 6px rgba(37, 211, 102, 0.6);
}

.channel-dot--sms {
    background: var(--ow-color-action, #393CAD);
}

.ow-link-switch-channel,
.btn-resend-fallback-channel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #555770;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.18s ease;
}

.ow-link-switch-channel:hover,
.btn-resend-fallback-channel:hover {
    color: var(--ow-color-action, #393CAD);
}


/* ==========================================================================
   5. OTP Verification Box & 6-Digit Grid Inputs
   ========================================================================== */
.otp-verification-box {
    display: none;
    background: #FAF9F6;
    border: 1px solid #E8E7EE;
    border-radius: 18px;
    padding: 20px;
    margin-top: 10px;
    animation: oralyzeFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.otp-verification-box.is-visible {
    display: block;
}

/* Header Notice & Timer */
.otp-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.otp-target-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #20213A;
}

.channel-badge-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.channel-badge-indicator--whatsapp {
    background: #E7F9EE;
    color: #25D366;
}

.channel-badge-indicator--sms {
    background: #F0EFFF;
    color: var(--ow-color-action, #393CAD);
}

.channel-badge-indicator--email {
    background: #F0EFFF;
    color: var(--ow-color-action, #393CAD);
}

.otp-timer-box {
    font-size: 12px;
    color: #555770;
}

.otp-countdown-text {
    font-variant-numeric: tabular-nums;
    color: #8E8EA0;
}

.otp-resend-action-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--ow-color-action, #393CAD);
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.otp-resend-action-btn:hover {
    color: #2D308C;
}

/* 6-Digit OTP Inputs Grid */
.otp-digits-wrapper {
    margin: 10px 0 14px 0;
}

.otp-grid-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555770;
    margin-bottom: 8px;
    text-align: center;
}

.otp-inputs-grid {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.otp-digit {
    width: 46px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    border: 1.5px solid #D6D5E3;
    border-radius: 12px;
    background: #FFFFFF;
    color: #20213A;
    transition: all 0.2s ease;
    box-sizing: border-box;
    padding: 0;
}

.otp-digit:focus {
    outline: none;
    border-color: var(--ow-color-action, #393CAD);
    box-shadow: 0 0 0 3px rgba(118, 126, 252, 0.25);
    background: #FFFFFF;
    transform: scale(1.04);
}

/* In-Verification Fallback Switch Bar */
.otp-switch-channel-bar {
    text-align: center;
    margin-top: 10px;
}

.btn-resend-fallback-channel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #555770;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.18s ease;
}

.btn-resend-fallback-channel:hover {
    color: var(--ow-color-action, #393CAD);
}

/* Verify Button */
.ow-btn-verify-otp {
    width: 100%;
    margin-top: 14px;
    padding: 13px 22px;
    background: var(--ow-color-action, #393CAD);
    color: #FFFFFF;
    font-family: var(--ow-font-sans, "Mona Sans", sans-serif);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(57, 60, 173, 0.18);
}

.ow-btn-verify-otp:hover:not(:disabled) {
    background: #2D308C;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(57, 60, 173, 0.28);
}

.ow-btn-verify-otp:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}


/* ==========================================================================
   6. Status, Notifications & Demo Alerts
   ========================================================================== */
.oralyze-auth-status {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 10px;
    display: none;
}

.oralyze-auth-status.is-visible {
    display: block;
    animation: oralyzeFadeIn 0.25s ease;
}

.oralyze-auth-status.status--info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

.oralyze-auth-status.status--success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.oralyze-auth-status.status--error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.demo-otp-callout {
    margin-top: 8px;
    padding: 8px 12px;
    background: #FFFBEB;
    border: 1px dashed #F59E0B;
    border-radius: 10px;
    font-size: 12px;
    color: #B45309;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.demo-otp-code {
    background: #FEF3C7;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #92400E;
    border: 1px solid #FDE68A;
}


/* ==========================================================================
   7. Captcha Challenge Styling
   ========================================================================== */
.oralyze-captcha-field {
    margin: 14px 0;
    padding: 14px 16px;
    background: #FAF9F6;
    border: 1px solid #E7E6ED;
    border-radius: 14px;
}

.captcha-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #555770;
    margin-bottom: 8px;
}

.captcha-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ow-color-action, #393CAD);
}

.captcha-question {
    font-size: 13px;
    font-weight: 700;
    color: #20213A;
    background: #FFFFFF;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #E2E1EC;
}

.captcha-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.captcha-answer-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #D6D5E3;
    border-radius: 8px;
    font-size: 14px;
    background: #FFFFFF;
}

.captcha-answer-input:focus {
    outline: none;
    border-color: var(--ow-color-action, #393CAD);
}

.btn-refresh-captcha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #FFFFFF;
    border: 1px solid #D6D5E3;
    border-radius: 8px;
    color: #555770;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-refresh-captcha:hover {
    color: var(--ow-color-action, #393CAD);
    border-color: var(--ow-color-action, #393CAD);
    background: #F0EFFF;
    transform: rotate(30deg);
}

.btn-refresh-captcha.is-spinning svg {
    animation: captchaSpin 0.6s linear infinite;
}

@keyframes captchaSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Spinner element */
.ow-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #FFFFFF;
    animation: captchaSpin 0.7s linear infinite;
    vertical-align: middle;
}


/* ==========================================================================
   8. Responsive Adjustments
   ========================================================================== */
@media (max-width: 480px) {
    .oralyze-auth-methods-nav {
        flex-direction: column;
        border-radius: 16px;
        padding: 6px;
    }

    .oralyze-method-btn {
        justify-content: space-between;
        padding: 8px 12px;
    }

    .otp-inputs-grid {
        gap: 5px;
    }

    .otp-digit {
        width: 38px;
        height: 46px;
        font-size: 18px;
        border-radius: 8px;
    }

    .otp-prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ==========================================================================
   9. Sign in with Google (OAuth 2.0 & GIS) Luxury Styling
   ========================================================================== */
.oralyze-auth-divider {
    position: relative;
    text-align: center;
    margin: 22px 0 16px;
    clear: both;
}

.oralyze-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E8E7EE;
}

.oralyze-auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 14px;
    background: #FFFFFF;
    color: #717288;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-sans, 'Mona Sans', sans-serif);
}

.auth-drawer-panel .oralyze-auth-divider span {
    background: #FFFFFF;
}

.oralyze-google-auth-wrap {
    margin-top: 6px;
    margin-bottom: 8px;
    width: 100%;
}

.oralyze-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    background: #FFFFFF;
    color: #20213A !important;
    border: 1px solid #D5D4E0;
    border-radius: 9999px;
    font-family: var(--font-sans, 'Mona Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(32, 33, 58, 0.04);
    box-sizing: border-box;
}

.oralyze-google-btn:hover {
    background: #F8F8FC;
    border-color: #BDBBCC;
    color: #20213A !important;
    box-shadow: 0 4px 12px rgba(32, 33, 58, 0.08);
    transform: translateY(-1px);
}

.oralyze-google-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(32, 33, 58, 0.04);
}

.oralyze-google-btn svg.ow-icon-google {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: block;
}

.oralyze-google-btn .ow-spinner {
    border-color: rgba(32, 33, 58, 0.2);
    border-top-color: #393CAD;
}

.oralyze-google-btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
    cursor: wait;
}

.oralyze-google-status {
    margin-top: 10px;
    padding: 10px 14px;
    background: #FFF5F5;
    border: 1px solid #FED7D7;
    border-radius: 8px;
    font-size: 13px;
    color: #C53030;
    text-align: center;
    line-height: 1.4;
    font-family: var(--font-sans, 'Mona Sans', sans-serif);
}
