/* =========================================================
   NextKala — Login / OTP page (WooCommerce myaccount/form-login.php)
   Uses the same design tokens as the homepage / product page
   ("NextKala UI Refresh — 2026" block in main.css). Falls back to
   literal values so this file also works if loaded before main.css.
   ========================================================= */
:root {
    --auth-primary: var(--next-primary, #00baba);
    --auth-primary-dark: var(--next-primary-dark, #008f91);
    --auth-ink: var(--next-ink, #172326);
    --auth-muted: var(--next-muted, #6f7d80);
    --auth-border: var(--next-border, #e9eff0);
    --auth-surface: var(--next-surface, #ffffff);
    --auth-surface-soft: var(--next-surface-soft, #f7fafb);
    --auth-danger: var(--next-danger, #e53935);
    --auth-radius: var(--next-radius, 18px);
    --auth-shadow: var(--next-shadow, 0 10px 30px rgba(23, 35, 38, .06));
    --auth-shadow-hover: var(--next-shadow-hover, 0 16px 36px rgba(23, 35, 38, .12));
}

/* ── Page shell ── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 32px 16px;
    background: var(--auth-surface-soft);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
}

/* ── Header ── */
.auth-header {
    padding: 28px 28px 20px;
    text-align: center;
    background: linear-gradient(180deg, #e8fafa 0%, var(--auth-surface) 100%);
    border-bottom: 1px solid var(--auth-border);
}

.auth-header .brand-link {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.auth-header .brand-link img {
    height: 32px;
    width: auto;
}

.auth-header h2 {
    margin: 0 0 6px;
    color: var(--auth-ink);
    font-size: 18px;
    font-weight: 900;
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 12px;
}

/* ── Body ── */
.auth-body {
    padding: 24px 28px 28px;
}

/* Step dots */
.step-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--auth-border);
    transition: background .2s ease, transform .2s ease;
}

.step-dot.active {
    background: var(--auth-primary);
    transform: scale(1.25);
}

/* Steps: hidden unless .active, so JS only needs to toggle one class */
.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
    animation: authFadeIn .25s ease;
}

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

.auth-step label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-ink);
    font-size: 13px;
    font-weight: 800;
}

.auth-step .auth-label-center {
    text-align: center;
}

/* Phone input */
.input-group-custom {
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-surface-soft);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input-group-custom:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(0, 186, 186, .12);
}

.input-group-custom .prefix {
    padding: 0 12px;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.input-group-custom input {
    flex: 1;
    min-width: 0;
    padding: 13px 12px;
    border: 0;
    background: transparent;
    color: var(--auth-ink);
    font-size: 15px;
    outline: none;
}

/* Error text — hidden until JS marks it visible */
.field-error {
    display: none;
    margin-top: 6px;
    color: var(--auth-danger);
    font-size: 11px;
    font-weight: 700;
}

.field-error.is-visible {
    display: block;
}

.field-error-center {
    text-align: center;
}

/* Primary button */
.btn-auth {
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 7px 18px rgba(0, 186, 186, .18);
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}

.btn-auth:hover {
    background: var(--auth-primary-dark);
}

.btn-auth:active {
    transform: translateY(1px);
}

.btn-auth:disabled {
    background: var(--auth-border);
    box-shadow: none;
    color: var(--auth-muted);
    cursor: not-allowed;
}

/* Helper text under step 1 */
.helper-text {
    margin: 16px 0 0;
    color: var(--auth-muted);
    font-size: 11px;
    text-align: center;
    line-height: 1.9;
}

.helper-text a {
    color: var(--auth-primary);
    font-weight: 700;
}

/* Step 2: phone display + change */
.phone-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--auth-surface-soft);
}

.phone-display span {
    color: var(--auth-ink);
    font-weight: 900;
    direction: ltr;
}

.change-link {
    border: 0;
    background: none;
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* OTP boxes */
.otp-wrap {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 4px;
}

.otp-box {
    width: 46px;
    height: 54px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-surface-soft);
    color: var(--auth-ink);
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.otp-box:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(0, 186, 186, .12);
}

/* Timer row */
.timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.timer-text {
    color: var(--auth-muted);
    font-size: 12px;
}

.timer-text #wcCountdown {
    color: var(--auth-ink);
    font-weight: 900;
}

.resend-btn {
    border: 0;
    background: none;
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.resend-btn:disabled {
    color: var(--auth-muted);
    opacity: .6;
    cursor: not-allowed;
}

/* Step 3: success */
.auth-step-success {
    text-align: center;
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(0, 186, 186, .12);
    color: var(--auth-primary);
    font-size: 26px;
    font-weight: 900;
}

.success-title {
    margin: 0 0 6px;
    color: var(--auth-ink);
    font-size: 16px;
    font-weight: 900;
}

.success-desc {
    margin: 0 0 18px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.8;
}

.progress-wrap {
    height: 4px;
    margin-bottom: 20px;
    border-radius: 4px;
    background: var(--auth-border);
    overflow: hidden;
}

.progress-bar-auth {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: var(--auth-primary);
    transition: width .3s ease;
}

/* ── Small screens ── */
@media (max-width: 480px) {
    .auth-page {
        padding: 0;
        min-height: 100vh;
        align-items: stretch;
    }

    .auth-card {
        max-width: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .otp-box {
        width: 42px;
        height: 50px;
        font-size: 18px;
    }
}