/* ============================================================
   APPTO — Páginas legales (Política de Privacidad y T&C)
   ============================================================ */

body.legal-page {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, .82);
}

/* Aplica un padding-top para no chocar con el navbar fijo */
.legal-page main.legal-main,
.legal-page .legal-header {
  position: relative;
}

.legal-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.legal-header {
  padding: 140px 0 56px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(91,168,90,.10), transparent 70%),
    radial-gradient(60% 50% at 100% 0%, rgba(255,193,98,.06), transparent 70%);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.legal-title {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 14px 0 14px;
  color: var(--text-white);
}

.legal-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255,255,255,.72);
  max-width: 720px;
  margin: 0 0 10px;
}

.legal-meta {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  margin: 0;
  letter-spacing: .02em;
}

/* ===== Layout: TOC + content ===== */
.legal-main {
  padding: 56px 0 80px;
}

.legal-main .legal-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}

/* ===== Índice (TOC) ===== */
.legal-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 22px 22px 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.legal-toc h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin: 0 0 12px;
}

.legal-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc-counter;
}

.legal-toc li {
  counter-increment: toc-counter;
  margin-bottom: 2px;
}

.legal-toc a {
  display: block;
  padding: 7px 10px 7px 32px;
  position: relative;
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(255,255,255,.68);
  border-radius: 8px;
  transition: var(--transition);
}

.legal-toc a::before {
  content: counter(toc-counter);
  position: absolute;
  left: 8px;
  top: 7px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.35);
}

.legal-toc a:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-white);
}

/* ===== Contenido ===== */
.legal-content {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255,255,255,.82);
}

.legal-content section {
  scroll-margin-top: 96px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.legal-content section:last-of-type {
  border-bottom: none;
}

.legal-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  margin: 0 0 14px;
  letter-spacing: -.005em;
}

.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
  margin: 22px 0 8px;
}

.legal-content p {
  margin: 0 0 14px;
}

.legal-content ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.legal-content ul li {
  margin-bottom: 8px;
  list-style: none;
  position: relative;
  padding-left: 6px;
}

.legal-content ul li::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.legal-content strong {
  color: var(--text-white);
  font-weight: 600;
}

.legal-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(91,168,90,.4);
  transition: var(--transition);
}
.legal-content a:hover {
  color: var(--text-white);
  border-bottom-color: var(--text-white);
}

.contact-block {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 8px 0 18px;
  line-height: 1.7;
}

.legal-footnote {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.06);
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.45);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .legal-main .legal-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .legal-toc {
    position: static;
    max-height: none;
  }
  .legal-toc ol {
    columns: 2;
    column-gap: 14px;
  }
  .legal-toc a {
    padding: 6px 10px 6px 28px;
  }
}

@media (max-width: 560px) {
  .legal-header {
    padding: 120px 0 40px;
  }
  .legal-toc ol {
    columns: 1;
  }
  .legal-content {
    font-size: 15.5px;
  }
}
