:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5d636b;
  --accent: #8a1c1c;
  --accent-text: #ffffff;
  --border: #e3ded3;
  --error-bg: #fdecea;
  --error-text: #8a1c1c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --card: #202327;
    --text: #e8e6e3;
    --muted: #a3a8ae;
    --accent: #d9534f;
    --accent-text: #16181b;
    --border: #33373c;
    --error-bg: #3a1f1f;
    --error-text: #f2b8b5;
  }
}

* { box-sizing: border-box; }

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

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

.brand {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; }
p { margin: 0 0 16px; }
.muted, .hint { color: var(--muted); }
.hint { margin: 20px 0 0; font-size: 15px; }
a { color: var(--accent); }

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

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

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

.message {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 15px;
}

[hidden] { display: none !important; }
