:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #5d6676;
  --border: #d5d9e0;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --error: #b42318;
  --error-bg: #fdecea;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1d2128;
    --text: #e6e8ec;
    --muted: #9aa3b2;
    --border: #353b46;
    --accent: #7c9cf5;
    --accent-text: #0f1420;
    --error: #ff8a80;
    --error-bg: #3a1f1f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

h1 { font-size: 1.4rem; margin: 0 0 16px; }
p { margin: 0 0 14px; }
a { color: var(--accent); }

label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 0.95rem; }

input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
  display: inline-block;
  width: 100%;
  margin-top: 20px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }

.error {
  color: var(--error);
  background: var(--error-bg);
  border-radius: 8px;
  padding: 10px 12px;
}
.hint, .step { color: var(--muted); font-size: 0.9rem; }
.step { margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

.qr { display: flex; justify-content: center; margin: 8px 0 14px; }
.qr svg { background: #fff; border-radius: 8px; }

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.secret { word-break: break-all; }

.codes {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.codes li { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; text-align: center; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-all; }
