:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5d6470;
  --border: #d5d9e0;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --danger-bg: #fdecec;
  --danger: #a3141c;
  --notice-bg: #eef4ff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1d2026;
    --text: #e9ebef;
    --muted: #a3a9b4;
    --border: #353a43;
    --accent: #6b9bff;
    --accent-text: #0b1020;
    --danger-bg: #3a1d20;
    --danger: #ffb4b8;
    --notice-bg: #1f2a3d;
  }
}

* {
  box-sizing: border-box;
}

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

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

.card.wide {
  max-width: 640px;
}

.brand {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

section {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

label {
  display: block;
  font-weight: 600;
  margin: 12px 0 4px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}

label.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 400;
}

label.check input {
  width: auto;
  margin-top: 4px;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button {
  margin-top: 16px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--accent);
}

button.link {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
}

form.inline button {
  width: auto;
}

.actions {
  display: flex;
  gap: 12px;
}

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

.muted,
.hint,
small {
  color: var(--muted);
}

.hint {
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.alert {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 8px;
}

.notice {
  background: var(--notice-bg);
  padding: 10px 12px;
  border-radius: 8px;
}

.sep {
  text-align: center;
  color: var(--muted);
  margin: 16px 0 0;
}

.list,
.scopes {
  padding: 0;
  list-style: none;
}

.list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.scopes li {
  padding: 4px 0;
}

.qr img {
  width: 200px;
  height: 200px;
  background: #fff;
  padding: 8px;
}

pre {
  white-space: pre-wrap;
  font-size: 1rem;
}

[hidden] {
  display: none;
}
