/* D&D Suite — base + auth CSS foundation (SPEC §8 / §8a / §11).
 *
 * The extracted brand foundation: dark palette as CSS variables, the Marcellus/Spectral
 * type system, a small reset. Enough for base + login to look on-brand; the full
 * character-sheet CSS (sheet.css) is a later chunk.
 *
 * Fonts are SELF-HOSTED (CSP font-src 'self'): @font-face points at /static/fonts/. The
 * actual font binaries land in a later chunk; until then a robust serif/old-style fallback
 * keeps the look on-brand. No Google CDN, no inline styles (style-src 'self'). */

/* --- Self-hosted brand fonts (files added in a later chunk; fallbacks hold meanwhile) --- */
@font-face {
  font-family: "Marcellus";
  src: url("/static/fonts/Marcellus-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Marcellus SC";
  src: url("/static/fonts/MarcellusSC-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("/static/fonts/Spectral-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("/static/fonts/Spectral-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Core palette extracted from the prototype (most-frequent hexes, SPEC §8). */
  --bg: #16120d;            /* page background */
  --bg-panel: #1a150e;      /* panels / cards */
  --bg-panel-2: #1b1610;    /* alt panel */
  --bg-raise: #221a10;      /* gradient top */
  --gold: #c9a663;          /* primary accent */
  --gold-dim: #8a7340;      /* dim accent / muted gold */
  --cream: #f0e6cf;         /* primary text */
  --cream-soft: #e9ddc6;    /* soft text */
  --muted: #9b8e75;         /* muted text */
  --muted-2: #6b6052;       /* faint text / labels */
  --danger: #cf837c;        /* low-HP / error red */
  --ok: #9bbf9b;            /* success green */

  /* Gold border tints (rgba variants used throughout the prototype). */
  --line: rgba(201, 166, 98, 0.30);
  --line-soft: rgba(201, 166, 98, 0.20);
  --line-faint: rgba(201, 166, 98, 0.14);
  --line-strong: rgba(201, 166, 98, 0.40);

  --font-head: "Marcellus", "Marcellus SC", "Trajan Pro", Georgia, serif;
  --font-head-sc: "Marcellus SC", "Marcellus", Georgia, serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-raise), var(--bg)) fixed;
  background-color: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
.brand,
.headline {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gold);
}
a {
  color: var(--gold);
  text-decoration: none;
}
a:hover,
a:focus {
  color: var(--cream);
  text-decoration: underline;
}

/* --- Layout shell --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-raise), var(--bg-panel));
}
.site-header .brand {
  font-family: var(--font-head-sc);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-header .session {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.95rem;
  color: var(--cream-soft);
}
.site-header .session .role {
  color: var(--muted);
  font-variant: small-caps;
}
.main {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #2a2013, #1d160d);
  color: var(--gold);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn:hover,
.btn:focus {
  border-color: var(--gold);
  color: var(--cream);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, #3a2c16, #2a2013);
  border-color: var(--gold);
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  color: var(--muted);
}
.btn-link:hover {
  color: var(--gold);
}

/* --- Panels / cards --- */
.panel {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}

/* --- Login --- */
.login-wrap {
  min-height: calc(100vh - 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-card .brand {
  font-family: var(--font-head-sc);
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}
.login-card .tagline {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}
.field {
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cream);
  background: #120e09;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--line-faint);
}
.form-actions {
  margin-top: 1.25rem;
}
.form-actions .btn {
  width: 100%;
}
.alert {
  border: 1px solid var(--danger);
  background: rgba(207, 131, 124, 0.10);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
}

/* --- Error pages --- */
.error-wrap {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
}
.error-code {
  font-family: var(--font-head-sc);
  font-size: 4rem;
  color: var(--gold-dim);
  margin: 0;
}
.error-msg {
  color: var(--cream-soft);
  max-width: 30rem;
}

/* --- Utility --- */
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
