/* ============================================================== *
 *  KEYSTONE — login screen + holographic grand entrance
 * ============================================================== */
body.login { overflow: hidden; }

/* ---- Background video ----------------------------------------- */
.bg-video {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; background: #0c121b;
  /* dark circuit footage -> lift brightness/saturation so the traces read */
  filter: blur(4px) saturate(1.45) brightness(1.15) contrast(1.05);
  transform: scale(1.06); /* hide blur edges */
}
.bg-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(1100px 720px at 50% 40%, rgba(12,18,27,.04), rgba(12,18,27,.46) 82%),
    linear-gradient(180deg, rgba(12,18,27,.18), rgba(12,18,27,.40));
}

/* ---- Login container ------------------------------------------ */
.login-stage {
  position: relative; z-index: 2;
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(412px, 100%);
  background: linear-gradient(180deg, rgba(16,22,32,.86), rgba(11,15,23,.92));
  border: 1px solid rgba(28,196,216,.22);
  border-radius: 20px;
  padding: 34px 32px 26px;
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05);
  animation: cardIn .7s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.lc-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.lc-brand img { width: 46px; height: 46px; filter: drop-shadow(0 0 14px rgba(28,196,216,.5)); }
.lc-brand .wordmark { font-size: 26px; font-weight: 700; letter-spacing: .08em; line-height: 1; margin-top: 3px; }
.lc-brand .wordmark span { color: var(--teal); }
.lc-tag { color: var(--muted); font-size: 13px; margin: 0 0 24px; }

.lc-error { color: var(--red); font-size: 12.5px; min-height: 0; height: 0; overflow: hidden;
  opacity: 0; transition: .25s; margin-top: -4px; }
.lc-error.show { height: auto; min-height: 18px; opacity: 1; margin-bottom: 12px; }

.lc-submit { width: 100%; margin-top: 6px; position: relative; }
.lc-submit .spinner { display: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(3,22,28,.35); border-top-color: #03161c; animation: spin .7s linear infinite; }
body.authing .lc-submit .spinner { display: inline-block; }
body.authing .lc-submit .label { opacity: .65; }
@keyframes spin { to { transform: rotate(360deg); } }

.lc-hint { text-align: center; color: var(--dim); font-size: 11px; margin: 18px 0 0; letter-spacing: .05em; }

/* container falls away after successful auth */
body.authing .login-card {
  animation: cardFall .65s cubic-bezier(.6,.04,.78,.05) forwards;
}
@keyframes cardFall {
  to { opacity: 0; transform: translateY(40px) scale(.9); filter: blur(8px); }
}

/* ============================================================== *
 *  Holographic entrance
 * ============================================================== */
.holo-stage {
  position: fixed; inset: 0; z-index: 5; display: grid; place-content: center;
  justify-items: center; gap: 22px; pointer-events: none;
  opacity: 0; visibility: hidden;
}
body.entering .holo-stage { visibility: visible; animation: holoStageIn .9s ease both; }
body.entering.leaving .holo-stage { animation: holoStageOut .7s ease forwards; }
@keyframes holoStageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes holoStageOut { to { opacity: 0; filter: blur(6px); transform: scale(1.05); } }

.holo-logo { position: relative; width: 168px; height: 168px; }
body.entering .holo-logo { animation: holoPop 1s cubic-bezier(.16,1.1,.3,1) both, holoFloat 4s ease-in-out 1s infinite; }
@keyframes holoPop {
  0%   { opacity: 0; transform: scale(.55) rotate(-8deg); filter: blur(6px); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}
@keyframes holoFloat { 50% { transform: translateY(-7px); } }

/* the white, glowing emblem */
.holo-svg { width: 100%; height: 100%; position: relative; z-index: 2;
  filter: drop-shadow(0 0 16px rgba(180,255,255,.85))
          drop-shadow(0 0 40px rgba(28,196,216,.7))
          drop-shadow(0 0 80px rgba(63,224,194,.4)); }
.holo-svg .hp { fill: #f4ffff; }
.holo-svg .hp.shell { fill: rgba(220,252,255,.92); }
.holo-svg .hp.node  { fill: #ffffff; }
.holo-svg .hp.core  { fill: #eafbff; }
body.entering .holo-svg { animation: holoFlicker 2.6s steps(1) .2s 1 both, holoHue 3s linear infinite; }
@keyframes holoFlicker {
  0%, 6%, 10%, 16% { opacity: .15; }
  3%, 8%, 13%, 18%, 100% { opacity: 1; }
}
@keyframes holoHue { to { filter:
  drop-shadow(0 0 16px rgba(180,255,255,.85))
  drop-shadow(0 0 40px rgba(63,224,194,.7))
  drop-shadow(0 0 80px rgba(28,196,216,.4)); } }

/* chromatic-aberration ghosts */
.holo-logo::before, .holo-logo::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: center/contain no-repeat url("/static/img/logo.svg");
  mix-blend-mode: screen; opacity: .0;
}
body.entering .holo-logo::before { animation: ghostA 3s ease-in-out .6s infinite; filter: blur(1px) hue-rotate(40deg); }
body.entering .holo-logo::after  { animation: ghostB 3s ease-in-out .6s infinite; filter: blur(1px) hue-rotate(-50deg); }
@keyframes ghostA { 0%,100% { transform: translateX(-2px); opacity:.0; } 50% { transform: translateX(-4px); opacity:.35; } }
@keyframes ghostB { 0%,100% { transform: translateX(2px); opacity:.0; } 50% { transform: translateX(4px); opacity:.3; } }

/* holographic sheen sweep + scanlines */
.holo-scan { position: absolute; inset: -8%; z-index: 3; pointer-events: none; border-radius: 24px; overflow: hidden; }
.holo-scan::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(180,255,255,.10) 2px 3px);
  mix-blend-mode: overlay; opacity: .6;
}
.holo-scan::after {
  content: ""; position: absolute; left: -60%; top: -20%; width: 60%; height: 140%;
  background: linear-gradient(105deg, transparent, rgba(220,255,255,.55), transparent);
  transform: skewX(-18deg); mix-blend-mode: screen;
}
body.entering .holo-scan::after { animation: sheen 2.2s ease-in-out .5s infinite; }
@keyframes sheen { 0% { left: -60%; } 55%, 100% { left: 130%; } }

/* wordmark + sub */
.holo-word {
  font-family: var(--head); font-weight: 700; font-size: 30px; letter-spacing: .42em;
  color: #eafdff; text-indent: .42em; opacity: 0;
  text-shadow: 0 0 18px rgba(28,196,216,.8), 0 0 44px rgba(63,224,194,.5);
}
body.entering .holo-word { animation: wordIn .8s ease .55s both, holoFlicker 2.6s steps(1) .55s 1 both; }
@keyframes wordIn { from { opacity: 0; letter-spacing: .9em; filter: blur(5px); } to { opacity: 1; } }

.holo-sub { font-size: 11px; letter-spacing: .5em; color: var(--teal-2); text-indent: .5em; opacity: 0; }
body.entering .holo-sub { animation: subIn .6s ease 1.1s both; }
@keyframes subIn { from { opacity: 0; transform: translateY(6px); } to { opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; }
}
