:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6370;
  --border: #c9cdd5;
  --accent: #2d5bd7;
  --accent-text: #ffffff;
  --error: #b42318;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #e8eaee;
    --muted: #9aa0ab;
    --border: #3a3f4a;
    --accent: #7c9cf5;
    --accent-text: #0d1020;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

h1 { margin: 0 0 20px; font-size: 1.4rem; text-align: center; }

form { display: flex; flex-direction: column; }

label { font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }

input {
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

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

.error { color: var(--error); margin: 0 0 16px; font-size: 0.95rem; }

button {
  font: inherit;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
