/* ============================================================================
   legal.css — estilo compartido de las páginas legales públicas
   (terminos.html, privacidad.html y futuras). Autocontenido: NO depende de
   base.css (igual que el landing, que es "única puerta"). Replica los tokens y
   el header/footer del landing para verse como parte del sitio público.
   Cargar junto a /shared/fonts/fonts.css.
   ========================================================================== */

:root {
  --bg: #F8FAFC;
  --bg-elev: #FFFFFF;
  --bg-soft: #F1F5F9;
  --text: #0F172A;
  --text2: #334155;
  --text3: #64748B;
  --border: #E2E8F0;
  --amber: #EAB308;
  --amber-deep: #CA8A04;
  --amber-soft: #FEF3C7;
  --green: #15803D;
  --orange: #EA580C;
  --navy: #1A2547;
  --r: 12px; --r-sm: 8px; --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow: 0 2px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --font-display: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; font-weight: 450; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px;
}

/* ============ HEADER (clon del landing) ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 900px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  background-image: url('/assets/brand/mark-light.png');
  background-size: contain; background-position: center; background-repeat: no-repeat;
  flex-shrink: 0;
}
.brand-name { font-size: 18px; display: inline-flex; align-items: baseline; gap: 5px; line-height: 1; }
.brand-word--primary { color: #1A2547; font-weight: 900; }
.brand-word--accent  { color: #EA580C; font-weight: 400; }
.nav-back {
  color: var(--text2); font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.nav-back:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .nav-back:hover { transform: translateY(-1px); }
}

/* ============ DOCUMENTO ============ */
.doc { max-width: 900px; margin: 0 auto; padding: 40px 20px 64px; }
.doc-head { margin-bottom: 8px; }
.doc-eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange);
}
.doc-title {
  font-family: var(--font-display); font-size: clamp(28px, 5vw, 38px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 8px 0 10px;
}
.doc-meta { font-size: 13px; color: var(--text3); font-weight: 600; }

/* Aviso de campos por completar (solo mientras es borrador; quitar al publicar) */
.doc-notice {
  margin: 22px 0 8px; padding: 14px 16px;
  background: var(--amber-soft); border: 1px solid var(--amber);
  border-radius: var(--r-sm); font-size: 13.5px; color: #713f12; line-height: 1.55;
}
.doc-notice b { font-weight: 800; }

/* Índice */
.toc {
  margin: 26px 0; padding: 18px 20px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 800; margin: 0 0 12px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; columns: 2; column-gap: 32px; }
.toc li { counter-increment: toc; margin: 0 0 7px; break-inside: avoid; font-size: 13.5px; }
.toc li a { color: var(--text2); font-weight: 600; }
.toc li a::before { content: counter(toc) ". "; color: var(--text3); font-family: var(--font-display); font-weight: 700; }
.toc li a:hover { color: var(--orange); text-decoration: none; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* Secciones */
.doc section { scroll-margin-top: 80px; margin-top: 34px; }
.doc h2.s-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 800;
  letter-spacing: -0.01em; color: var(--text); margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 10px;
}
.doc h2.s-title .s-num {
  font-size: 14px; color: var(--orange); font-weight: 800; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.doc h3 { font-size: 15.5px; font-weight: 800; color: var(--text); margin: 20px 0 8px; }
.doc p { margin: 0 0 12px; color: var(--text2); }
.doc ul, .doc ol.list { margin: 0 0 14px; padding-left: 22px; color: var(--text2); }
.doc li { margin: 0 0 7px; }
.doc strong { color: var(--text); font-weight: 700; }
.doc .lead { font-size: 16px; color: var(--text2); }

/* Definiciones */
.deflist { margin: 0 0 14px; }
.deflist dt { font-weight: 800; color: var(--text); margin-top: 10px; }
.deflist dd { margin: 2px 0 0; color: var(--text2); }

/* Campo pendiente por completar */
.pend {
  background: var(--amber-soft); color: #713f12; font-weight: 700;
  padding: 1px 6px; border-radius: 5px; border: 1px dashed var(--amber-deep);
  font-size: .92em; white-space: nowrap;
}

/* Tabla */
.doc-table-wrap { overflow-x: auto; margin: 0 0 16px; }
.doc table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 13.5px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.doc th { background: var(--bg-soft); font-weight: 800; color: var(--text); }
.doc td { color: var(--text2); }

/* Callout (limitación de responsabilidad, etc.) */
.callout {
  margin: 16px 0; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--bg-soft); border: 1px solid var(--border); border-left: 3px solid var(--navy);
  color: var(--text2); font-size: 14px;
}
.callout.warn { border-left-color: var(--orange); background: #fff7ed; }

.back-top { display: inline-block; margin-top: 28px; font-size: 13px; font-weight: 700; }

/* ============ FOOTER (clon del landing) ============ */
.footer { background: var(--bg-elev); border-top: 1px solid var(--border); padding: 32px 20px; margin-top: 24px; }
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center;
}
.footer-meta { font-size: 13px; color: var(--text3); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text2); font-size: 13px; font-weight: 600; }
.footer-links a:hover { color: var(--text); }
