:root {
  --bg: #07090d;
  --bg-2: #0b1018;
  --panel: rgba(12, 16, 24, 0.62);
  --panel-solid: #0e141d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(125, 211, 252, 0.28);
  --text: #e8eef6;
  --muted: #8b97a8;
  --faint: #5c6776;
  --cyan: #5ce1ff;
  --cyan-2: #3b82f6;
  --danger: #fb7185;
  --ok: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font-family: inherit; }

.grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 480px at 18% -10%, rgba(56, 189, 248, 0.09), transparent 58%),
    radial-gradient(720px 420px at 92% 110%, rgba(59, 130, 246, 0.07), transparent 55%),
    linear-gradient(var(--bg-2), var(--bg));
}

.grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 28%, transparent 78%);
}

.glow {
  pointer-events: none;
  position: fixed;
  width: 420px;
  height: 420px;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(92, 225, 255, 0.08), transparent 68%);
  filter: blur(10px);
}

.app {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px 28px 18px;
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-lock {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  letter-spacing: 0.2em;
  font-weight: 600;
}

.mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0;
  box-shadow: inset 0 0 12px rgba(92, 225, 255, 0.12);
}

.clock {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.clock b {
  font-weight: 500;
  font-size: 13px;
  color: #dbeafe;
}

.clock span { color: var(--faint); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.stage {
  display: grid;
  place-items: center;
  padding: 28px 12px;
}

.glass {
  width: min(560px, 94vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 42px 40px 34px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.kicker {
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

h1 em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-weight: 500;
  color: #93c5fd;
  letter-spacing: -0.03em;
}

.rule {
  width: 56px;
  height: 1px;
  margin: 22px 0 18px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.lede {
  max-width: 38ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0 30px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.015);
}

.chip small {
  display: block;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.chip b {
  font-weight: 500;
  font-size: 12px;
  color: var(--text);
}

.enter {
  appearance: none;
  border: 1px solid rgba(92, 225, 255, 0.45);
  background: linear-gradient(180deg, rgba(92, 225, 255, 0.12), rgba(59, 130, 246, 0.05));
  color: #ecfeff;
  padding: 14px 22px;
  border-radius: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.enter:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(92, 225, 255, 0.15), 0 10px 30px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

.fine {
  margin-top: 16px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.open { display: flex; }

.modal {
  width: min(420px, 94vw);
  background: rgba(10, 14, 20, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.modal .hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 12px 0 6px;
}

input {
  width: 100%;
  background: #070b11;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
}

input:focus {
  border-color: rgba(92, 225, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

input.otp {
  letter-spacing: 0.42em;
  text-align: center;
  font-size: 22px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.row button {
  flex: 1;
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}

.go {
  border: 0;
  background: linear-gradient(180deg, #67e8f9, #38bdf8);
  color: #08202a;
}

.abort {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.msg {
  min-height: 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--danger);
}

.msg.ok { color: var(--cyan); }

.pair-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin: 8px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(92, 225, 255, 0.5);
  background: linear-gradient(180deg, #67e8f9, #38bdf8);
  color: #08202a;
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pair-btn:hover { filter: brightness(1.06); }

.pair-wait {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.step { display: none; }
.step.active { display: block; }

@media (max-width: 720px) {
  .app { padding: 16px; }
  .glass { padding: 28px 20px 22px; }
  .meta { grid-template-columns: 1fr; }
  .topbar, .footer { letter-spacing: 0.08em; }
  .clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .enter { transition: none; }
}
