:root {
  color-scheme: light dark;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #55524b;
  --border: #d6d1c6;
  --accent: #1d4e89;
  --accent-text: #ffffff;
  --danger: #a31d1d;
  --danger-text: #ffffff;
  --ok: #17612e;
  --focus: #1d4e89;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --surface: #1f1d18;
    --text: #f1eee6;
    --muted: #b9b4a7;
    --border: #3b382f;
    --accent: #8fb8ee;
    --accent-text: #0e1b2b;
    --danger: #ff8d8d;
    --danger-text: #2a0707;
    --ok: #7fd49a;
    --focus: #8fb8ee;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.brand { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 0.5rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }
.lead { color: var(--muted); }
p, ul { margin: 0 0 0.75rem; }
ul { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1rem;
  margin: 1rem 0;
}

.strong-note { font-weight: 700; color: var(--danger); }

label { display: block; font-weight: 600; margin-bottom: 0.35rem; }

input[type="email"],
input[type="text"] {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
}

#code { letter-spacing: 0.25em; font-variant-numeric: tabular-nums; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.check input { width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; flex: none; accent-color: var(--danger); }

.message { min-height: 1.5rem; margin: 0.5rem 0; color: var(--muted); }
.message.error { color: var(--danger); font-weight: 600; }
.message.ok { color: var(--ok); font-weight: 600; }

.button {
  display: inline-block;
  min-height: 3rem;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button.danger { background: var(--danger); color: var(--danger-text); }
.button.link { background: transparent; color: var(--accent); text-decoration: underline; padding-left: 0.5rem; padding-right: 0.5rem; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

.row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h2:focus { outline: none; }

[hidden] { display: none !important; }

footer { color: var(--muted); font-size: 0.95rem; }

.noscript { padding: 1rem; margin: 1rem; border: 1px solid var(--border); border-radius: 8px; }

@media (min-width: 40rem) {
  .page { padding-top: 3rem; }
  h1 { font-size: 2rem; }
  .card { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
