/* ZC Loader Gate — shared styles.
   Self-hosted only: no external fonts, no CDN, no layout shift. */

:root {
  --bg: #07050c;
  --panel: rgba(20, 14, 32, 0.74);
  --line: rgba(196, 160, 255, 0.11);
  --text: #f0eaf8;
  --muted: #8f83a6;
  --dim: #675c7d;
  --violet: #7c3aed;
  --magenta: #bf40bf;
  --accent: #7c3aed;
  --green: #22c55e;
  --red: #f43f5e;
  --amber: #f59e0b;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --grad: linear-gradient(115deg, var(--violet), var(--magenta));
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* An author `display` rule outranks the UA's [hidden] { display: none }, so
   without this, hiding a <main> (the admin login panel) silently does nothing. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- background: drifting aurora + diagonal hatch + grain ---------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(820px 640px at 80% 12%, rgba(191, 64, 191, 0.20), transparent 62%),
    radial-gradient(720px 600px at 14% 82%, rgba(124, 58, 237, 0.24), transparent 60%),
    radial-gradient(1200px 820px at 50% 118%, rgba(88, 28, 135, 0.30), transparent 72%),
    var(--bg);
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    58deg,
    rgba(196, 160, 255, 0.045) 0px,
    rgba(196, 160, 255, 0.045) 1px,
    transparent 1px,
    transparent 13px
  );
  mask-image: radial-gradient(1000px 780px at 50% 40%, #000 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(1000px 780px at 50% 40%, #000 15%, transparent 78%);
}
.bg::after {
  content: "";
  position: absolute;
  top: -30%;
  left: -20%;
  width: 90vmax;
  height: 90vmax;
  border-radius: 45%;
  background: conic-gradient(from 0deg, rgba(124, 58, 237, 0.22), rgba(191, 64, 191, 0.16), rgba(56, 24, 96, 0.20), rgba(124, 58, 237, 0.22));
  filter: blur(90px);
  opacity: 0.55;
  animation: drift 38s linear infinite;
}
@keyframes drift {
  0% { transform: rotate(0deg) translate3d(0, 0, 0); }
  50% { transform: rotate(180deg) translate3d(4%, 3%, 0); }
  100% { transform: rotate(360deg) translate3d(0, 0, 0); }
}
/* fine grain, keeps the big gradients from banding */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

/* --- top bar ------------------------------------------------------------- */
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
}
.lang { position: relative; }
.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 18, 40, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
  padding: 9px 14px;
  cursor: pointer;
}
.lang__btn:hover { border-color: rgba(191, 64, 191, 0.5); }
.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 154px;
  background: #140d20;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  display: none;
  z-index: 40;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.7);
}
.lang.open .lang__menu { display: block; }
.lang__menu button {
  display: flex;
  width: 100%;
  gap: 9px;
  align-items: center;
  background: none;
  border: 0;
  color: var(--text);
  font: 500 13px/1 var(--sans);
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.lang__menu button:hover { background: rgba(191, 64, 191, 0.14); }

/* --- layout -------------------------------------------------------------- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 40px;
}

.brand {
  font: 800 52px/1 var(--sans);
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0;
  color: #ffffff;
}
.brand em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(191, 64, 191, 0.5));
}

.sub {
  text-align: center;
  color: var(--dim);
  font: 400 12px/1 var(--sans);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin: 13px 0 0;
}

/* --- panel: gradient hairline on top, accent rail down the left ---------- */
.panel {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 38px 28px;
  box-shadow: 0 44px 100px -46px rgba(124, 58, 237, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(191, 64, 191, 0.85), rgba(124, 58, 237, 0.85), transparent);
}
.panel::after {
  content: "";
  position: absolute;
  inset: 22px auto 22px 0;
  width: 2px;
  border-radius: 2px;
  background: var(--grad);
  opacity: 0.55;
}

.pill {
  display: block;
  width: fit-content;
  margin: 0 auto 24px;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(191, 64, 191, 0.36);
  color: #dcc4ff;
  border-radius: 8px;
  padding: 7px 15px;
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--magenta);
  margin-right: 9px;
  vertical-align: 1px;
  box-shadow: 0 0 10px var(--magenta);
}

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 10px;
}
.label {
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.status {
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9a6ff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.22; } }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  background: rgba(9, 6, 15, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: 500 15px/1.4 var(--mono);
  letter-spacing: 0.06em;
  padding: 16px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea { font-size: 13px; letter-spacing: 0.02em; resize: vertical; }
input::placeholder, textarea::placeholder { color: #453856; letter-spacing: 0.08em; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(191, 64, 191, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
input.bad, .shake { animation: shake 0.4s; }
input.bad { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.captcha { display: flex; justify-content: center; margin: 20px 0 4px; min-height: 4px; }

/* --- button: gradient face, progress as a hairline underline ------------- */
.btn {
  position: relative;
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 13px;
  background: var(--grad);
  color: #ffffff;
  font: 700 12.5px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 20px 18px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 34px -14px rgba(191, 64, 191, 0.8);
  transition: filter 0.16s ease, transform 0.1s ease, box-shadow 0.16s ease;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 18px 40px -14px rgba(191, 64, 191, 0.95); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: 0.8; }
.btn__label { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; }
.btn__fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.6);
  z-index: 3;
  transition: width 0.12s linear;
}
.btn.busy { background: linear-gradient(115deg, #4c1d95, #6b21a8); box-shadow: none; }
.btn.done { background: linear-gradient(115deg, #15803d, #22c55e); box-shadow: 0 14px 34px -16px rgba(34, 197, 94, 0.8); }
.btn.fail { background: linear-gradient(115deg, #9f1239, #f43f5e); box-shadow: none; }
.btn.fail .btn__fill { width: 0 !important; }

/* --- verification: progress ring + step readout -------------------------- */
.verify {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 6, 15, 0.55);
  padding: 0 18px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.38s ease, opacity 0.26s ease, padding 0.38s ease;
}
.verify.show { max-height: 320px; opacity: 1; padding: 18px; }

.verify__inner { display: flex; align-items: center; gap: 20px; }

.ring { position: relative; flex: none; width: 108px; height: 108px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring__track { fill: none; stroke: rgba(196, 160, 255, 0.1); stroke-width: 7; }
.ring__bar {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 289.03;
  stroke-dashoffset: 289.03;
  transition: stroke-dashoffset 0.14s linear;
  filter: drop-shadow(0 0 6px rgba(191, 64, 191, 0.7));
}
.ring__pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 25px/1 var(--mono);
  color: #e8d9ff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.verify.ok .ring__bar { stroke: var(--green); filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.7)); }
.verify.ok .ring__pct { color: #a7f3c4; }
.verify.err .ring__bar { stroke: var(--red); filter: none; }
.verify.err .ring__pct { color: #ffb0be; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; min-width: 0; }
.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 11.5px/1.3 var(--mono);
  letter-spacing: 0.03em;
  color: #4b415e;
  transition: color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.steps li .dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid currentColor;
  flex: none;
  position: relative;
  transform: rotate(45deg);
}
.steps li.run { color: #c9a6ff; }
.steps li.run .dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 1px;
  background: currentColor;
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.6); } }
.steps li.ok { color: #b9c7bd; }
.steps li.ok .dot { border-color: var(--green); background: var(--green); box-shadow: 0 0 10px rgba(34, 197, 94, 0.5); }
.steps li.bad { color: #ffb0be; }
.steps li.bad .dot { border-color: var(--red); background: var(--red); }

/* --- footer bits --------------------------------------------------------- */
.meta {
  text-align: center;
  margin-top: 18px;
  font: 700 10.5px/1.7 var(--mono);
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
}
.msg {
  text-align: center;
  margin-top: 8px;
  font: 700 10.5px/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 18px;
}
.msg.err { color: #ff9db0; }
.msg.ok { color: #86efac; }

.divider {
  height: 1px;
  margin: 24px 0 18px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.help:hover {
  color: #dcc4ff;
  border-color: rgba(191, 64, 191, 0.45);
  background: rgba(124, 58, 237, 0.1);
}
.help svg { flex: none; }

.fallback { display: none; text-align: center; margin-top: 12px; }
.fallback.show { display: block; }
.fallback a { color: #c9a6ff; font: 600 12px/1 var(--mono); letter-spacing: 0.08em; }

.fade-up { animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .panel { padding: 28px 20px 24px; border-radius: 16px; }
  .brand { font-size: 42px; }
  main { padding: 10px 14px 40px; }
  .verify__inner { flex-direction: column; gap: 14px; }
  .steps { width: 100%; }
  /* iOS zooms the whole page when a focused input is under 16px. */
  input[type="text"], input[type="password"], input[type="number"], select, textarea { font-size: 16px; }
  input[type="text"] { letter-spacing: 0.02em; }
}
/* ==========================================================================
   Gate-only effects. Everything below is scoped to .panel--gate or to
   elements that exist solely on index.html, so /admin stays plain.
   ========================================================================== */

/* Animatable custom property for the rotating panel edge. Browsers without
   @property just skip the animation and keep a static gradient — no breakage. */
@property --edge-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* --- synthwave floor, receding to the horizon --------------------------- */
.grid-floor {
  position: fixed;
  inset: auto 0 0 0;
  height: 44vh;
  z-index: -2;
  pointer-events: none;
  perspective: 300px;
  perspective-origin: 50% 0%;
  opacity: 0.6;
  mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 85%);
}
.grid-floor::before {
  content: "";
  position: absolute;
  inset: -40% -60% -20%;
  background-image:
    linear-gradient(rgba(191, 64, 191, 0.36) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.26) 1px, transparent 1px);
  background-size: 70px 70px;
  transform: rotateX(74deg);
  transform-origin: 50% 0%;
  animation: floor 6s linear infinite;
}
@keyframes floor { to { background-position: 0 70px, 0 0; } }

/* --- embers drifting up ------------------------------------------------- */
.embers {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.embers i {
  position: absolute;
  bottom: -20px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #d8b4fe;
  box-shadow: 0 0 8px 1px rgba(191, 64, 191, 0.85);
  opacity: 0;
  animation: rise 15s linear infinite;
}
.embers i:nth-child(1)  { left: 6%;  animation-duration: 17s; animation-delay: -1s;  }
.embers i:nth-child(2)  { left: 15%; animation-duration: 13s; animation-delay: -6s;  }
.embers i:nth-child(3)  { left: 24%; animation-duration: 20s; animation-delay: -11s; }
.embers i:nth-child(4)  { left: 33%; animation-duration: 15s; animation-delay: -3s;  }
.embers i:nth-child(5)  { left: 41%; animation-duration: 18s; animation-delay: -14s; }
.embers i:nth-child(6)  { left: 52%; animation-duration: 12s; animation-delay: -8s;  }
.embers i:nth-child(7)  { left: 61%; animation-duration: 19s; animation-delay: -2s;  }
.embers i:nth-child(8)  { left: 70%; animation-duration: 14s; animation-delay: -16s; }
.embers i:nth-child(9)  { left: 78%; animation-duration: 21s; animation-delay: -5s;  }
.embers i:nth-child(10) { left: 86%; animation-duration: 16s; animation-delay: -10s; }
.embers i:nth-child(11) { left: 93%; animation-duration: 13s; animation-delay: -13s; }
.embers i:nth-child(12) { left: 47%; animation-duration: 22s; animation-delay: -18s; }
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.85; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(-102vh) translateX(28px); opacity: 0; }
}

/* --- panel: rotating gradient edge, HUD corners, scan sweep -------------- */
.panel--gate { isolation: isolate; }

.panel__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  z-index: 3;
  background: conic-gradient(
    from var(--edge-angle),
    transparent 0deg 200deg,
    rgba(124, 58, 237, 0.9) 270deg,
    rgba(233, 168, 255, 1) 310deg,
    rgba(191, 64, 191, 0.9) 340deg,
    transparent 360deg
  );
  /* Show the padding box only — leaves a 1px travelling highlight on the rim. */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: edge-spin 5.5s linear infinite;
}
@keyframes edge-spin { to { --edge-angle: 360deg; } }

.panel--gate .corner {
  position: absolute;
  width: 15px;
  height: 15px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.75;
  animation: corner-glow 4s ease-in-out infinite;
}
.corner--tl { top: 12px; left: 12px;  border-top: 1px solid var(--magenta); border-left: 1px solid var(--magenta); }
.corner--tr { top: 12px; right: 12px; border-top: 1px solid var(--violet);  border-right: 1px solid var(--violet); }
.corner--bl { bottom: 12px; left: 12px;  border-bottom: 1px solid var(--violet);  border-left: 1px solid var(--violet); }
.corner--br { bottom: 12px; right: 12px; border-bottom: 1px solid var(--magenta); border-right: 1px solid var(--magenta); }
@keyframes corner-glow { 0%, 100% { opacity: 0.28; } 50% { opacity: 0.9; } }

.panel--gate .scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 150px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(196, 160, 255, 0.05) 42%,
    rgba(233, 200, 255, 0.13) 50%,
    rgba(196, 160, 255, 0.05) 58%,
    transparent
  );
  animation: scan 7s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}
@keyframes scan {
  0%        { transform: translateY(-160px); opacity: 0; }
  8%        { opacity: 1; }
  55%       { opacity: 1; }
  70%, 100% { transform: translateY(720px); opacity: 0; }
}

/* the left accent rail breathes instead of sitting flat */
.panel--gate::after { animation: rail 3.6s ease-in-out infinite; }
@keyframes rail {
  0%, 100% { opacity: 0.35; box-shadow: 0 0 10px rgba(191, 64, 191, 0.3); }
  50%      { opacity: 0.95; box-shadow: 0 0 20px rgba(191, 64, 191, 0.75); }
}

/* --- wordmark: light sweeping across the letters ------------------------ */
.panel--gate .brand {
  background: linear-gradient(100deg, #ffffff 30%, #f3e8ff 45%, #ffffff 60%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sweep 6s linear infinite;
}
@keyframes sweep { 0% { background-position: 140% 0; } 100% { background-position: -60% 0; } }

.panel--gate .brand em {
  animation: brand-pulse 3.4s ease-in-out infinite;
}
@keyframes brand-pulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(191, 64, 191, 0.45)); }
  50%      { filter: drop-shadow(0 0 32px rgba(191, 64, 191, 0.9)); }
}

/* --- staggered entrance -------------------------------------------------- */
.panel--gate .pill,
.panel--gate .brand,
.panel--gate .sub,
.panel--gate form,
.panel--gate .meta,
.panel--gate .msg,
.panel--gate .divider,
.panel--gate .help {
  animation: enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.panel--gate .pill    { animation-delay: 0.05s; }
.panel--gate .brand   { animation-delay: 0.11s, 0s; }
.panel--gate .sub     { animation-delay: 0.17s; }
.panel--gate form     { animation-delay: 0.23s; }
.panel--gate .meta    { animation-delay: 0.29s; }
.panel--gate .msg     { animation-delay: 0.33s; }
.panel--gate .divider { animation-delay: 0.37s; }
.panel--gate .help    { animation-delay: 0.41s; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* the wordmark runs two animations at once; re-declare so both survive */
.panel--gate .brand { animation-name: enter, sweep; animation-duration: 0.6s, 6s; animation-iteration-count: 1, infinite; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1), linear; animation-fill-mode: both, none; }

/* --- pill: shine passing over it ---------------------------------------- */
.panel--gate .pill { position: relative; overflow: hidden; }
.panel--gate .pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* --- key field: focus ring + tracking guides ---------------------------- */
.panel--gate #key {
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, letter-spacing 0.2s ease;
}
.panel--gate #key:focus {
  background: rgba(14, 9, 22, 0.95);
  border-color: rgba(216, 180, 254, 0.8);
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.22),
    0 0 26px -4px rgba(191, 64, 191, 0.55),
    inset 0 0 22px -12px rgba(191, 64, 191, 0.9);
  letter-spacing: 0.09em;
}
.panel--gate #key:not(:placeholder-shown) { border-color: rgba(191, 64, 191, 0.4); }

/* --- button: light sweep on idle, brighter on hover --------------------- */
.panel--gate .btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg) translateX(-260%);
  animation: btn-sweep 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes btn-sweep { 0%, 60% { transform: skewX(-18deg) translateX(-260%); } 90%, 100% { transform: skewX(-18deg) translateX(360%); } }
.panel--gate .btn:hover:not(:disabled) { transform: translateY(-1px); }
.panel--gate .btn.busy::after,
.panel--gate .btn.done::after,
.panel--gate .btn.fail::after { animation: none; opacity: 0; }

/* --- ring: dashed orbit + inner glow ------------------------------------ */
.panel--gate .ring::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(196, 160, 255, 0.28);
  animation: orbit 16s linear infinite;
}
.panel--gate .ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  box-shadow: inset 0 0 34px -8px rgba(191, 64, 191, 0.5);
  pointer-events: none;
}
@keyframes orbit { to { transform: rotate(360deg); } }
.panel--gate .verify.ok .ring::before { border-color: rgba(34, 197, 94, 0.4); }
.panel--gate .verify.err .ring::before { border-color: rgba(244, 63, 94, 0.4); animation: none; }

/* the running step gets a travelling underline */
.panel--gate .steps li.run { position: relative; }
.panel--gate .steps li.run::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 166, 255, 0.7), transparent);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  animation: trace 1.4s ease-in-out infinite;
}
@keyframes trace { 0% { background-position: -60% 0; } 100% { background-position: 160% 0; } }

/* --- help link: fills from the left on hover ---------------------------- */
.panel--gate .help { position: relative; overflow: hidden; }
.panel--gate .help::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.28), rgba(191, 64, 191, 0.18));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel--gate .help:hover::before { transform: scaleX(1); }
.panel--gate .help > * { position: relative; z-index: 1; }

@media (max-width: 560px) {
  .grid-floor { height: 32vh; opacity: 0.4; }
  .embers i:nth-child(n + 7) { display: none; }
  .panel--gate .corner { width: 11px; height: 11px; }
}

/* ==========================================================================
   Depth + reactivity. The panel sits on a perspective stage so it can tilt
   toward the cursor, and a few layers behind it react to the same pointer.
   ========================================================================== */

.stage {
  width: 100%;
  max-width: 500px;
  perspective: 1400px;
}
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
/* While the pointer is on the panel, follow it closely instead of gliding. */
.tilt.live { transition: transform 0.12s ease-out; }
.stage .panel { max-width: none; }

/* --- twinkling starfield, far behind everything ------------------------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(233, 213, 255, 0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 12%, rgba(216, 180, 254, 0.75), transparent 60%),
    radial-gradient(1.6px 1.6px at 33% 62%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 71%, rgba(233, 213, 255, 0.7), transparent 60%),
    radial-gradient(1.1px 1.1px at 58% 33%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 6%  77%, rgba(216, 180, 254, 0.65), transparent 60%),
    radial-gradient(1.2px 1.2px at 45% 88%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.3px 1.3px at 68% 52%, rgba(233, 213, 255, 0.6), transparent 60%);
  animation: twinkle 5.5s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.75; } 50% { opacity: 0.3; } }

/* --- violet light that trails the cursor -------------------------------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.24), rgba(191, 64, 191, 0.09) 42%, transparent 68%);
  filter: blur(22px);
  transition: opacity 0.5s ease;
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

/* --- specular sheen that slides across the panel face -------------------- */
.panel--gate .glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    420px circle at var(--gx, 50%) var(--gy, 0%),
    rgba(233, 213, 255, 0.14),
    transparent 62%
  );
}
.panel--gate:hover .glare { opacity: 1; }

/* ==========================================================================
   Key entry: block indicator + scan line while verifying
   ========================================================================== */

.keywrap { position: relative; }
.keywrap__sweep {
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.keywrap__sweep::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(216, 180, 254, 0.22), transparent);
  transform: translateX(-120%);
}
/* Only runs while the server is being asked — makes the wait feel like work. */
body.checking .keywrap__sweep { opacity: 1; }
body.checking .keywrap__sweep::after { animation: key-scan 1.1s linear infinite; }
@keyframes key-scan { to { transform: translateX(360%); } }

.segs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 9px 2px 0;
}
.segs span {
  height: 2px;
  border-radius: 2px;
  background: rgba(196, 160, 255, 0.14);
  position: relative;
  overflow: hidden;
  transition: background 0.25s ease;
}
.segs span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.segs span.on::after { transform: scaleX(1); }
.segs.full span::after { box-shadow: 0 0 12px rgba(191, 64, 191, 0.85); }
.segs.full span { animation: seg-flash 0.5s ease; }
.segs.full span:nth-child(2) { animation-delay: 0.05s; }
.segs.full span:nth-child(3) { animation-delay: 0.1s; }
.segs.full span:nth-child(4) { animation-delay: 0.15s; }
@keyframes seg-flash {
  50% { transform: scaleY(2.4); background: rgba(233, 213, 255, 0.6); }
}

/* ==========================================================================
   The payoff: stamp, shockwave, confetti
   ========================================================================== */

.stamp {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.stamp span {
  font: 800 clamp(19px, 5.4vw, 27px)/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d6ffe6;
  padding: 14px 22px;
  border: 2px solid rgba(34, 197, 94, 0.9);
  border-radius: 10px;
  background: rgba(6, 24, 14, 0.72);
  box-shadow: 0 0 44px rgba(34, 197, 94, 0.55), inset 0 0 26px rgba(34, 197, 94, 0.22);
  transform: rotate(-7deg);
  text-align: center;
}
.stamp.show {
  visibility: visible;
  animation: stamp-in 2.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes stamp-in {
  0%       { opacity: 0; transform: scale(2.1); filter: blur(9px); }
  16%      { opacity: 1; transform: scale(1); filter: blur(0); }
  22%      { transform: scale(1.05); }
  30%, 74% { opacity: 1; transform: scale(1); }
  100%     { opacity: 0; transform: scale(1.06); }
}

.shock {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(134, 239, 172, 0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.shock.go { animation: shock 1s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes shock {
  0%   { opacity: 0.9; transform: scale(0.2); border-width: 3px; }
  100% { opacity: 0; transform: scale(34); border-width: 0.5px; }
}

/* particles fired on a successful unlock */
#fx {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* the whole panel reacts when access is granted */
.panel--gate.granted {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow:
    0 44px 100px -46px rgba(34, 197, 94, 0.6),
    0 0 0 1px rgba(34, 197, 94, 0.25),
    0 0 90px -20px rgba(34, 197, 94, 0.45);
  animation: granted-kick 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes granted-kick {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.018); }
  100% { transform: scale(1); }
}
/* the left rail stops breathing violet and holds a solid green */
.panel--gate.granted::after {
  background: linear-gradient(180deg, #22c55e, #4ade80);
  opacity: 1;
  animation: none;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
}

/* ==========================================================================
   Trust strip
   ========================================================================== */

.perks {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.perks li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(9, 6, 15, 0.4);
  color: var(--muted);
  font: 700 9px/1.3 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.perks li span { min-width: 0; overflow-wrap: anywhere; }
.perks li svg { flex: none; color: #c9a6ff; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.perks li:hover {
  color: #dcc4ff;
  border-color: rgba(191, 64, 191, 0.4);
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(-2px);
}
.perks li:hover svg { transform: scale(1.18) rotate(-6deg); }
.panel--gate .perks { animation: enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both; }

/* ==========================================================================
   Small motion upgrades to what was already here
   ========================================================================== */

/* the tagline settles into place instead of just appearing */
.panel--gate .sub { animation: enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.17s both, track 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.17s both; }
@keyframes track { from { letter-spacing: 0.7em; opacity: 0.2; } to { letter-spacing: 0.34em; } }

/* the wordmark glitches for a couple of frames every so often */
.panel--gate .brand em { position: relative; }
.panel--gate .brand em::before,
.panel--gate .brand em::after {
  content: attr(data-ch);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
}
.panel--gate .brand em::before { animation: glitch-a 7s steps(1) infinite; }
.panel--gate .brand em::after  { animation: glitch-b 7s steps(1) infinite; }
@keyframes glitch-a {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: 0.8; transform: translate(-3px, 1px); }
  95% { opacity: 0; }
  97% { opacity: 0.6; transform: translate(2px, -1px); }
  98% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 93%, 100% { opacity: 0; transform: none; }
  94% { opacity: 0.7; transform: translate(3px, -2px); }
  96% { opacity: 0; }
}

/* the status dot gets a ring while the server is being asked */
body.checking .status { color: #f0abfc; }
body.checking .status::before { animation: blink 0.7s ease-in-out infinite; }

/* progress ring: a soft halo that breathes while it climbs */
.panel--gate .verify.show .ring::after { animation: halo 2.2s ease-in-out infinite; }
@keyframes halo {
  0%, 100% { box-shadow: inset 0 0 34px -8px rgba(191, 64, 191, 0.45); }
  50%      { box-shadow: inset 0 0 44px -6px rgba(191, 64, 191, 0.85); }
}

/* completed steps land with a small pop */
.panel--gate .steps li.ok .dot { animation: dot-pop 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes dot-pop {
  0%   { transform: rotate(45deg) scale(0.4); }
  60%  { transform: rotate(45deg) scale(1.35); }
  100% { transform: rotate(45deg) scale(1); }
}

/* the button gets a moving stripe pattern while it works */
.panel--gate .btn.busy {
  background-image: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.07) 0 14px,
    transparent 14px 28px
  );
  background-size: 200% 100%;
  animation: stripes 0.9s linear infinite;
}
@keyframes stripes { to { background-position: -56px 0; } }

@media (max-width: 560px) {
  .perks { gap: 6px; }
  .perks li { font-size: 8.5px; letter-spacing: 0.04em; padding: 10px 4px; line-height: 1.35; }
  .cursor-glow { display: none; }
  .stage { perspective: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .bg::after { animation: none; }
  /* Purely decorative motion — drop it rather than flash it. */
  .embers, .grid-floor::before, .panel--gate .scan,
  .panel--gate .pill::after, .panel--gate .btn::after,
  .stars, .cursor-glow, .shock, #fx,
  .panel--gate .brand em::before, .panel--gate .brand em::after { display: none; }
  .panel--gate .ring::before { animation: none; }
  .tilt { transform: none !important; }
  /* Keep the confirmation, lose the theatrics. */
  .stamp.show { animation: none; opacity: 1; visibility: visible; }
}
