:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --background: #eef1f7;
  --surface: rgba(255, 255, 255, 0.92);
  --border: rgba(28, 35, 52, 0.14);
  --text: #1c2334;
  --muted: #586174;
  --accent: #3157d5;
  --accent-hover: #2444ad;
  --success: #16734a;
  --danger: #b42318;
  --debug-background: rgba(28, 35, 52, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(49, 87, 213, 0.18), transparent 38rem),
    var(--background);
}

.shell {
  display: grid;
  min-height: 100vh;
  padding: clamp(1rem, 5vw, 4rem);
  place-items: center;
}

.card {
  width: min(100%, 42rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: 0 1.5rem 4rem rgba(28, 35, 52, 0.12);
}

.card.success {
  border-top: 0.3rem solid var(--success);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.08;
}

p {
  line-height: 1.65;
}

button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  border-radius: 0.7rem;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:focus-visible {
  outline: 0.2rem solid var(--accent);
  outline-offset: 0.2rem;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button.secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.status {
  min-height: 1.5rem;
  margin-bottom: 0;
  color: var(--success);
  font-weight: 650;
}

.status.error {
  color: var(--danger);
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.debug {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.debug h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.debug-log {
  min-height: 8rem;
  max-height: 16rem;
  margin: 0;
  padding: 0.9rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  color: var(--text);
  background: var(--debug-background);
  font: 0.78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: text;
  white-space: pre-wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

dl {
  display: grid;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

dl div {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

dd {
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0d111b;
    --surface: rgba(24, 30, 44, 0.94);
    --border: rgba(255, 255, 255, 0.14);
    --text: #f2f4fa;
    --muted: #aeb6c8;
    --accent: #8da7ff;
    --accent-hover: #6f8ff6;
    --success: #56d69c;
    --danger: #ff8a80;
    --debug-background: rgba(255, 255, 255, 0.06);
  }

  button {
    color: #11192d;
  }

  button.secondary {
    color: var(--text);
  }
}
