/* Sufia Noorbakhshia — legal pages
   Palette mirrors the app's "Midnight & Gold" theme (constants.dart). */

:root {
  --gold: #b08a3e;
  --gold-soft: #e8d5a9;
  --navy: #1b2b4b;
  --text: #16223a;
  --muted: #5f6b82;
  --bg: #faf7f1;
  --surface: #ffffff;
  --surface-alt: #f2ede2;
  --border: #e3dccc;
  --shadow: 0 1px 3px rgba(22, 34, 58, .06), 0 8px 24px rgba(22, 34, 58, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --gold: #d4af6a;
    --gold-soft: #6e5a31;
    --navy: #e8c88a;
    --text: #eceff5;
    --muted: #8f9bb3;
    --bg: #0f1a2e;
    --surface: #18253d;
    --surface-alt: #213050;
    --border: #2b3b5c;
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────── */

.masthead {
  background: linear-gradient(160deg, var(--navy) 0%, #0f1a2e 100%);
  padding: 44px 20px 40px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}

@media (prefers-color-scheme: dark) {
  .masthead { background: linear-gradient(160deg, #18253d 0%, #0b1424 100%); }
}

.masthead .eyebrow {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 10px;
}

.masthead h1 {
  color: #fff;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 700;
}

.masthead .dates {
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  margin: 0;
}

.ornament {
  color: var(--gold);
  font-size: 20px;
  letter-spacing: .5em;
  margin: 0 0 14px;
  opacity: .85;
}

/* ── Layout ─────────────────────────────────────────────── */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 20px 80px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 30px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}

.card.tldr { border-left: 4px solid var(--gold); }

.card.tldr h2 { margin-top: 0; }

h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 44px 0 14px;
  color: var(--text);
  font-weight: 700;
  scroll-margin-top: 20px;
}

h2 .num {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-right: 10px;
}

h3 {
  font-size: 17px;
  margin: 26px 0 8px;
  font-weight: 700;
  color: var(--text);
}

p { margin: 0 0 14px; }

ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 8px; }

a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { opacity: .78; }

strong { font-weight: 700; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ── Table of contents ──────────────────────────────────── */

.toc { background: var(--surface-alt); }
.toc h2 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; column-count: 2; column-gap: 28px; }
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

@media (max-width: 560px) { .toc ol { column-count: 1; } }

/* ── Tables ─────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 15px;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }

/* ── Callouts ───────────────────────────────────────────── */

.note {
  border-left: 3px solid var(--gold);
  background: var(--surface-alt);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 0 0 18px;
}

.note p:last-child { margin-bottom: 0; }

.note.warn { border-left-color: #c0483f; }
@media (prefers-color-scheme: dark) { .note.warn { border-left-color: #e5786f; } }

.pill {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--text);
  border-radius: 100px;
  padding: 2px 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) { .pill { color: var(--gold); } }

/* ── Contact ────────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  font-size: 15px;
}

.contact-grid dt { font-weight: 700; color: var(--muted); }
.contact-grid dd { margin: 0; }

/* ── Footer ─────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 30px 20px 46px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

footer nav { margin-bottom: 12px; }
footer nav a { margin: 0 10px; }

/* ── Print ──────────────────────────────────────────────── */

@media print {
  .masthead { background: none; border-bottom: 2px solid #000; }
  .masthead h1, .masthead .dates { color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
  .toc { display: none; }
  body { font-size: 11pt; }
}
