/* ─────────────────────────────────────────────────────────────────────────────
   Forge — legal pages (/legal/*.html and the /auth/legal.html index).
   Loaded after auth/auth.css, which supplies the tokens, fonts, background
   glows and focus ring. The column and type treatment are carried over from
   the original auth/legal.html so the pages look the same as before.
───────────────────────────────────────────────────────────────────────────── */

.legal-wrap {
  max-width: 680px;
  margin: 0 auto;
  /* Below the iPhone's status bar, with room above Back to tap it (owner, 2026-10-22). */
  padding: calc(56px + env(safe-area-inset-top, 0px)) 24px 64px;
  position: relative;
  z-index: 1;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s;
}
.legal-back:hover { color: var(--text); }

.legal-banner {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gold-light);
  margin-bottom: 32px;
}
.legal-banner strong { color: var(--gold-light); font-weight: 600; }

.legal-wrap h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.05;
  margin-bottom: 8px;
  text-wrap: balance;
}

.legal-updated {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.legal-wrap h2 {
  font-family: var(--font-cond);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gold-light);
  margin: 36px 0 12px;
  text-wrap: balance;
}

.legal-wrap h3 {
  font-family: var(--font-cond);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}

.legal-wrap p,
.legal-wrap li {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 70ch;
  text-wrap: pretty;
}
.legal-wrap p  { margin-bottom: 12px; }
.legal-wrap li { margin-bottom: 8px; }
.legal-wrap ul,
.legal-wrap ol { padding-left: 22px; margin-bottom: 12px; }
.legal-wrap ul { list-style: disc; }
.legal-wrap ol { list-style: decimal; }
.legal-wrap li::marker { color: var(--gold); }

.legal-wrap strong { color: var(--text); font-weight: 600; }

.legal-wrap a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}
.legal-wrap a:hover { color: var(--text); }
.legal-wrap a.legal-back { color: var(--muted); text-decoration: none; }
.legal-wrap a.legal-back:hover { color: var(--text); }

/* Keyboard focus — links don't pick up auth.css's control focus list. */
.legal-wrap a:focus-visible,
.legal-table-wrap:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 4px;
}

/* ── Tables ──────────────────────────────────────────────────────────────────
   Wide tables scroll inside their own region on narrow phones rather than
   squeezing four columns into 320px. The wrapper is focusable so keyboard
   users can scroll it too. */
.legal-table-wrap {
  overflow-x: auto;
  margin: 8px 0 20px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.legal-wrap table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
.legal-wrap caption {
  text-align: left;
  padding: 10px 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.legal-wrap th,
.legal-wrap td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}
.legal-wrap thead th {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
}
.legal-wrap tbody th { color: var(--text); font-weight: 600; }
.legal-wrap tr:last-child th,
.legal-wrap tr:last-child td { border-bottom: none; }

/* ── Document switcher + company line ───────────────────────────────────── */
.legal-docs {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.legal-docs h2 {
  margin-top: 0;
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.legal-docs ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.legal-docs li { margin: 0; }
.legal-docs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.legal-docs a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.legal-company {
  margin-top: 16px;
  font-size: 13px !important;
  color: var(--muted);
}

@media (max-width: 480px) {
  .legal-wrap { padding: calc(56px + env(safe-area-inset-top, 0px)) 18px 48px; }
  .legal-wrap h1 { font-size: 30px; }
}
