/* Standalone stylesheet for the static legal pages (/terms, /privacy): no SPA, no build, no third-party fonts
   (so reading the legal texts sends nothing to anyone). Light and dark follow the visitor's system setting.
   Language: Spanish by default; "#en" (or any anchor inside the English section) switches to English with CSS
   only, because the CSP forbids inline scripts. */
:root {
  --bg: #F6F8FB; --paper: #FFFFFF; --text: #111827; --muted: #5B6475; --faint: #8A93A5; --border: #E3E8F0;
  --pri: #2563EB; --pri-soft: #EEF3FF; --fill-bg: #FEF3C7; --fill-text: #92400E;
  --r: 14px; --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080B14; --paper: #0F1322; --text: #EEF1FA; --muted: #A2A9C0; --faint: #737B96; --border: #232A42;
    --pri: #8C73FF; --pri-soft: #1A1838; --fill-bg: #3A2A07; --fill-text: #FCD34D;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--pri); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Top bar */
.legal-nav { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }
.brand img { width: 28px; height: 28px; display: block; }
.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; background: var(--paper); }
.lang a { padding: 3px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.lang .l-es, body:has(#en:target, #en :target) .lang .l-en { background: var(--pri-soft); color: var(--pri); }
body:has(#en:target, #en :target) .lang .l-es { background: none; color: var(--muted); }

/* Language switch */
#en { display: none; }
body:has(#en:target, #en :target) #en { display: block; }
body:has(#en:target, #en :target) #es { display: none; }

/* Layout: table of contents beside the text on wide screens, above it on narrow ones */
.doc { max-width: 1120px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 72px; }
.doc-head { max-width: 760px; margin-bottom: 28px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pri); margin-bottom: 6px; }
.doc-head h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; letter-spacing: -0.8px; margin: 0 0 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.meta strong { color: var(--text); font-weight: 600; }
.doc-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; font-size: 14px; }
.toc p { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a::before { content: counter(toc) ". "; color: var(--faint); }
.toc a:hover { color: var(--text); border-left-color: var(--border); }
@media (max-width: 900px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; max-height: none; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
  .toc ol { columns: 2 220px; column-gap: 24px; border-left: 0; }
  .toc a { padding-left: 0; border-left: 0; }
}

/* Body text */
.body { max-width: 760px; }
.body h2 { font-size: 21px; line-height: 1.3; letter-spacing: -0.3px; margin: 44px 0 10px; padding-top: 4px; }
.body h2:first-child { margin-top: 0; }
.body h2 .n { color: var(--faint); font-weight: 600; margin-right: 6px; }
.body h3 { font-size: 16.5px; margin: 24px 0 6px; }
.body p, .body li { color: var(--text); }
.body ul, .body ol { padding-left: 22px; }
.body li { margin: 4px 0; }
.body li::marker { color: var(--faint); }
.summary { background: var(--pri-soft); border: 1px solid color-mix(in srgb, var(--pri) 25%, transparent); border-radius: var(--r); padding: 18px 22px; margin: 0 0 8px; }
.summary h2 { margin: 0 0 6px !important; font-size: 17px; }
.summary ul { margin: 8px 0 0; }
.summary .note { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
.callout { border-left: 3px solid var(--pri); background: var(--paper); border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 16px 0; }
.callout.warn { border-left-color: #F59E0B; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.id-card { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 20px; margin: 12px 0; }
.id-card dt { color: var(--muted); font-size: 14px; }
.id-card dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 520px) { .id-card { grid-template-columns: 1fr; gap: 0; } .id-card dd { margin-bottom: 8px; } }
.fill { background: var(--fill-bg); color: var(--fill-text); border-radius: 4px; padding: 0 5px; font-weight: 600; font-size: .95em; }

/* Tables: scroll inside their own box on phones, never the page */
.table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--paper); margin: 14px 0; }
.table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; min-width: 560px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.table th { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--border) 35%, var(--paper)); }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { font-weight: 600; }

/* Footer */
.legal-foot { border-top: 1px solid var(--border); margin-top: 56px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; color: var(--muted); font-size: 13.5px; }
.legal-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.legal-foot a { color: var(--muted); }

@media print {
  .legal-nav, .toc, .lang { display: none !important; }
  body { background: #fff; color: #000; }
  .doc-grid { display: block; }
  #en { display: block; break-before: page; }
}
