@font-face {
  font-family: 'Norse';
  src: url('/fonts/Norse.otf') format('opentype');
  font-display: swap;
}

:root {
  --bg: #efe6d2;
  --bg-deep: #e4d7bb;
  --panel: #faf5ea;
  --panel-2: #f3ead7;
  --ink: #2b2016;
  --muted: #6f5f4b;
  --line: #d6c6a6;
  --accent: #a4561f;
  --accent-ink: #fff8ec;
  --accent-soft: #f1dcc4;
  --danger: #a3311f;
  --ok: #3f6b2a;
  --focus: #c97a2c;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.08), 0 6px 20px rgba(60, 40, 20, 0.08);
  --check-a: #e8dfcc;
  --check-b: #f6f0e3;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #15120f;
    --bg-deep: #0e0c0a;
    --panel: #1f1a15;
    --panel-2: #29221b;
    --ink: #eee3cf;
    --muted: #a8977e;
    --line: #3a3027;
    --accent: #d98a3d;
    --accent-ink: #1a120a;
    --accent-soft: #3a2a1b;
    --danger: #e0715d;
    --ok: #8fbf6a;
    --focus: #e9a45a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --check-a: #221d18;
    --check-b: #2c251f;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #15120f;
  --bg-deep: #0e0c0a;
  --panel: #1f1a15;
  --panel-2: #29221b;
  --ink: #eee3cf;
  --muted: #a8977e;
  --line: #3a3027;
  --accent: #d98a3d;
  --accent-ink: #1a120a;
  --accent-soft: #3a2a1b;
  --danger: #e0715d;
  --ok: #8fbf6a;
  --focus: #e9a45a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --check-a: #221d18;
  --check-b: #2c251f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Norse', Georgia, serif;
  font-weight: normal;
  letter-spacing: 0.04em;
  margin: 0;
}

button, input, select, textarea { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 7px 12px;
  line-height: 1.2;
}
button:hover { background: var(--panel-2); }
button:disabled { opacity: 0.55; cursor: default; }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
button.primary:hover { filter: brightness(1.06); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--panel-2); }

input[type='text'], input[type='password'], select, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
textarea { resize: vertical; min-height: 84px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.error { color: var(--danger); min-height: 1.4em; font-size: 14px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(ellipse at top, var(--accent-soft), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 { font-size: 34px; margin-bottom: 4px; }
.login-card p { margin: 0 0 20px; }
.login-card form { display: grid; gap: 10px; text-align: left; }
.login-card button { width: 100%; padding: 10px; }
