:root {
  --legal-primary: #1557a0;
  --legal-navy: #0b2e4f;
  --legal-blue-soft: #eaf3fb;
  --legal-surface: #f5f8fb;
  --legal-text: #243447;
  --legal-muted: #587087;
  --legal-line: #d8e5f0;
  --legal-white: #ffffff;
}

.legal-page {
  color: var(--legal-text);
  background: var(--legal-surface);
}

.legal-page .site-header {
  background: #071426;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--legal-primary);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.legal-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 8vw, 104px) 0 clamp(56px, 7vw, 86px);
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(73, 154, 226, 0.24), transparent 32%),
    linear-gradient(135deg, var(--legal-navy), #103f6b 62%, var(--legal-primary));
}

.legal-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -170px 32%;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.legal-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
}

.legal-eyebrow {
  margin-bottom: 14px;
  color: #b9ddff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-hero h1 {
  margin-bottom: 20px;
  color: #fff;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  letter-spacing: -0.045em;
}

.legal-hero__lead {
  max-width: 800px;
  margin-bottom: 22px;
  color: #eaf3fb;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.75;
}

.legal-hero__date {
  display: inline-flex;
  gap: 0.28em;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}

/* El header global cambia a menú móvil a 1180 px. En esta página legal,
   cuyo título de marca comparte espacio con siete controles, se adelanta
   el mismo patrón para evitar desbordamientos en laptops y escritorios
   medianos sin modificar la hoja global. */
@media (min-width: 1181px) and (max-width: 1500px) {
  .legal-page .menu-toggle {
    display: grid;
    place-items: center;
  }

  .legal-page .brand,
  .legal-page .menu-toggle {
    position: relative;
    z-index: 2;
  }

  .legal-page .site-header::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(3, 8, 18, 0.7);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s;
  }

  .legal-page.menu-open .site-header::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .legal-page .site-nav {
    position: fixed;
    top: var(--nav-top, var(--header-h));
    right: 0;
    left: 0;
    bottom: auto;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100dvh - var(--nav-top, var(--header-h)));
    margin-left: 0;
    padding: 14px clamp(18px, 5vw, 34px) 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid var(--glass-line);
    background: #071426;
    box-shadow: var(--shadow-md);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s;
  }

  .legal-page .site-nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .legal-page .site-nav a {
    padding: 13px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 15px;
  }

  .legal-page .site-nav a:not(.nav-cta)::after {
    display: none;
  }

  .legal-page .nav-cta {
    justify-content: center;
    margin-top: 14px;
    padding: 13px 20px !important;
    border-bottom: 0 !important;
    font-size: 14px !important;
    text-align: center;
  }
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-block: clamp(44px, 7vw, 88px);
}

.legal-toc {
  position: sticky;
  top: calc(var(--header-real, 96px) + 24px);
}

.legal-toc__card {
  padding: 24px 22px;
  border: 1px solid var(--legal-line);
  border-radius: 16px;
  background: var(--legal-white);
  box-shadow: 0 16px 44px rgba(11, 46, 79, 0.07);
}

.legal-toc h2 {
  margin-bottom: 16px;
  color: var(--legal-navy);
  font-size: 1rem;
  letter-spacing: 0;
}

.legal-toc ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.legal-toc li {
  counter-increment: toc;
}

.legal-toc a {
  display: grid;
  grid-template-columns: 2ch 1fr;
  gap: 8px;
  color: #52687c;
  font-size: 0.82rem;
  line-height: 1.35;
}

.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--legal-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.legal-toc a:hover {
  color: var(--legal-primary);
}

.legal-document {
  min-width: 0;
}

.legal-section {
  position: relative;
  margin-bottom: 24px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--legal-line);
  border-radius: 18px;
  background: var(--legal-white);
  box-shadow: 0 14px 40px rgba(11, 46, 79, 0.055);
  scroll-margin-top: calc(var(--header-real, 96px) + 20px);
}

.legal-section__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 999px;
  color: var(--legal-primary);
  background: var(--legal-blue-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.legal-section h2 {
  margin-bottom: 18px;
  color: var(--legal-navy);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  letter-spacing: -0.025em;
}

.legal-section p,
.legal-section li,
.legal-section dd {
  color: var(--legal-text);
  font-size: 1rem;
  line-height: 1.78;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section a {
  color: var(--legal-primary);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(21, 87, 160, 0.32);
  text-underline-offset: 3px;
}

.legal-section ul,
.legal-steps {
  display: grid;
  gap: 9px;
  margin: 0 0 20px;
  padding-left: 24px;
}

.legal-steps li::marker,
.legal-section li::marker {
  color: var(--legal-primary);
  font-weight: 800;
}

.legal-section--highlight {
  border-left: 5px solid var(--legal-primary);
  background: linear-gradient(135deg, #fff, #f7fbff);
}

.legal-contact {
  background: var(--legal-blue-soft);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.contact-grid div {
  padding: 16px;
  border: 1px solid #ccdfef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.contact-grid dt {
  margin-bottom: 4px;
  color: var(--legal-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.contact-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.legal-update {
  padding-top: 20px;
  border-top: 1px solid #c9ddeb;
}

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .legal-shell {
    width: min(100% - 28px, 1180px);
  }

  .legal-hero {
    padding-block: 48px;
  }

  .legal-toc ol,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .legal-section {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .legal-toc,
  .skip-link {
    display: none !important;
  }

  .legal-hero {
    padding: 24px 0;
    color: #000;
    background: #fff;
  }

  .legal-hero h1,
  .legal-hero p {
    color: #000;
  }

  .legal-layout {
    display: block;
    padding: 0;
  }

  .legal-section {
    break-inside: avoid;
    box-shadow: none;
  }
}
