/* ============================================================
   ESTILOS LEGALES (Aviso de Privacidad y Términos)
   LESSSO
   ============================================================ */
:root {
  --paper: #fafaf9;
  --ink: #1c1917;
  --ink-soft: rgba(28, 25, 23, 0.7);
  --accent: #0b282c;
  --accent-soft: rgba(11, 40, 44, 0.08);
  --line: rgba(28, 25, 23, 0.15);
  --font-display: "Poppins", sans-serif;
  --font-serif: "Fraunces", serif;
  --font-body: "Inter", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c0a09;
    --ink: #f5f5f4;
    --ink-soft: rgba(245, 245, 244, 0.7);
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --line: rgba(245, 245, 244, 0.15);
    color-scheme: dark;
  }
}

html[data-theme="light"],
html.light,
body[data-theme="light"],
body.light {
  --paper: #fafaf9;
  --ink: #1c1917;
  --ink-soft: rgba(28, 25, 23, 0.7);
  --accent: #0b282c;
  --accent-soft: rgba(11, 40, 44, 0.08);
  --line: rgba(28, 25, 23, 0.15);
  color-scheme: light;
}

html[data-theme="dark"],
html.dark,
body[data-theme="dark"],
body.dark {
  --paper: #0c0a09;
  --ink: #f5f5f4;
  --ink-soft: rgba(245, 245, 244, 0.7);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --line: rgba(245, 245, 244, 0.15);
  color-scheme: dark;
}
html {
  scroll-behavior: smooth;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); line-height: 1.8; }

header {
  padding: 1.2rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  gap: 1rem;
}
.header-back-link {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}
.header-back-link:hover {
  background: var(--accent-soft);
  text-decoration: none;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
  color: var(--ink);
}
.brand em { color: var(--accent); font-style: normal; }

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 3.5rem clamp(1.25rem, 3vw, 2.5rem) 5rem;
}

/* Layout de dos columnas: Índice Sticky + Contenido legal */
.legal-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.legal-sidebar {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-right: 0.5rem;
}

.legal-toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.toc-header svg {
  color: var(--accent);
  flex-shrink: 0;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-list li {
  margin: 0;
  padding: 0;
}

.toc-link {
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.42rem 0.65rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-link:hover {
  color: var(--ink);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.toc-link.is-active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.legal-content {
  max-width: 820px;
  min-width: 0;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.7rem);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.updated { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 2.5rem; }
h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem;
  color: var(--accent);
  scroll-margin-top: 5.5rem;
}
h3 {
  scroll-margin-top: 5.5rem;
}
p, li { color: var(--ink-soft); margin-bottom: 0.9rem; }
ul { padding-left: 1.5rem; margin-bottom: 1rem; }
strong { color: var(--ink); }
a { color: var(--accent); }
.box {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
footer {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .legal-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
  .legal-toc {
    background: var(--accent-soft);
  }
  .toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.35rem;
  }
  .legal-content {
    max-width: 100%;
  }
}
