/*
  Estilos compartidos por las paginas legales estaticas (privacidad.html,
  terminos.html).

  Son HTML estatico y no rutas de React a proposito: la verificacion de marca
  de Google y los rastreadores leen el HTML sin ejecutar JavaScript, y esta app
  es una SPA sin renderizado en servidor. Una ruta de React les llegaria vacia.

  Los tokens replican los de guia-medico.html para que el conjunto se vea como
  un mismo sitio.
*/
:root {
  --ground: #f5f8fb;
  --surface: #ffffff;
  --ink: #0f2231;
  --ink-soft: #33505f;
  --muted: #5f7789;
  --line: #dbe4ec;
  --line-strong: #c2d1dd;
  --accent: #2180ce;
  --accent-deep: #134673;
  --accent-wash: #e8f2fb;
  --warn: #b45309;
  --warn-wash: #fdf3e3;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b1620;
    --surface: #11242f;
    --ink: #e4edf4;
    --ink-soft: #c3d4e0;
    --muted: #93a9b9;
    --line: #1f3846;
    --line-strong: #2c4a5b;
    --accent: #5aabe6;
    --accent-deep: #9bccef;
    --accent-wash: #122f44;
    --warn: #e0a75c;
    --warn-wash: #2e2314;
  }
}

:root[data-theme="dark"] {
  --ground: #0b1620;
  --surface: #11242f;
  --ink: #e4edf4;
  --ink-soft: #c3d4e0;
  --muted: #93a9b9;
  --line: #1f3846;
  --line-strong: #2c4a5b;
  --accent: #5aabe6;
  --accent-deep: #9bccef;
  --accent-wash: #122f44;
  --warn: #e0a75c;
  --warn-wash: #2e2314;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.doc {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 68px) clamp(18px, 4vw, 44px) 96px;
}

/* ---------- Cabecera ---------- */
.masthead { display: flex; flex-direction: column; gap: 22px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 40px; height: 40px; color: var(--accent); flex: none; }
.brand b { font-size: 19px; letter-spacing: -0.01em; }
.brand span {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: block;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--accent-deep); }

.standfirst {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0;
}

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-accent { height: 2px; background: var(--accent); border: 0; width: 64px; margin: 0; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Indice ---------- */
.index {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px clamp(18px, 3vw, 28px);
  margin: 40px 0 8px;
}
.index h2 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 500;
}
.index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 2px 32px;
  counter-reset: idx;
}
.index li { counter-increment: idx; margin: 0; }
.index a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15.5px;
  border-bottom: 1px solid transparent;
}
.index a::before {
  content: counter(idx, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  flex: none;
}
.index a:hover { color: var(--accent-deep); border-bottom-color: var(--line-strong); }

/* ---------- Secciones ---------- */
section { margin-top: 56px; scroll-margin-top: 24px; }

.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  max-width: 34ch;
  text-wrap: balance;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 32px 0 8px;
  max-width: var(--measure);
}

p, ul, ol, .note, .table-wrap { max-width: var(--measure); }
p { margin: 0 0 16px; }
strong { font-weight: 600; }

a { color: var(--accent-deep); text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }

ul, ol { margin: 0 0 16px; padding-left: 20px; }
li { margin-bottom: 7px; }
li::marker { color: var(--accent); }

/* ---------- Avisos ---------- */
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 0 0 22px;
}
.note > :last-child { margin-bottom: 0; }
.note-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}
.note.is-key { background: var(--accent-wash); border-color: transparent; }
.note.is-key .note-label { color: var(--accent-deep); }
.note.is-warn { background: var(--warn-wash); border-color: transparent; }
.note.is-warn .note-label { color: var(--warn); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 460px;
}
th, td {
  text-align: left;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  border-bottom-color: var(--line-strong);
}

/* ---------- Cierre ---------- */
.closing {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.closing p { color: var(--muted); font-size: 15px; margin: 0; }
.closing .brand svg { width: 32px; height: 32px; }
