/* PaTaS — Login screen (ICTMO identity, light/dark, animated) */
@import url('fonts.css');

:root {
    --brand-900: #062a33; --brand-800: #083944; --brand-700: #0b4d5c; --brand-600: #0d6274;
    --teal-500: #0891b2; --teal-400: #06b6d4; --teal-300: #67e8f9; --teal-glow: rgba(8,145,178,.4);
    --gold-500: #f0b429; --gold-400: #f6c651;
    --ease: cubic-bezier(.16,1,.3,1);
    --font: 'Inter', system-ui, sans-serif; --font-head: 'Sora', var(--font);
}
:root, :root[data-theme="light"] {
    --bg: #eaf2f5; --surface: #ffffff; --surface-2: #f2f9fb; --border: #d8e6ec;
    --text: #0c2b33; --text-soft: #587680; --text-faint: #93aeb7;
}
:root[data-theme="dark"] {
    --bg: #04141a; --surface: #0c242c; --surface-2: #10303a; --border: #1c414c;
    --text: #e6f3f6; --text-soft: #9dbdc6; --text-faint: #668893;
}

* { box-sizing: border-box; }
body {
    margin: 0; font-family: var(--font);
    height: 100vh; min-height: 600px;
    display: grid; grid-template-columns: 1.05fr 1fr; grid-template-rows: 1fr;
    color: var(--text); background: var(--bg); overflow: hidden;
    transition: background .35s, color .35s;
}

@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }
@keyframes floatY  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes drift   { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-24px) scale(1.12); } 100% { transform: translate(0,0) scale(1); } }
/* barFill removed — progress bar width is now driven by JS (requestAnimationFrame) */
@keyframes glowPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ═══════════════════════════════════════
   LEFT HERO PANEL
   Always uses the dark brand palette so
   the illustration reads clearly; we only
   fine-tune overlay opacity for light mode.
═══════════════════════════════════════ */
.auth-hero {
    /* dark: deep teal gradient — same in both themes (it's a brand panel) */
    background: radial-gradient(circle at 20% 20%, var(--brand-700), var(--brand-900) 72%);
    color: #fff;
    padding: 54px;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden; height: 100%;
    transition: background .35s;
}

/* In light mode brighten the gradient slightly so it doesn't look too dark
   against the light right panel */
[data-theme="light"] .auth-hero {
    background: radial-gradient(circle at 20% 20%, #0d6274, #062a33 72%);
}

/* animated blobs */
.auth-hero .blob { position: absolute; border-radius: 50%; filter: blur(14px); pointer-events: none; }
.auth-hero .blob.b1 {
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(6,182,212,.52), transparent 70%);
    top: -90px; right: -70px;
    animation: drift 14s ease-in-out infinite;
}
.auth-hero .blob.b2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(240,180,41,.35), transparent 70%);
    bottom: -80px; left: -50px;
    animation: drift 18s ease-in-out infinite reverse;
}
/* lighter blobs in light mode */
[data-theme="light"] .auth-hero .blob.b1 { background: radial-gradient(circle, rgba(6,182,212,.42), transparent 70%); }
[data-theme="light"] .auth-hero .blob.b2 { background: radial-gradient(circle, rgba(240,180,41,.28), transparent 70%); }

/* subtle dot grid */
.auth-hero .grid-lines {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 40% 40%, #000, transparent 75%);
}

/* brand / logo row */
.auth-hero .brand { display: flex; align-items: center; gap: 16px; position: relative; z-index: 2; animation: fadeUp .6s var(--ease) both; }
.auth-hero .brand .logo-wrap { position: relative; width: 66px; height: 66px; display: grid; place-items: center; flex-shrink: 0; }
.auth-hero .brand .logo-wrap .ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--teal-300); border-right-color: var(--gold-400); animation: spin 4s linear infinite; }
.auth-hero .brand .logo-wrap img { width: 60px; height: 60px; border-radius: 50%; object-fit: contain; background: #fff; padding: 5px; box-shadow: 0 8px 26px rgba(6,182,212,.55); animation: floatY 5s ease-in-out infinite; }
.auth-hero .brand .brand-abbr { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-300); margin-bottom: 2px; }
.auth-hero .brand b { display: block; font-family: var(--font-head); font-size: 22px; line-height: 1.2; color: #fff; }
.auth-hero .brand .brand-tag { display: block; font-size: 11px; letter-spacing: .08em; color: rgba(255,255,255,.55); margin-top: 3px; }

/* hero headline + features */
.auth-hero .hero-copy { position: relative; z-index: 2; animation: fadeUp .7s var(--ease) .1s both; }
.auth-hero .hero-copy h1 { font-family: var(--font-head); font-size: 42px; line-height: 1.08; margin: 0 0 16px; color: #fff; }
.auth-hero .hero-copy h1 .accent {
    background: linear-gradient(90deg, var(--teal-300), var(--gold-400));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-hero .hero-copy p { color: rgba(255,255,255,.72); font-size: 16px; max-width: 430px; }

.auth-hero .hero-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.auth-hero .hero-feats div {
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,.88); font-size: 14px;
    animation: fadeUp .6s var(--ease) both;
}
.auth-hero .hero-feats div:nth-child(1) { animation-delay: .25s; }
.auth-hero .hero-feats div:nth-child(2) { animation-delay: .35s; }
.auth-hero .hero-feats div:nth-child(3) { animation-delay: .45s; }
.auth-hero .hero-feats .tick {
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(6,182,212,.22); color: var(--teal-300);
    display: grid; place-items: center; font-size: 13px;
    flex-shrink: 0;
}

/* footer */
.auth-hero .foot { position: relative; z-index: 2; color: rgba(255,255,255,.4); font-size: 12.5px; }

/* ═══════════════════════════════════════════════════════
   RIGHT FORM PANEL — redesigned, fully theme-aware
═══════════════════════════════════════════════════════ */

/* extra keyframes for right panel decorations */
@keyframes afOrbit  { to { transform: rotate(360deg); } }
@keyframes afFloat  { 0%,100%{transform:translateY(0) scale(1);} 50%{transform:translateY(-12px) scale(1.03);} }
@keyframes afPing   { 0%{transform:scale(1);opacity:.8;} 100%{transform:scale(2.4);opacity:0;} }
@keyframes afSlideIn{ from{opacity:0;transform:translateX(32px);} to{opacity:1;transform:none;} }
@keyframes afShimBtn{ 0%{left:-80%;} 100%{left:130%;} }

.auth-form-wrap {
    display: flex; align-items: center; justify-content: center;
    padding: 40px 32px;
    position: relative;
    height: 100%; overflow: hidden;
    /* light: soft airy teal-tinted gradient */
    background: radial-gradient(ellipse at 70% 20%, rgba(6,182,212,.12) 0%, transparent 55%),
                radial-gradient(ellipse at 20% 85%, rgba(240,180,41,.08) 0%, transparent 50%),
                var(--bg);
    transition: background .35s;
}
:root[data-theme="dark"] .auth-form-wrap {
    background: radial-gradient(ellipse at 70% 20%, rgba(6,182,212,.14) 0%, transparent 55%),
                radial-gradient(ellipse at 20% 85%, rgba(240,180,41,.1) 0%, transparent 50%),
                var(--bg);
}

/* theme toggle */
.auth-form-wrap .theme-toggle { position: absolute; top: 22px; right: 24px; z-index: 10; }

/* ── Decorative orbiting ring ── */
.auth-form-wrap::before {
    content: '';
    position: absolute; top: -120px; right: -120px;
    width: 400px; height: 400px; border-radius: 50%;
    border: 1.5px dashed rgba(6,182,212,.2);
    animation: afOrbit 22s linear infinite;
    pointer-events: none;
}
.auth-form-wrap::after {
    content: '';
    position: absolute; bottom: -80px; left: -80px;
    width: 280px; height: 280px; border-radius: 50%;
    border: 1px dashed rgba(240,180,41,.15);
    animation: afOrbit 30s linear infinite reverse;
    pointer-events: none;
}

/* ── Small floating accent dots ── */
.af-dot {
    position: absolute; border-radius: 50%; pointer-events: none;
}
.af-dot.d1 { width:8px; height:8px; background:#06b6d4; top:18%; right:12%; opacity:.5; animation:afFloat 4s ease-in-out infinite; }
.af-dot.d2 { width:5px; height:5px; background:#f6c651; top:32%; right:6%;  opacity:.4; animation:afFloat 5.5s ease-in-out infinite .8s; }
.af-dot.d3 { width:6px; height:6px; background:#67e8f9; bottom:28%; right:18%; opacity:.45; animation:afFloat 3.8s ease-in-out infinite 1.4s; }
.af-dot.d4 { width:4px; height:4px; background:#f0b429; bottom:16%; left:8%;  opacity:.35; animation:afFloat 6s ease-in-out infinite .4s; }
/* ping rings around d1 */
.af-ping {
    position: absolute; top:18%; right:12%;
    width:8px; height:8px; border-radius:50%;
    background: rgba(6,182,212,.35);
    animation: afPing 2.4s ease-out infinite;
    pointer-events: none;
}

/* ── App icon above the card ── */
.auth-icon-wrap {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; margin: 0 auto 18px;
    animation: afFloat 4s ease-in-out infinite;
}
.auth-icon-wrap img {
    width: 60px; height: 60px; border-radius: 18px;
    object-fit: contain; background: #fff; padding: 6px;
    box-shadow: 0 8px 28px rgba(6,182,212,.4), 0 2px 8px rgba(0,0,0,.1);
    position: relative; z-index: 1;
}
.auth-icon-ring {
    position: absolute; inset: -8px; border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #06b6d4; border-right-color: #f6c651;
    animation: spin 4s linear infinite;
}

/* ── Login card ── */
.auth-card {
    width: 100%; max-width: 420px;
    position: relative; z-index: 2;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 40px 36px;
    box-shadow:
        0 0 0 1px rgba(6,182,212,.06),
        0 4px 8px rgba(6,42,51,.04),
        0 16px 48px rgba(6,42,51,.10);
    animation: afSlideIn .55s var(--ease) .1s both;
    transition: background .35s, border-color .35s, box-shadow .35s;
}
:root[data-theme="dark"] .auth-card {
    box-shadow: 0 0 0 1px rgba(6,182,212,.1), 0 8px 48px rgba(0,0,0,.6);
}

/* subtle inner top accent line */
.auth-card::before {
    content: '';
    position: absolute; top: 0; left: 10%; right: 10%; height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, #06b6d4 40%, #67e8f9 60%, transparent);
    opacity: .6;
}

.auth-card .mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-card .mobile-brand img { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); padding: 4px; box-shadow: 0 4px 14px var(--teal-glow); }
.auth-card .mobile-brand b { font-family: var(--font-head); font-size: 20px; color: var(--text); }

/* card heading */
.auth-card-head { text-align: center; margin-bottom: 32px; }
.auth-card-head h2 {
    font-family: var(--font-head); font-size: 28px; font-weight: 800;
    margin: 0 0 8px; color: var(--text);
    letter-spacing: -.02em;
}
.auth-card-head .lead {
    color: var(--text-soft); font-size: 14.5px; margin: 0;
}

/* fields */
.auth-field { margin-bottom: 20px; position: relative; }
.auth-field label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    margin-bottom: 8px; color: var(--text-soft);
}
.auth-field label svg { width: 13px; height: 13px; opacity: .7; }
.auth-field input {
    width: 100%; padding: 14px 16px;
    border: 1.5px solid var(--border); border-radius: 14px;
    font-size: 15px; font-family: var(--font);
    background: var(--surface-2); color: var(--text);
    transition: border .18s, box-shadow .18s, background .2s, color .2s;
}
.auth-field input::placeholder { color: var(--text-faint); }
.auth-field input:focus {
    outline: none; background: var(--surface);
    border-color: var(--teal-400);
    box-shadow: 0 0 0 4px rgba(6,182,212,.14);
}

/* submit button — full-width gradient with animated shine */
.auth-btn {
    width: 100%; padding: 15px; border: 0; border-radius: 14px;
    margin-top: 8px; cursor: pointer;
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
    background-size: 200% 100%;
    color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 15.5px;
    letter-spacing: .03em;
    box-shadow: 0 6px 24px rgba(6,182,212,.45), 0 2px 6px rgba(0,0,0,.1);
    transition: box-shadow .2s, transform .12s, background-position .4s;
    position: relative; overflow: hidden;
}
/* animated shine sweep */
.auth-btn::after {
    content: '';
    position: absolute; top: 0; bottom: 0;
    width: 60px; left: -80%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    border-radius: 999px;
    animation: afShimBtn 2.4s linear infinite;
}
.auth-btn:hover {
    box-shadow: 0 10px 32px rgba(6,182,212,.6), 0 2px 8px rgba(0,0,0,.15);
    transform: translateY(-2px);
    background-position: 100% 0;
}
.auth-btn:active { transform: translateY(0); box-shadow: 0 4px 14px rgba(6,182,212,.35); }
.auth-btn .btn-spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
.auth-btn.loading .btn-spinner { display: inline-block; }
.auth-btn.loading .btn-label { opacity: .8; }
.auth-btn.loading::after { display: none; }

/* public results link below button */
.auth-results-link {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 20px;
    color: var(--text-soft); font-size: 13px; text-decoration: none;
    transition: color .15s;
}
.auth-results-link:hover { color: var(--teal-400); text-decoration: none; }
.auth-results-link svg { width: 14px; height: 14px; }
.auth-results-link span { border-bottom: 1px dashed currentColor; }

/* error alert */
.auth-error {
    background: rgba(224,67,90,.1);
    color: #e0435a;
    border: 1px solid rgba(224,67,90,.28);
    padding: 12px 15px; border-radius: 12px; font-size: 14px;
    margin-bottom: 22px; display: flex; align-items: center; gap: 8px;
    animation: fadeUp .4s var(--ease) both;
}
.auth-error::before { content:'⚠'; font-size: 16px; }

/* ═══════════════════════════════════════
   RESPONSIVE — mobile single-column
═══════════════════════════════════════ */
@media (max-width: 720px) {
    body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; overflow: auto; }
    .auth-hero { padding: 36px 28px 32px; height: auto; }
    .auth-hero .hero-copy h1 { font-size: 28px; }
    .auth-hero .hero-copy p { font-size: 14px; }
    .auth-form-wrap { padding: 24px 16px; height: auto; overflow: visible; }
    .auth-card { padding: 28px 22px; border-radius: 20px; }
    .auth-card .mobile-brand { display: flex; }
    .auth-card::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   LOADER — cinematic splash screen
   ═══════════════════════════════════════════════════════════════ */

/* ── Loader-only keyframes ── */
@keyframes ldBlobDrift  { 0%{transform:translate(0,0) scale(1);} 33%{transform:translate(40px,-30px) scale(1.15);} 66%{transform:translate(-20px,20px) scale(.9);} 100%{transform:translate(0,0) scale(1);} }
@keyframes ldScan       { 0%{transform:translateY(-100%);opacity:0;} 10%{opacity:.6;} 90%{opacity:.6;} 100%{transform:translateY(100vh);opacity:0;} }
@keyframes ldParticle   { 0%{transform:translateY(0) scale(1);opacity:.9;} 100%{transform:translateY(-90px) scale(.3);opacity:0;} }
@keyframes ldHaloPulse  { 0%,100%{transform:scale(1);opacity:.5;} 50%{transform:scale(1.15);opacity:.08;} }
@keyframes ldLogoPop    { 0%{transform:scale(.5);opacity:0;} 65%{transform:scale(1.07);opacity:1;} 100%{transform:scale(1);} }
@keyframes ldFadeUp     { from{opacity:0;transform:translateY(22px);} to{opacity:1;transform:none;} }
@keyframes ldBarGlow    { 0%,100%{box-shadow:0 0 8px rgba(6,182,212,.6),0 0 18px rgba(6,182,212,.3);} 50%{box-shadow:0 0 18px rgba(6,182,212,1),0 0 40px rgba(6,182,212,.6);} }
@keyframes ldShine      { 0%{left:-60%;} 100%{left:120%;} }
@keyframes ldRegPop     { 0%{transform:scale(0) rotate(-30deg);opacity:0;} 70%{transform:scale(1.12) rotate(6deg);opacity:1;} 100%{transform:scale(1) rotate(0deg);} }
@keyframes ldRegWobble  { 0%,100%{transform:scale(1) rotate(-4deg);} 50%{transform:scale(1.06) rotate(3deg);} }
@keyframes ldTitlePulse { 0%,100%{letter-spacing:.06em;opacity:1;} 50%{letter-spacing:.15em;opacity:.88;} }
@keyframes ldStatusBlink{ 0%,100%{opacity:.55;} 50%{opacity:1;} }
@keyframes ldGlowDisc   { 0%,100%{opacity:.55;transform:scale(1);} 50%{opacity:.9;transform:scale(1.08);} }
@keyframes ldTrackFade  { 0%,100%{opacity:.18;} 50%{opacity:.32;} }
@keyframes ldRingFlare  { 0%,100%{filter:drop-shadow(0 0 5px currentColor);} 50%{filter:drop-shadow(0 0 12px currentColor) drop-shadow(0 0 24px currentColor);} }
@keyframes ldCometTail  { 0%,100%{opacity:.7;} 50%{opacity:1;} }

/* ── Root wrapper ── */
.app-loader {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 40%, #0d5f72 0%, #062a33 55%, #020f14 100%);
    transition: opacity .8s ease, visibility .8s;
}
.app-loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }

/* ── Animated background ── */
.ld-bg { position: absolute; inset: 0; pointer-events: none; }

.ld-blob {
    position: absolute; border-radius: 50%;
    filter: blur(60px); mix-blend-mode: screen;
}
.ld-blob.lb1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(6,182,212,.35), transparent 70%);
    top: -160px; left: -120px;
    animation: ldBlobDrift 16s ease-in-out infinite;
}
.ld-blob.lb2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(240,180,41,.28), transparent 70%);
    bottom: -120px; right: -100px;
    animation: ldBlobDrift 20s ease-in-out infinite reverse;
}
.ld-blob.lb3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(103,232,249,.2), transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    animation: ldBlobDrift 12s ease-in-out infinite 4s;
}
.ld-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(103,232,249,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103,232,249,.06) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 68%);
}
.ld-scan {
    position: absolute; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(103,232,249,.7), transparent);
    animation: ldScan 4s linear infinite;
}

/* ── Floating particles ── */
.ld-particles { position: absolute; inset: 0; pointer-events: none; }
.ld-p {
    position: absolute;
    border-radius: 50%;
    animation: ldParticle linear infinite;
}
.ld-p.p1 { width:6px;  height:6px;  background:#67e8f9; left:18%;  bottom:22%; animation-duration:3.2s; animation-delay:0s;    box-shadow:0 0 8px #06b6d4; }
.ld-p.p2 { width:4px;  height:4px;  background:#f6c651; left:34%;  bottom:18%; animation-duration:4.1s; animation-delay:.7s;   box-shadow:0 0 6px #f0b429; }
.ld-p.p3 { width:5px;  height:5px;  background:#fff;    left:55%;  bottom:28%; animation-duration:3.7s; animation-delay:1.2s;  box-shadow:0 0 7px rgba(255,255,255,.8); }
.ld-p.p4 { width:3px;  height:3px;  background:#67e8f9; left:72%;  bottom:20%; animation-duration:2.9s; animation-delay:.3s;   box-shadow:0 0 5px #06b6d4; }
.ld-p.p5 { width:6px;  height:6px;  background:#f6c651; left:82%;  bottom:35%; animation-duration:4.4s; animation-delay:1.8s;  box-shadow:0 0 8px #f0b429; }
.ld-p.p6 { width:4px;  height:4px;  background:#67e8f9; left:10%;  bottom:40%; animation-duration:3.5s; animation-delay:.5s;   box-shadow:0 0 6px #06b6d4; }
.ld-p.p7 { width:5px;  height:5px;  background:#fff;    left:45%;  bottom:15%; animation-duration:5.0s; animation-delay:2.1s;  box-shadow:0 0 7px rgba(255,255,255,.8); }
.ld-p.p8 { width:3px;  height:3px;  background:#f6c651; left:62%;  bottom:42%; animation-duration:3.0s; animation-delay:1.0s;  box-shadow:0 0 5px #f0b429; }

/* ── Main stage ── */
.loader-stage {
    display: flex; flex-direction: column; align-items: center;
    position: relative; z-index: 2;
    animation: ldFadeUp .6s cubic-bezier(.16,1,.3,1) both;
}

/* ── Orbit zone ── */
.loader-orbit {
    position: relative;
    width: 260px; height: 260px;
    display: flex; align-items: center; justify-content: center;
}

/* ── Ghost track circles (static faint ring showing each orbit path) ── */
.ld-track {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(103,232,249,.14);
    animation: ldTrackFade 3s ease-in-out infinite;
}
.ld-track.tk1 { inset: 0; }
.ld-track.tk2 { inset: 22px; animation-delay: .8s; border-color: rgba(240,180,41,.12); }
.ld-track.tk3 { inset: -16px; border: 1px dashed rgba(103,232,249,.1); animation-delay: 1.6s; }

/* ── Pulsing halo rings ── */
.ld-halo {
    position: absolute; border-radius: 50%;
    border: 1.5px solid rgba(6,182,212,.4);
    pointer-events: none;
}
.ld-halo.h1 { inset: -28px; animation: ldHaloPulse 2.8s ease-in-out infinite; }
.ld-halo.h2 { inset: -48px; animation: ldHaloPulse 2.8s ease-in-out infinite .9s; border-color: rgba(103,232,249,.25); }
.ld-halo.h3 { inset: -70px; animation: ldHaloPulse 2.8s ease-in-out infinite 1.8s; border-color: rgba(103,232,249,.12); }

/* ── Spinning arc rings — bright leading edge via conic-gradient ── */
.orbit-ring {
    position: absolute; border-radius: 50%;
}
/* r1: outer teal arc */
.orbit-ring.r1 {
    inset: 0;
    background: conic-gradient(from 0deg, transparent 0%, rgba(6,182,212,.0) 60%, #06b6d4 80%, #67e8f9 90%, #ffffff 95%, transparent 100%);
    mask-image: radial-gradient(circle, transparent 44%, black 46%, black 49%, transparent 51%);
    -webkit-mask-image: radial-gradient(circle, transparent 44%, black 46%, black 49%, transparent 51%);
    filter: drop-shadow(0 0 7px #06b6d4) drop-shadow(0 0 14px rgba(6,182,212,.5));
    animation: spin 1.4s linear infinite, ldRingFlare 2s ease-in-out infinite;
}
/* r2: inner gold arc */
.orbit-ring.r2 {
    inset: 22px;
    background: conic-gradient(from 180deg, transparent 0%, rgba(240,180,41,.0) 55%, #f0b429 78%, #f6c651 88%, #ffffff 93%, transparent 100%);
    mask-image: radial-gradient(circle, transparent 42%, black 44%, black 48%, transparent 50%);
    -webkit-mask-image: radial-gradient(circle, transparent 42%, black 44%, black 48%, transparent 50%);
    filter: drop-shadow(0 0 6px #f0b429) drop-shadow(0 0 12px rgba(240,180,41,.45));
    animation: spinRev 2s linear infinite, ldRingFlare 2.4s ease-in-out infinite .6s;
}
/* r3: outermost slow dashed ring */
.orbit-ring.r3 {
    inset: -16px;
    background: none;
    border: 1.5px dashed rgba(103,232,249,.22);
    animation: spin 9s linear infinite;
}

/* ── Radial glow disc behind logo ── */
.ld-glow-disc {
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6,182,212,.28) 0%, rgba(6,182,212,.1) 45%, transparent 72%);
    animation: ldGlowDisc 2.2s ease-in-out infinite;
    pointer-events: none; z-index: 1;
}

/* ── Orbit arms ── */
.orbit-arm { position: absolute; inset: 0; border-radius: 50%; }
.orbit-arm.a1 { animation: spin    2.2s linear infinite; }
.orbit-arm.a2 { animation: spinRev 3.1s linear infinite; }
.orbit-arm.a3 { animation: spin    4.8s linear infinite; }
.orbit-arm.a4 { animation: spinRev 2.7s linear infinite .5s; }
.orbit-arm.a5 { animation: spin    3.6s linear infinite 1.1s; }

/* ── Comet wrapper — sits at top of arm, has a tail trailing behind ── */
.orbit-comet {
    position: absolute;
    top: 4px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    animation: ldCometTail 1.6s ease-in-out infinite;
}
/* the tail is a pseudo-element below the dot */
.orbit-comet::after {
    content: '';
    display: block;
    width: 2px;
    height: 18px;
    margin-top: 1px;
    border-radius: 0 0 999px 999px;
}
.orbit-comet.teal::after  { background: linear-gradient(to bottom, rgba(103,232,249,.8), transparent); }
.orbit-comet.gold::after  { background: linear-gradient(to bottom, rgba(246,198,81,.8),  transparent); }
.orbit-comet.white::after { background: linear-gradient(to bottom, rgba(255,255,255,.8), transparent); }
.orbit-comet.sm::after    { width: 1.5px; height: 12px; }

/* ── Orbit dots ── */
.orbit-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.orbit-dot.sm { width: 7px; height: 7px; }
.orbit-dot.teal  { background: #67e8f9; box-shadow: 0 0 8px #06b6d4, 0 0 20px rgba(6,182,212,.8),  0 0 36px rgba(6,182,212,.4); }
.orbit-dot.gold  { background: #f6c651; box-shadow: 0 0 8px #f0b429, 0 0 20px rgba(240,180,41,.8), 0 0 36px rgba(240,180,41,.4); }
.orbit-dot.white { background: #ffffff; box-shadow: 0 0 8px rgba(255,255,255,.9), 0 0 20px rgba(255,255,255,.7), 0 0 36px rgba(255,255,255,.4); }

/* ── Logo wrap ── */
.loader-logo-wrap {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
}

/* three staggered pulse rings */
.logo-pulse-ring {
    position: absolute; border-radius: 50%;
    pointer-events: none;
}
.logo-pulse-ring.lp1 { width: 136px; height: 136px; border: 2px solid rgba(6,182,212,.55); animation: ldHaloPulse 2.2s ease-in-out infinite; }
.logo-pulse-ring.lp2 { width: 150px; height: 150px; border: 1.5px solid rgba(6,182,212,.3);  animation: ldHaloPulse 2.2s ease-in-out infinite .7s; }
.logo-pulse-ring.lp3 { width: 166px; height: 166px; border: 1px   solid rgba(6,182,212,.15); animation: ldHaloPulse 2.2s ease-in-out infinite 1.4s; }

/* ── Logo ── */
.loader-logo {
    width: 118px; height: 118px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 10px;
    /* layered glow: tight ring + mid glow + wide ambient */
    box-shadow:
        0 0 0 3px rgba(255,255,255,.9),
        0 0 0 6px rgba(6,182,212,.35),
        0 0 24px rgba(6,182,212,.75),
        0 0 50px rgba(6,182,212,.4),
        0 0 80px rgba(6,182,212,.18);
    animation:
        ldLogoPop   .8s cubic-bezier(.34,1.56,.64,1) .15s both,
        floatY      3.8s ease-in-out 1.2s infinite,
        ldBarGlow   2.4s ease-in-out infinite;   /* reuses glow-pulse shape */
    position: relative; z-index: 3;
}

/* ── Reg portrait ── */
.loader-reg-wrap {
    position: absolute;
    bottom: -6px; right: -6px;
    z-index: 4;
    /* entrance pop */
    animation: ldRegPop .6s cubic-bezier(.34,1.56,.64,1) .6s both;
}
.loader-reg {
    display: block;
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #06b6d4;
    outline: 2px solid rgba(255,255,255,.25);
    box-shadow:
        0 0 0 4px rgba(6,182,212,.3),
        0 0 18px rgba(6,182,212,1),
        0 0 36px rgba(6,182,212,.5);
    animation: ldRegWobble 3.4s ease-in-out 1.2s infinite,
               glowPulse   2s   ease-in-out infinite;
}

/* ── Title ── */
.loader-title {
    margin-top: 28px;
    font-family: var(--font-head); font-weight: 800; font-size: 36px;
    background: linear-gradient(90deg, #ffffff 0%, #67e8f9 35%, #f6c651 65%, #ffffff 100%);
    background-size: 300% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation:
        shimmer       2s   linear    infinite,
        ldTitlePulse  4s   ease-in-out infinite,
        ldFadeUp      .65s cubic-bezier(.16,1,.3,1) .3s both;
    filter: drop-shadow(0 0 12px rgba(103,232,249,.5));
}

/* ── Subtitle ── */
.loader-sub {
    margin-top: 6px;
    color: #67e8f9; font-size: 11.5px;
    letter-spacing: .3em; text-transform: uppercase;
    text-shadow: 0 0 18px rgba(103,232,249,.9), 0 0 36px rgba(103,232,249,.4);
    animation:
        glowPulse  2.6s ease-in-out infinite,
        ldFadeUp   .65s cubic-bezier(.16,1,.3,1) .42s both;
}

/* ── Progress bar ── */
.loader-bar-wrap {
    margin-top: 24px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    animation: ldFadeUp .6s cubic-bezier(.16,1,.3,1) .45s both;
}
.loader-bar-track {
    width: 260px; height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(103,232,249,.2);
    overflow: hidden;
    box-shadow: inset 0 0 8px rgba(0,0,0,.4);
}
.loader-bar-fill {
    position: relative;
    height: 100%; width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #06b6d4 0%, #67e8f9 50%, #f0b429 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite, ldBarGlow 1.8s ease-in-out infinite;
    transition: width .06s linear;
}
/* travelling shine sweep on the bar */
.bar-shine {
    position: absolute; top: 0; bottom: 0;
    width: 50px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
    border-radius: 999px;
    animation: ldShine 1.6s linear infinite;
}
.loader-bar-meta {
    width: 260px;
    display: flex; justify-content: space-between; align-items: center;
}
.loader-status {
    color: rgba(103,232,249,.7); font-size: 11px; letter-spacing: .08em;
    animation: ldStatusBlink 1.4s ease-in-out infinite;
}
.loader-pct {
    color: rgba(255,255,255,.75);
    font-size: 12px; font-weight: 600; letter-spacing: .06em;
    font-family: var(--font-head);
    text-shadow: 0 0 10px rgba(103,232,249,.6);
}

/* Theme toggle (reused) */
.theme-toggle { background: none; border: 0; cursor: pointer; padding: 0; display: inline-flex; z-index: 5; }
.tt-track { width: 58px; height: 30px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; display: inline-flex; align-items: center; }
.tt-thumb { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); display: grid; place-items: center; color: var(--brand-900); transition: left .35s var(--ease), background .35s; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.tt-thumb svg { width: 15px; height: 15px; }
.tt-sun { display: block; } .tt-moon { display: none; }
[data-theme="dark"] .tt-thumb { left: 31px; background: linear-gradient(135deg, var(--teal-400), var(--teal-500)); color: #fff; }
[data-theme="dark"] .tt-sun { display: none; } [data-theme="dark"] .tt-moon { display: block; }

@media (max-width: 860px) {
    body { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-card .mobile-brand { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
    .app-loader { transition: opacity .2s; }
}
