/* ============================================================================
   ZeeApps — Authentication screens
   Sign in · Register · Forgot password

   A single centred card floating over a full-screen animated aurora. The card
   carries both the identity and the work; the background carries the mood. One
   layout for all three screens, so nothing shifts by a pixel as a user moves
   between them.

   Depends on zee-tokens.css and zee-ui.css.
   ========================================================================= */

.auth {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--s-10) var(--s-4);
    overflow: hidden;
    font-family: var(--font-sans);
    color: var(--ink);
    /* Deep base so the aurora and the light card both read with maximum contrast. */
    background:
        radial-gradient(1200px 800px at 15% -10%, #1e1147 0%, transparent 55%),
        radial-gradient(1000px 700px at 110% 20%, #2a0f4a 0%, transparent 55%),
        linear-gradient(160deg, #0a0618 0%, #0d0a24 45%, #090616 100%);
}

/* ── Animated backdrop ───────────────────────────────────────────────────── */

.auth-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.62;
    mix-blend-mode: screen;
    will-change: transform;
}
.auth-blob-1 {
    width: 46vw; height: 46vw; min-width: 380px; min-height: 380px;
    top: -12vw; left: -8vw;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 68%);
    animation: zee-blob-1 26s var(--ease-in-out) infinite;
}
.auth-blob-2 {
    width: 42vw; height: 42vw; min-width: 340px; min-height: 340px;
    top: -6vw; right: -10vw;
    background: radial-gradient(circle, #d946ef 0%, transparent 68%);
    animation: zee-blob-2 30s var(--ease-in-out) infinite;
}
.auth-blob-3 {
    width: 44vw; height: 44vw; min-width: 360px; min-height: 360px;
    bottom: -16vw; left: 4vw;
    background: radial-gradient(circle, #38bdf8 0%, transparent 68%);
    animation: zee-blob-3 34s var(--ease-in-out) infinite;
}
.auth-blob-4 {
    width: 38vw; height: 38vw; min-width: 320px; min-height: 320px;
    bottom: -14vw; right: -6vw;
    background: radial-gradient(circle, #6366f1 0%, transparent 68%);
    animation: zee-blob-4 28s var(--ease-in-out) infinite;
}

/* Fine grid for texture, faded out toward the edges. */
.auth-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 25%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 25%, transparent 80%);
}

/* A soft central halo directly behind the card. */
.auth-glow {
    position: absolute; top: 50%; left: 50%;
    width: 620px; height: 620px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgb(139 92 246 / 0.22), transparent 62%);
    filter: blur(30px);
}

/* ── Stage + card ────────────────────────────────────────────────────────── */

.auth-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 452px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-4);
}

.auth-card {
    position: relative;
    width: 100%;
    padding: var(--s-8) var(--s-8) var(--s-7);
    background: color-mix(in srgb, var(--slate-0, #fff) 92%, transparent);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    backdrop-filter: blur(26px) saturate(160%);
    border: 1px solid rgb(255 255 255 / 0.55);
    border-radius: var(--r-2xl);
    box-shadow:
        0 30px 80px rgb(8 5 20 / 0.55),
        0 8px 24px rgb(8 5 20 / 0.35),
        inset 0 1px 0 rgb(255 255 255 / 0.9);
    animation: zee-card-in var(--dur-slower) var(--ease-out) both;
    color: var(--slate-900, #0f172a);
}

/* Gradient hairline across the top edge. */
.auth-card::before {
    content: '';
    position: absolute; top: 0; left: 26px; right: 26px; height: 2px;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, transparent, #8b5cf6, #38bdf8, transparent);
    opacity: 0.85;
}

/* ── Brand line inside the card ──────────────────────────────────────────── */

.auth-brandline {
    display: flex; align-items: center; gap: var(--s-3);
    margin-bottom: var(--s-6);
}
.auth-logo-mark {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 8px 20px rgb(124 58 237 / 0.40);
}
.auth-logo-mark svg { width: 22px; height: 22px; fill: #fff; }
.auth-logo-name {
    font-size: var(--fs-lg); font-weight: var(--fw-black);
    letter-spacing: var(--ls-tight); color: var(--ink);
}
.auth-logo-sub {
    font-size: var(--fs-xs); color: var(--ink-muted);
    letter-spacing: var(--ls-wide); text-transform: uppercase;
}

/* Primary action: a light sheen sweeps across on hover. */
.auth-card .zee-btn-primary { position: relative; overflow: hidden; }
.auth-card .zee-btn-primary::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 32%, rgb(255 255 255 / 0.30) 50%, transparent 68%);
    transform: translateX(-130%);
    transition: transform var(--dur-slower) var(--ease-out);
    pointer-events: none;
}
.auth-card .zee-btn-primary:hover::after { transform: translateX(130%); }

/* ── Card copy ───────────────────────────────────────────────────────────── */

.auth-head { margin-bottom: var(--s-6); }
.auth-head h2 {
    margin: 0 0 6px;
    font-size: var(--fs-3xl);
    font-weight: var(--fw-black);
    letter-spacing: var(--ls-tighter);
    line-height: var(--lh-tight);
    color: var(--ink);
}
.auth-head p { margin: 0; font-size: var(--fs-md); color: var(--ink-muted); }

.auth-body { display: flex; flex-direction: column; gap: var(--s-4); }

.auth-foot {
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--border-soft);
    font-size: var(--fs-base);
    color: var(--ink-muted);
    text-align: center;
}
.auth-foot a { color: var(--accent-ink); font-weight: var(--fw-semibold); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.auth-link-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.auth-link {
    background: none; border: none; padding: 0;
    font: inherit; font-size: var(--fs-base); font-weight: var(--fw-semibold);
    color: var(--accent-ink); cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }

/* ── Trust badges (light-card variant) ───────────────────────────────────── */

.auth-trust {
    display: flex; flex-wrap: wrap; gap: var(--s-2);
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--border-soft);
}
.auth-trust-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs); font-weight: var(--fw-semibold);
    color: var(--ink-secondary);
    background: var(--accent-softer);
    border: 1px solid var(--border-accent);
}
.auth-trust-pill i {
    width: 7px; height: 7px; border-radius: 50%;
    background: #10b981;
    animation: zee-pulse-dot 2.2s var(--ease-in-out) infinite;
}

/* ── Legal line under the card ───────────────────────────────────────────── */

.auth-legal {
    display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
    justify-content: center;
    font-size: var(--fs-xs);
    color: rgb(255 255 255 / 0.45);
}
.auth-legal a { color: rgb(255 255 255 / 0.68); text-decoration: none; }
.auth-legal a:hover { color: #fff; text-decoration: underline; }

/* ── Stepper ─────────────────────────────────────────────────────────────── */

.auth-steps { display: flex; align-items: center; gap: 6px; margin-bottom: var(--s-6); }
.auth-step  { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.auth-step-bar { height: 4px; border-radius: var(--r-full); background: var(--border); overflow: hidden; }
.auth-step-bar span {
    display: block; height: 100%; width: 0;
    border-radius: var(--r-full); background: var(--grad-accent);
    transition: width var(--dur-slow) var(--ease-out);
}
.auth-step-done  .auth-step-bar span,
.auth-step-active .auth-step-bar span { width: 100%; }
.auth-step-label {
    font-size: var(--fs-2xs); font-weight: var(--fw-bold);
    letter-spacing: var(--ls-wide); text-transform: uppercase;
    color: var(--ink-faint); transition: color var(--dur-base) var(--ease-out);
}
.auth-step-active .auth-step-label { color: var(--accent-ink); }
.auth-step-done   .auth-step-label { color: var(--ink-muted); }

/* ── Email confirmation strip ────────────────────────────────────────────── */

.auth-sent {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    background: var(--accent-softer);
    border: 1px solid var(--border-accent);
}
.auth-sent-icon {
    display: grid; place-items: center;
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--grad-accent); color: #fff;
}
.auth-sent-icon svg { width: 17px; height: 17px; }
.auth-sent-text { min-width: 0; font-size: var(--fs-base); color: var(--ink-secondary); }
.auth-sent-text strong { display: block; color: var(--ink); font-weight: var(--fw-semibold); }

/* ── Employee confirmation card ──────────────────────────────────────────── */

.auth-employee {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-4);
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.auth-employee-meta { min-width: 0; }
.auth-employee-name { font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
.auth-employee-role { font-size: var(--fs-base); color: var(--ink-muted); }
.auth-employee-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

/* ── Password strength ───────────────────────────────────────────────────── */

.auth-strength { display: flex; flex-direction: column; gap: 6px; }
.auth-strength-bars { display: flex; gap: 4px; }
.auth-strength-bars i {
    flex: 1; height: 4px; border-radius: var(--r-full);
    background: var(--border); transition: background var(--dur-base) var(--ease-out);
}
.auth-strength-1 i:nth-child(-n+1) { background: var(--rose-500); }
.auth-strength-2 i:nth-child(-n+2) { background: var(--orange-500); }
.auth-strength-3 i:nth-child(-n+3) { background: var(--amber-500); }
.auth-strength-4 i:nth-child(-n+4) { background: var(--mint-500); }
.auth-strength-note { font-size: var(--fs-sm); color: var(--ink-muted); }

.auth-rules { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.auth-rules li {
    display: flex; align-items: center; gap: 7px;
    font-size: var(--fs-sm); color: var(--ink-muted);
    transition: color var(--dur-fast) var(--ease-out);
}
.auth-rules li svg { width: 13px; height: 13px; flex-shrink: 0; }
.auth-rule-met { color: var(--success-ink); }

/* ── Code entry ──────────────────────────────────────────────────────────── */

.auth-code {
    width: 100%;
    height: 62px;
    padding: 0 var(--s-4);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 30px; font-weight: var(--fw-bold);
    letter-spacing: 14px; text-indent: 14px;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.auth-code::placeholder { color: var(--ink-faint); font-weight: var(--fw-normal); }
.auth-code:hover { border-color: var(--border-strong); }
.auth-code:focus {
    outline: none; border-color: var(--accent);
    box-shadow: var(--ring); background: var(--accent-softer);
}
.auth-code-error { border-color: var(--danger) !important; }
.auth-code::-webkit-outer-spin-button,
.auth-code::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Resend countdown ────────────────────────────────────────────────────── */

.auth-resend {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: var(--fs-base); color: var(--ink-muted);
}
.auth-resend button:disabled { color: var(--ink-faint); cursor: not-allowed; text-decoration: none; }

/* ── Success panel ───────────────────────────────────────────────────────── */

.auth-done { text-align: center; padding: var(--s-4) 0; }
.auth-done-mark {
    display: grid; place-items: center;
    width: 68px; height: 68px; margin: 0 auto var(--s-5);
    border-radius: 50%;
    background: var(--success-soft); color: var(--success-ink);
    animation: zee-scale-in var(--dur-slow) var(--ease-spring) both;
}
.auth-done-mark svg { width: 32px; height: 32px; }
.auth-done h2 { margin: 0 0 var(--s-2); font-size: var(--fs-2xl); font-weight: var(--fw-black); letter-spacing: var(--ls-tighter); }
.auth-done p  { margin: 0 auto; max-width: 320px; font-size: var(--fs-md); color: var(--ink-muted); }

/* ── Geolocation notice ──────────────────────────────────────────────────── */

.auth-geo {
    display: flex; align-items: center; gap: var(--s-3);
    padding: 10px var(--s-3);
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    border: 1px solid var(--border-soft);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    transition: all var(--dur-base) var(--ease-out);
}
.auth-geo-ok   { background: var(--success-soft); border-color: rgb(16 185 129 / 0.22); color: var(--success-ink); }
.auth-geo-warn { background: var(--warning-soft); border-color: rgb(245 158 11 / 0.24); color: var(--warning-ink); }
.auth-geo-fading { opacity: 0; transform: translateY(-4px); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
    .auth { padding: var(--s-6) var(--s-3); }
    .auth-card { padding: var(--s-6) var(--s-5); }
    .auth-head h2 { font-size: var(--fs-2xl); }
}

@media (max-width: 420px) {
    .zee-otp { gap: 5px; }
    .zee-otp input { width: 100%; min-width: 0; height: 50px; font-size: var(--fs-xl); }
}

/* ── Motion ──────────────────────────────────────────────────────────────── */

@keyframes zee-blob-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(8vw, 6vw) scale(1.12); }
}
@keyframes zee-blob-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-7vw, 8vw) scale(1.08); }
}
@keyframes zee-blob-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(9vw, -6vw) scale(1.14); }
}
@keyframes zee-blob-4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-8vw, -7vw) scale(1.06); }
}

@keyframes zee-card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)     scale(1);   }
}

@keyframes zee-pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0   rgb(16 185 129 / 0.55); }
    50%      { box-shadow: 0 0 0 5px rgb(16 185 129 / 0);    }
}

/* Respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
    .auth-blob, .auth-card, .auth-trust-pill i { animation: none !important; }
}
