/* Vitalnodo — Centro de confianza (seguridad, datos, privacidad, términos, encargo, subencargados).
   Usa las variables y tipografías de base.css. Independiente de landing.css: estas páginas no dependen del CSS de la landing.
   Una tipografía (Atkinson Next; mono solo para código), un acento, mucho aire. Sin recursos remotos. */

:root {
  --lg-measure: 68ch;
  --lg-toc-w: 15.5rem;
  --lg-top-h: 68px;
  --lg-code-bg: var(--sunken);
  --lg-key: #0A6B47;   /* claves JSON en claro (AA sobre --sunken) */
  --lg-str: #44524F;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lg-key: #5FE0A8; --lg-str: #C9D5D1; } }
:root[data-theme="dark"] { --lg-key: #5FE0A8; --lg-str: #C9D5D1; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--lg-top-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { overflow-wrap: break-word; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ——— Cabecera ——— */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; }
.top__in { display: flex; align-items: center; gap: 1.5rem; min-height: var(--lg-top-h); }
.top__act { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.top__act svg { width: 18px; height: 18px; }
@media (max-width: 440px) { .top__signup { display: none; } }

/* ——— Navegación del centro de confianza ——— */
.trust { border-bottom: 1px solid var(--line); }
.trust__in { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; padding: .7rem 0 .85rem; }
.trust__label { font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-right: .25rem; }
.trust ul { display: flex; flex-wrap: wrap; gap: .25rem .35rem; list-style: none; margin: 0; padding: 0; }
.trust a { display: inline-block; padding: .3rem .65rem; border-radius: 999px; color: var(--ink-2); font-size: var(--t-sm); text-decoration: none; }
.trust a:hover { background: var(--surface-2); color: var(--ink); }
.trust a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }

/* ——— Rejilla del documento ——— */
.doc { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.doc__grid { display: grid; gap: 2rem; }
.doc__grid > * { min-width: 0; }
.doc__grid { row-gap: 0; }
.doc__aside { margin-top: 2rem; }
@media (min-width: 1000px) {
  .doc__grid { grid-template-columns: var(--lg-toc-w) minmax(0, 1fr); column-gap: clamp(3rem, 5vw, 5rem); align-items: start; }
  .doc__head { grid-column: 2; grid-row: 1; }
  .doc__body { grid-column: 2; grid-row: 2; }
  .doc__aside { grid-column: 1; grid-row: 1 / span 2; align-self: start; margin-top: 0; padding-top: .3rem;
    position: sticky; top: calc(var(--lg-top-h) + 24px); max-height: calc(100dvh - var(--lg-top-h) - 48px); overflow-y: auto; }
}

/* Encabezado de página */
.doc__head { max-width: var(--lg-measure); }
.eyebrow { font-size: var(--t-xs); font-weight: 700; color: var(--brand-text); letter-spacing: .05em; text-transform: uppercase; }
.doc__head h1 { margin-top: .6rem; font-size: clamp(2.1rem, 5.2vw, 3.1rem); letter-spacing: -.03em; line-height: 1.06; }
.doc__lead { margin-top: 1.1rem; font-size: clamp(1.08rem, 1.7vw, 1.25rem); color: var(--ink-2); line-height: 1.5; }
.doc__meta { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; color: var(--ink-3); font-size: var(--t-sm); }

/* ——— Índice ——— */
.toc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.toc summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; cursor: pointer; list-style: none;
  font-weight: 700; font-size: var(--t-sm); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.toc[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.toc ol { list-style: none; margin: 0; padding: 0 .5rem .7rem; counter-reset: none; }
.toc li a { display: block; padding: .38rem .55rem; border-radius: var(--r-sm); border-left: 2px solid transparent; color: var(--ink-2);
  font-size: var(--t-sm); line-height: 1.35; text-decoration: none; }
.toc li a:hover { background: var(--surface-2); color: var(--ink); }
.toc li a.is-current { color: var(--ink); background: var(--surface-2); border-left-color: var(--brand-text); font-weight: 700; }
@media (min-width: 1000px) {
  .toc { border: 0; background: transparent; }
  .toc summary { padding: 0 .55rem .6rem; font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; }
  .toc summary::after { display: none; }
  .toc ol { padding: 0; }
  .toc li a { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
}

/* ——— Cuerpo ——— */
.prose { max-width: var(--lg-measure); margin-top: clamp(2.2rem, 5vw, 3.2rem); padding-top: clamp(2.2rem, 5vw, 3.2rem); border-top: 1px solid var(--line); }
@media (max-width: 999px) { .prose { margin-top: 2rem; } }
.prose > section { margin-top: clamp(2.6rem, 5vw, 3.6rem); }
.prose > section:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.35rem, 2.4vw, 1.6rem); letter-spacing: -.018em; scroll-margin-top: calc(var(--lg-top-h) + 16px); }
.prose h2 .n { color: var(--ink-3); font-weight: 400; margin-right: .35em; font-variant-numeric: tabular-nums; }
.prose h3 { margin-top: 2rem; font-size: 1.08rem; scroll-margin-top: calc(var(--lg-top-h) + 16px); }
.prose p, .prose li, .prose dd { color: var(--ink-2); }
.prose p { margin-top: .85rem; }
.prose h2 + p, .prose h3 + p { margin-top: .75rem; }
.prose ul, .prose ol { margin: .85rem 0 0; padding-left: 1.25rem; }
.prose li { margin-top: .45rem; padding-left: .2rem; }
.prose li::marker { color: var(--ink-3); }
.prose strong { color: var(--ink); }
.prose a { overflow-wrap: anywhere; }
.prose code { padding: .05em .35em; border-radius: var(--r-xs); background: var(--surface-2); color: var(--ink); font-size: .86em; overflow-wrap: anywhere; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0 0; }
.prose dl { margin: 1rem 0 0; display: grid; gap: .1rem 1.5rem; }
.prose dt { font-weight: 700; color: var(--ink); margin-top: .9rem; }
.prose dd { margin: .2rem 0 0; }
@media (min-width: 640px) { .prose dl.dl--cols { grid-template-columns: 11rem minmax(0, 1fr); } .prose dl.dl--cols dt, .prose dl.dl--cols dd { margin-top: .9rem; } }

.prose .small { font-size: var(--t-sm); color: var(--ink-3); }

/* Puntos clave (resumen) */
.keys { list-style: none !important; padding: 0 !important; display: grid; gap: .7rem; margin-top: 1.4rem !important; }
.keys li { position: relative; margin: 0; padding: 0 0 0 1.6rem; color: var(--ink); }
.keys li::before { content: ""; position: absolute; left: 0; top: .52em; width: 9px; height: 9px; border-radius: 50%; background: var(--ok-fill); }

/* Listas sí / no */
.list-no { list-style: none !important; padding: 0 !important; display: grid; gap: .55rem; margin-top: 1.1rem !important; }
.list-no li { position: relative; margin: 0; padding-left: 1.75rem; color: var(--ink); }
.list-no li::before { content: "×"; position: absolute; left: 0; top: .05em; display: grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: var(--crit-soft); color: var(--crit); font-weight: 700; font-size: .95rem; line-height: 1; }
@media (min-width: 640px) { .list-no--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; } }

/* Cajas */
.box { margin-top: 1.4rem; padding: 1.1rem 1.25rem; border-radius: var(--r-md); background: var(--surface-2); }
.box > :first-child { margin-top: 0; }
.box--brand { background: var(--brand-soft); }
.box--brand p, .box--brand li { color: var(--ink); }
.box h3 { margin-top: 0; font-size: 1rem; }

/* Tablas: en móvil cada fila se apila (sin scroll horizontal) */
.tbl { width: 100%; margin-top: 1.3rem; border-collapse: collapse; font-size: var(--t-sm); line-height: 1.45; }
.tbl caption { text-align: left; font-weight: 700; color: var(--ink); padding-bottom: .6rem; font-size: var(--t-sm); }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: .7rem .8rem .7rem 0; border-bottom: 1px solid var(--line); }
.tbl thead th { padding-top: 0; color: var(--ink-3); font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-bottom-color: var(--line-strong); }
.tbl tbody th { color: var(--ink); font-weight: 700; }
.tbl td { color: var(--ink-2); }
.tbl td:last-child, .tbl th:last-child { padding-right: 0; }
.tbl .num { white-space: nowrap; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl--wide { max-width: none; }
@media (max-width: 639px) {
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tbl, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .tbl th, .tbl td { padding: .15rem 0; border: 0; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; margin-top: .45rem; color: var(--ink-3); font-size: var(--t-xs); font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; }
  .tbl .num { white-space: normal; }
}

/* Bloque de código (ejemplo de informe) */
.code { margin-top: 1.3rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--lg-code-bg); overflow: hidden; }
.code__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--ink-3); }
.code__bar b { color: var(--ink-2); }
.code pre { margin: 0; padding: 1rem 1.1rem; max-height: min(72vh, 40rem); overflow-y: auto; font: 400 .8125rem/1.6 var(--f-mono); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
@media (max-width: 639px) { .code pre { padding: .85rem .8rem; font-size: .75rem; } }
.code .k { color: var(--lg-key); }
.code .s { color: var(--lg-str); }
.code .c { color: var(--ink-3); font-style: normal; }

/* Diagrama del flujo */
.flow { margin: 1.6rem 0 0; }
.flow svg { width: 100%; height: auto; }
.flow--tall { display: none; max-width: 340px; margin-inline: auto; }
@media (max-width: 639px) { .flow--wide { display: none; } .flow--tall { display: block; } }
.flow figcaption { margin-top: .8rem; font-size: var(--t-sm); color: var(--ink-3); }
.fl-node { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.fl-node--mid { fill: var(--brand-soft); stroke: color-mix(in srgb, var(--brand-text) 45%, transparent); }
.fl-t { fill: var(--ink); font: 700 16px var(--f-text); }
.fl-s { fill: var(--ink-2); font: 400 13px var(--f-text); }
.fl-a { fill: var(--brand-text); font: 700 13px var(--f-text); }
.fl-line { stroke: var(--brand-text); stroke-width: 2; fill: none; }
.fl-head { fill: var(--brand-text); }
.fl-x { stroke: var(--crit); stroke-width: 2; stroke-linecap: round; }
.fl-xt { fill: var(--crit); font: 700 13px var(--f-text); }
.fl-icon { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ——— Pie ——— */
.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 2rem; font-size: var(--t-sm); color: var(--ink-3); }
.foot__grid { display: grid; gap: 1.8rem; }
@media (min-width: 760px) { .foot__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; } }
.foot h2 { font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; margin-bottom: .6rem; }
.foot p + p { margin-top: .4rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--ink); }
.foot .brand { margin-bottom: .8rem; }
.foot__ver { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1.5rem;
  font-size: var(--t-xs); color: var(--ink-3); }

@media print {
  .top, .trust, .doc__aside, .foot nav, .top__act { display: none !important; }
  .doc__grid { display: block; }
  body { background: #fff; color: #000; }
  .prose p, .prose li, .tbl td { color: #000; }
}
@media (max-width: 639px) { .tbl th + td, .tbl td + td { margin-top: .25rem; } }
