/* Login — cinematic full-screen design */

/* Always visible — login page is always dark, no FOUC risk */
html { visibility: visible; }

:root {
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-xs: .15s; --dur-sm: .30s;
}

html, body { height:100%; margin:0; overflow:hidden; background:#050507; color:#F5F5F7; font-family:var(--font-body,"SF Pro Display","Inter",-apple-system,sans-serif); }

/* ── BACKGROUND LAYERS ── */
.bg { position:fixed; inset:0; pointer-events:none; }
#stage { z-index:0; display:block; width:100%; height:100%; }
.bg-fog {
  z-index:1;
  background:
    radial-gradient(120% 80% at var(--fog-x1,50%) var(--fog-y1,100%), rgba(20,30,55,0.35), transparent 55%),
    radial-gradient(80%  60% at var(--fog-x2,50%) var(--fog-y2,0%),   rgba(40,50,80,0.14),  transparent 60%),
    radial-gradient(60%  50% at var(--fog-x3,30%) var(--fog-y3,50%),  rgba(40,80,140,0.08), transparent 65%);
  will-change:background-position;
}
.bg-vignette {
  z-index:2;
  background:radial-gradient(80% 65% at 50% 50%, transparent 0%, rgba(5,5,7,0.45) 80%, rgba(5,5,7,0.85) 100%);
}
.bg-grain {
  z-index:3; opacity:0.04; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.footer-shelf {
  position:fixed; left:0; right:0; bottom:0; height:110px; z-index:9; pointer-events:none;
  background:linear-gradient(180deg, rgba(5,5,7,0) 0%, rgba(5,5,7,0.18) 40%, rgba(5,5,7,0.55) 100%);
}

/* ── FRAME ── */
.frame {
  position:fixed; inset:0; z-index:10;
  display:grid; grid-template-rows:auto 1fr auto;
  padding:28px clamp(20px,5vw,80px) 24px;
  color:#F5F5F7;
}

/* ── HEADER / FOOTER BARS ── */
header.bar {
  display:flex; align-items:center; justify-content:space-between;
  font-family:var(--font-mono,"SF Mono","JetBrains Mono",monospace);
  font-size:10px; letter-spacing:0.14em; text-transform:uppercase;
  color:rgba(245,245,247,0.55); mix-blend-mode:difference;
}

.lockup { display:flex; align-items:center; gap:10px; color:#fff; }
.lockup svg { display:block; flex-shrink:0; }
.lockup .word {
  font-family:var(--font-display,"SF Pro Display","Inter",sans-serif);
  font-weight:500; font-size:15px; letter-spacing:-0.01em; color:#fff; text-transform:none;
}
.lockup .sub { color:rgba(255,255,255,0.55); font-size:10px; letter-spacing:0.18em; padding-left:2px; position:relative; top:1px; }
.lockup .sub::before { content:"· "; opacity:0.5; padding-right:2px; }

.meta { display:flex; align-items:center; gap:18px; }
.meta .dot {
  width:5px; height:5px; border-radius:50%; background:#66A3FF;
  box-shadow:0 0 10px rgba(0,102,255,0.9); mix-blend-mode:normal;
  animation:pulse 2.4s cubic-bezier(0.4,0,0.2,1) infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
.meta .cell { display:flex; align-items:center; gap:8px; }
.meta .cell .v { color:#fff; font-variant-numeric:tabular-nums; }
.meta .sep { opacity:0.4; }

/* ── HERO ── */
.hero-wrap { display:grid; place-items:center; position:relative; pointer-events:none; }
.hero {
  text-align:center; max-width:1100px; padding:0 40px;
  color:#ffffff; mix-blend-mode:difference; isolation:isolate;
  animation:rise 1.6s cubic-bezier(0.16,1,0.3,1) both; animation-delay:.35s;
}
.hero .kicker {
  font-family:var(--font-mono,"SF Mono","JetBrains Mono",monospace);
  font-size:10px; letter-spacing:0.32em; text-transform:uppercase;
  color:#fff; opacity:0.65; margin-bottom:22px;
  display:inline-flex; align-items:center; gap:14px;
}
.hero .kicker .rule { width:32px; height:1px; background:linear-gradient(90deg, transparent, #fff); opacity:0.7; }
.hero .kicker .rule.r2 { background:linear-gradient(90deg, #fff, transparent); }
.hero h1 {
  font-family:var(--font-display,"SF Pro Display","Inter",sans-serif);
  font-weight:200; font-size:clamp(60px,9vw,148px);
  letter-spacing:-0.045em; line-height:0.92; margin:0; color:#fff;
}
.hero h1 em { font-style:normal; font-weight:500; }
.hero h1 .period { font-weight:500; }
.hero .lede {
  font-family:var(--font-display,"SF Pro Display","Inter",sans-serif);
  font-weight:300; font-size:clamp(14px,1.05vw,17px);
  line-height:1.5; color:#fff; opacity:0.78; margin:26px auto 0; max-width:540px;
}

/* ── FOOTER FORM BAR ── */
footer.bar {
  position:relative; padding:16px 18px; margin:0 -22px -6px; border-radius:14px;
  border:1px solid rgba(255,255,255,0.10); color:rgba(245,245,247,0.72);
  background:linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.04) 100%), rgba(10,12,18,0.28);
  backdrop-filter:blur(22px) saturate(160%); -webkit-backdrop-filter:blur(22px) saturate(160%);
  box-shadow:0 -1px 0 0 rgba(255,255,255,0.08) inset, 0 1px 0 0 rgba(255,255,255,0.04) inset, 0 24px 60px -20px rgba(0,0,0,0.6);
  isolation:isolate; overflow:hidden; mix-blend-mode:normal;
}
footer.bar::before {
  content:""; position:absolute; left:0; right:0; top:0; height:1px;
  background:linear-gradient(90deg, transparent, rgba(0,102,255,0.55), transparent);
  opacity:0.7; pointer-events:none;
}
footer.bar::after {
  content:""; position:absolute; inset:-50% -25%;
  background:radial-gradient(40% 80% at 20% 50%, rgba(120,170,255,0.10), transparent 60%), radial-gradient(35% 90% at 75% 50%, rgba(180,210,255,0.08), transparent 65%);
  mix-blend-mode:screen; pointer-events:none; z-index:0;
  animation:glassDrift 18s linear infinite;
}
@keyframes glassDrift {
  0%  { transform:translate3d(-6%,0,0) rotate(0deg); }
  50% { transform:translate3d(6%,0,0) rotate(0.4deg); }
  100%{ transform:translate3d(-6%,0,0) rotate(0deg); }
}
footer.bar > form { position:relative; z-index:1; }

.footer-reflect {
  position:absolute; left:0; right:0; top:0; height:100%;
  z-index:0; overflow:hidden; border-radius:14px; pointer-events:none; opacity:0.45;
}
.footer-reflect canvas {
  position:absolute; left:0; right:0; bottom:0; width:100%; height:320%;
  transform:scaleY(-1) translateY(0); transform-origin:bottom center;
  filter:blur(8px) saturate(140%) brightness(0.9); mix-blend-mode:screen; opacity:0.55;
}
.footer-reflect::after {
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(10,12,18,0) 0%, rgba(10,12,18,0.35) 60%, rgba(10,12,18,0.55) 100%);
}

/* ── CREDENTIAL FORM ── */
.creds { display:flex; align-items:center; gap:10px; flex:1; flex-wrap:wrap; }
.creds .input { flex:0 1 280px; position:relative; }
.creds .input input {
  all:unset; box-sizing:border-box; width:100%; padding:10px 14px;
  background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.10);
  border-radius:7px; color:#fff;
  font-family:var(--font-body,"SF Pro Display","Inter",sans-serif);
  font-size:13px; letter-spacing:-0.005em;
  transition:border-color .15s, background .15s, box-shadow .15s;
}
.creds .input input::placeholder {
  color:rgba(255,255,255,0.35);
  font-family:var(--font-mono,"SF Mono","JetBrains Mono",monospace);
  font-size:10.5px; letter-spacing:0.16em; text-transform:uppercase;
}
.creds .input input:focus {
  border-color:rgba(0,102,255,0.7); background:rgba(0,102,255,0.08);
  box-shadow:0 0 0 3px rgba(0,102,255,0.18); outline:none;
}
.creds .input .reveal {
  all:unset; cursor:pointer; position:absolute; right:8px; top:50%; transform:translateY(-50%);
  font-family:var(--font-mono,"SF Mono","JetBrains Mono",monospace);
  font-size:9px; letter-spacing:0.16em; text-transform:uppercase;
  color:rgba(255,255,255,0.45); padding:4px 6px; border-radius:4px;
}
.creds .input .reveal:hover { color:#66A3FF; }

.creds .submit {
  all:unset; cursor:pointer; display:inline-flex; align-items:center; gap:12px;
  padding:10px 18px; background:#0066FF; color:#fff; border-radius:7px;
  font-family:var(--font-display,"SF Pro Display","Inter",sans-serif);
  font-weight:500; font-size:13px; letter-spacing:-0.005em;
  transition:background .15s, transform .15s;
  position:relative; overflow:hidden; white-space:nowrap;
}
.creds .submit:hover { background:#1A75FF; }
.creds .submit:active { transform:translateY(1px); }
.creds .submit .arr { font-family:var(--font-mono,"SF Mono",monospace); font-size:12px; transition:transform .3s; }
.creds .submit:hover .arr { transform:translateX(4px); }
.creds .submit::after {
  content:""; position:absolute; top:0; left:-40%; width:30%; height:100%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform:skewX(-18deg); animation:btnSheen 4.2s ease infinite; animation-delay:1.5s;
}
@keyframes btnSheen { 0%{left:-40%} 60%{left:110%} 100%{left:110%} }


.form-error {
  width:100%; padding:8px 12px; border-radius:6px; margin-bottom:4px;
  background:rgba(224,85,85,0.12); border:1px solid rgba(224,85,85,0.35);
  color:#E05555; font-family:var(--font-mono,"SF Mono",monospace);
  font-size:10px; letter-spacing:0.08em; text-transform:uppercase;
}

@media (max-width:880px) {
  .creds { gap:8px; }
  .creds .input { flex:1 1 100%; }
  .creds .submit { width:100%; justify-content:center; }
}

/* ── ANIMATIONS ── */
@keyframes rise {
  from { opacity:0; transform:translateY(14px); filter:blur(8px); }
  to   { opacity:1; transform:none; filter:none; }
}
.r1 { animation:rise .9s cubic-bezier(0.16,1,0.3,1) both; animation-delay:.05s; }

@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
}

/* ── LIGHT THEME OVERRIDES ──────────────────────────────────────────────── */
html[data-theme="light"] footer.bar {
  background:rgba(255,255,255,0.92);
  border-color:rgba(0,0,0,0.12);
  color:var(--ts-ink-2);
  box-shadow:0 24px 60px -20px rgba(0,0,0,0.12);
}
html[data-theme="light"] .creds .input input {
  background:#fff;
  border-color:rgba(0,0,0,0.14);
  color:var(--ts-ink);
}
html[data-theme="light"] .creds .input input::placeholder {
  color:var(--ts-ink-3);
}
