/* ============================================================
   Firebase OTP Login – Stylesheet v1.1
   Black buttons, #F5F5F5 accents
   ============================================================ */

:root {
    --fol-primary:       #000000;
    --fol-primary-dark:  #222222;
    --fol-primary-light: #F5F5F5;
    --fol-accent:        #F5F5F5;
    --fol-navy:          #1a1a1a;
    --fol-card-bg:       #ffffff;
    --fol-border:        #e0e0e0;
    --fol-text:          #1a1a1a;
    --fol-text-muted:    #757575;
    --fol-error:         #d32f2f;
    --fol-radius:        12px;
    --fol-shadow:        0 8px 40px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
    --fol-transition:    .22s cubic-bezier(.4,0,.2,1);
}

/* ── Wrapper ── */
#fol-otp-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Card ── */
.fol-card {
    background: var(--fol-card-bg);
    border: 1px solid var(--fol-border);
    border-radius: var(--fol-radius);
    box-shadow: var(--fol-shadow);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fol-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #000;
}

/* ── Steps ── */
.fol-step { display: none; }
.fol-step.active { display: block; animation: folFadeIn .3s ease; }

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

/* ── Icon & headings ── */
.fol-icon { font-size: 2.4rem; display: block; margin-bottom: .5rem; }
.fol-heading {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--fol-navy);
    margin: 0 0 .3rem;
    letter-spacing: -.4px;
}
.fol-subheading {
    font-size: .9rem;
    color: var(--fol-text-muted);
    margin: 0 0 1.8rem;
}

/* ── Field group ── */
.fol-field-group { text-align: left; margin-bottom: 1.25rem; }
.fol-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--fol-text-muted);
    margin-bottom: .45rem;
}
.fol-hint {
    font-size: .76rem;
    color: var(--fol-text-muted);
    margin: .35rem 0 0;
}

/* ── Phone row ── */
.fol-phone-row {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--fol-border);
    border-radius: 9px;
    overflow: hidden;
    transition: border-color var(--fol-transition), box-shadow var(--fol-transition);
}
.fol-phone-row:focus-within {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,.10);
}
.fol-country-code {
    background: var(--fol-accent);
    color: #1a1a1a;
    font-weight: 700;
    padding: 0 .9rem;
    display: flex;
    align-items: center;
    font-size: .95rem;
    border-right: 1.5px solid var(--fol-border);
    white-space: nowrap;
}
.fol-input {
    flex: 1;
    border: none;
    outline: none;
    padding: .8rem .9rem;
    font-size: 1.05rem;
    color: var(--fol-text);
    background: transparent;
    letter-spacing: .04em;
}
.fol-input::placeholder { color: #bdbdbd; }

/* ── OTP boxes ── */
.fol-otp-boxes {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin: .25rem 0;
}
.fol-otp-digit {
    width: 46px;
    height: 54px;
    border: 1.5px solid var(--fol-border);
    border-radius: 9px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--fol-navy);
    outline: none;
    transition: border-color var(--fol-transition), box-shadow var(--fol-transition), background var(--fol-transition);
    background: var(--fol-accent);
}
.fol-otp-digit:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,.10);
    background: #fff;
}
.fol-otp-digit.filled {
    border-color: #000;
    background: #F5F5F5;
    color: #000;
}

/* ── Primary button ── */
.fol-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .85rem 1.5rem;
    border: none;
    border-radius: 9px;
    font-size: .97rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--fol-transition), transform var(--fol-transition), box-shadow var(--fol-transition);
    position: relative;
    overflow: hidden;
    letter-spacing: .03em;
}
.fol-btn:active { transform: scale(.98); }

.fol-btn-primary {
    background: #000;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.fol-btn-primary:hover:not(:disabled) {
    background: #222;
    box-shadow: 0 6px 22px rgba(0,0,0,.30);
}
.fol-btn-primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}
.fol-btn-primary.loading .fol-btn-text { opacity: 0; }
.fol-btn-primary.loading .fol-spinner  { display: inline-block; }

/* ── Spinner ── */
.fol-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: folSpin .7s linear infinite;
    position: absolute;
}
@keyframes folSpin { to { transform: rotate(360deg); } }

/* ── Link buttons ── */
.fol-btn-link {
    background: none;
    border: none;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    font-size: .88rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
    transition: opacity var(--fol-transition);
}
.fol-btn-link:hover { opacity: .65; }
.fol-btn-link:disabled { opacity: .35; cursor: not-allowed; }

/* ── Resend row ── */
.fol-resend-row {
    margin: 1rem 0 .5rem;
    font-size: .86rem;
    color: var(--fol-text-muted);
    min-height: 1.4em;
}
.fol-timer-text { font-variant-numeric: tabular-nums; }
.fol-change-phone { margin-top: .75rem; font-size: .83rem; color: var(--fol-text-muted); }

/* ── Errors ── */
.fol-error {
    color: var(--fol-error);
    font-size: .83rem;
    margin-top: .6rem;
    min-height: 1.1em;
}

/* ── reCAPTCHA ── */
#fol-recaptcha-container { margin-bottom: .5rem; }

/* ── Success step ── */
.fol-step-success { padding: 3rem 2rem; }
.fol-success-icon { font-size: 3.2rem; display: block; margin-bottom: 1rem; animation: folBounce .55s ease; }
@keyframes folBounce {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}
.fol-progress-bar {
    width: 100%; height: 3px;
    background: #F5F5F5;
    border-radius: 99px;
    margin-top: 1.5rem;
    overflow: hidden;
}
.fol-progress-fill {
    height: 100%;
    background: #000;
    border-radius: 99px;
    width: 0;
    animation: folProgress 2s ease forwards;
}
@keyframes folProgress { to { width: 100%; } }

/* ── Hide default WC form & "Login" heading ── */
.fol-hidden-wc-form,
.fol-hidden-wc-form * {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .fol-card { padding: 2rem 1.1rem; }
    .fol-otp-digit { width: 40px; height: 48px; font-size: 1.2rem; }
    .fol-otp-boxes { gap: .35rem; }
    #fol-otp-wrapper { max-width: 100%; }
}
