:root {
  --bg: #f6f3ee;
  --fg: #1f1c18;
  --muted: #6b645a;
  --accent: #8a4b1f;
  --accent-fg: #fff;
  --card: #fffdf9;
  --line: #ddd5c8;
  --alert: #a12a2a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1815;
    --fg: #ece6dc;
    --muted: #a59c8e;
    --accent: #d38a4f;
    --accent-fg: #1a1815;
    --card: #23201c;
    --line: #3a352e;
    --alert: #e07b7b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

main {
  max-width: 32rem;
  margin: 1rem auto;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 34rem) {
  main { margin: 0 1rem; }
}

h1 { margin-top: 0; font-size: 1.5rem; }

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

label { display: block; font-weight: 600; margin-bottom: 0.25rem; }

input[type="email"] {
  width: 100%;
  padding: 0.6rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 1rem;
}

input[type="submit"], button, .button {
  display: inline-block;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

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

button.link {
  padding: 0;
  font-weight: 400;
  color: var(--muted);
  background: none;
  text-decoration: underline;
}

.actions { display: flex; gap: 0.75rem; }

.actions form { margin: 0; }

.flash { padding: 0.5rem 0.75rem; border-radius: 6px; border: 1px solid var(--line); }

.flash.alert, .error { color: var(--alert); }

h2 { font-size: 1.1rem; margin-top: 1.75rem; }

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

.methods { display: flex; flex-direction: column; gap: 0.6rem; align-items: stretch; }

.methods [data-passkey-block], div[data-passkey-block] { display: flex; flex-direction: column; gap: 0.6rem; }

.methods form, .methods button { width: 100%; margin: 0; }

.methods form button { width: 100%; }

.methods .error:empty { display: none; }

input[type="submit"].secondary {
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
}

.methods-list { list-style: none; padding: 0; margin: 0 0 1rem; }

.methods-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.methods-list form { margin: 0; }
