/* MAATICA legal pages (U-A). Editorial reading layout, light and dark, no web fonts
   (the CSP only allows same-origin styles). Source: apps/landing/legal/. */

:root {
  --paper: #fbfaf7;
  --ink: #1d1b22;
  --ink-soft: #4a4655;
  --ink-faint: #6f6a7c;
  --rule: #e4e0d8;
  --accent: #5b3fd1;
  --accent-soft: #efeafd;
  --note-bg: #fff6e0;
  --note-ink: #5c4300;
  --note-rule: #e9cf8a;
  --ok: #1f7a4d;
  --warn: #9a5b00;
  --err: #a3242f;
  --measure: 46rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121016;
    --ink: #ece8f4;
    --ink-soft: #c3bdd1;
    --ink-faint: #9a93ab;
    --rule: #2c2834;
    --accent: #b6a3ff;
    --accent-soft: #221c38;
    --note-bg: #2a2212;
    --note-ink: #f1d79a;
    --note-rule: #5a4720;
    --ok: #6fd3a0;
    --warn: #f0b860;
    --err: #ff8f98;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── masthead ─────────────────────────────────────────── */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.5rem;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.legal-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.92rem; }
.legal-nav a { color: var(--ink-soft); text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.legal-nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.legal-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.lang-switch {
  font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

/* ── document ─────────────────────────────────────────── */
main { padding: 2.5rem 1rem 4rem; }
.doc { max-width: var(--measure); margin: 0 auto; }
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.02rem; margin: 1.6rem 0 0.4rem; }
p, li { color: var(--ink-soft); }
strong { color: var(--ink); }
ul, ol { padding-left: 1.25rem; }
li { margin: 0.3rem 0; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--accent-soft); padding: 0.05em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.notice {
  background: var(--note-bg);
  color: var(--note-ink);
  border-left: 4px solid var(--note-rule);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.92rem;
  margin: 0 0 2rem;
}
.lead { font-size: 1.1rem; color: var(--ink); }
.summary {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.summary p, .summary li { color: var(--ink); }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: 0.15em;
  margin-left: 0.35rem;
}

/* tables collapse into stacked rows on narrow screens */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--rule); }
th { color: var(--ink); font-weight: 600; }
td { color: var(--ink-soft); }
@media (max-width: 34rem) {
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--rule); padding: 0.4rem 0; }
  td { border: 0; padding: 0.2rem 0; }
  td:first-child { color: var(--ink); font-weight: 600; }
}

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.4rem; margin: 1rem 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.05rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--accent); color: var(--paper);
  font-weight: 700; font-size: 0.9rem;
  display: grid; place-items: center;
}

/* ── status form ──────────────────────────────────────── */
.status-form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0; }
.status-form label { width: 100%; font-weight: 600; color: var(--ink); }
.status-form input {
  flex: 1 1 14rem;
  font: inherit; font-family: var(--mono);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule); border-radius: 6px;
  background: transparent; color: var(--ink);
  text-transform: uppercase;
}
.status-form button {
  font: inherit; font-weight: 600;
  padding: 0.6rem 1.2rem;
  border: 0; border-radius: 6px;
  background: var(--accent); color: var(--paper);
  cursor: pointer;
}
.status-form button:hover { filter: brightness(1.08); }
.status-form button:active { transform: translateY(1px); }
.status-result { border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.25rem; min-height: 3rem; }
.status-result[data-state="completed"] { border-color: var(--ok); }
.status-result[data-state="partial"], .status-result[data-state="received"] { border-color: var(--warn); }
.status-result[data-state="error"], .status-result[data-state="failed"] { border-color: var(--err); }
.status-result dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; }
.status-result dt { color: var(--ink-faint); }
.status-result dd { margin: 0; color: var(--ink); }

/* ── footer ───────────────────────────────────────────── */
.colophon {
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.colophon p { color: var(--ink-faint); margin: 0.25rem 0; }

@media (prefers-reduced-motion: no-preference) {
  .legal-nav a, .lang-switch { transition: color 150ms ease, border-color 150ms ease; }
}

@media print {
  .masthead, .lang-switch, .status-form { display: none; }
  body { background: #fff; color: #000; }
}
