:root {
  --bg: #f4f3ef; --card: #ffffff; --ink: #0b0b0b; --muted: #52514e;
  --line: #e3e2dc; --accent: #2a78d6; --accent-ink: #ffffff;
  --err: #b42318; --ok: #1f7a4d;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110; --card: #1a1a19; --ink: #ffffff; --muted: #c3c2b7;
    --line: #34332f; --accent: #3987e5; --err: #ff8a80; --ok: #6fd3a0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px 24px;
}
.card {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px;
  margin-top: 6vh;
}
.brand { font-weight: 600; color: var(--muted); font-size: 15px; }
.brand span { font-weight: 400; }
h1 { font-size: 22px; margin: 10px 0 16px; }
h2 { font-size: 16px; margin: 20px 0 8px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.code { font-size: 26px; letter-spacing: 8px; text-align: center; }
button, a.button {
  display: block; width: 100%; margin-top: 16px; padding: 13px 16px;
  font: 600 16px/1.2 inherit; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  text-align: center; text-decoration: none;
}
button.primary, a.button { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.link {
  width: auto; margin: 0; padding: 4px 8px; border: none; color: var(--accent);
  font-weight: 500; background: none;
}
button:disabled { opacity: .6; cursor: wait; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }
.err { color: var(--err); font-weight: 500; }
.ok { color: var(--ok); font-weight: 500; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.keys { list-style: none; padding: 0; margin: 0; }
.keys li { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
[hidden] { display: none !important; }
