:root {
  --blue-950: #071b37;
  --blue-900: #09244a;
  --blue-700: #1450a3;
  --blue-100: #e8f0fc;
  --yellow: #f4c542;
  --yellow-soft: #fff4c9;
  --green: #168569;
  --green-soft: #daf3e9;
  --red: #df5b53;
  --white: #fff;
  --mist: #f4f7fb;
  --ink: #10233f;
  --muted: #63738a;
  --line: #dbe4ef;
  --shadow: 0 18px 45px rgba(9, 36, 74, .1);
  --shadow-sm: 0 8px 22px rgba(9, 36, 74, .08);
  --display: 'Manrope', 'Inter', sans-serif;
  --body: 'Inter', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--mist);
  font-family: var(--body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(244, 197, 66, .65);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
}

/* ============ Header ============ */
.legal-header {
  position: relative;
  color: var(--white);
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(20, 80, 163, .55), transparent 62%),
    linear-gradient(160deg, var(--blue-950) 10%, var(--blue-900) 70%);
}

.legal-header:before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(120deg, #000, transparent 78%);
  pointer-events: none;
}

.legal-header:after {
  content: '';
  position: absolute;
  width: 430px;
  height: 430px;
  right: -180px;
  top: -240px;
  border: 1px solid rgba(244, 197, 66, .32);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(244, 197, 66, .035),
    0 0 0 86px rgba(244, 197, 66, .02);
  pointer-events: none;
}

.legal-nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  background: rgba(7, 27, 55, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
}

.brand-copy strong,
.brand-copy small {
  display: block;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: -.02em;
}

.brand-copy small {
  margin-top: 4px;
  color: #b9cbe2;
  font-size: 10px;
}

.brand sup {
  color: var(--yellow);
  font-size: .42em;
  vertical-align: top;
  margin-left: 2px;
}

.legal-nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #dbe8f7;
  font-size: 11px;
  font-weight: 700;
}

.legal-nav-links a {
  position: relative;
  transition: color .2s ease;
}

.legal-nav-links a:hover,
.legal-nav-links a:focus-visible {
  color: var(--yellow);
}

/* ============ Hero legal ============ */
.legal-hero {
  position: relative;
  z-index: 1;
  padding: 72px 0 76px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.legal-hero h1 {
  max-width: 820px;
  margin: 0 0 18px;
  color: var(--white);
  font: 700 clamp(38px, 5vw, 58px)/1.08 var(--display);
  letter-spacing: -.055em;
}

.legal-hero .hero-lead {
  max-width: 700px;
  margin: 0;
  color: #c8d9eb;
  font-size: 16px;
}

.legal-hero .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  color: #a9c5e7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.legal-hero .hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-hero .hero-meta a:hover,
.legal-hero .hero-meta a:focus-visible {
  color: var(--yellow);
}

.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
}

.dot-yellow {
  background: var(--yellow);
}

.dot-green {
  background: var(--green);
}

/* ============ Breadcrumbs ============ */
.breadcrumbs {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.breadcrumbs a {
  color: var(--blue-700);
  font-weight: 700;
  transition: color .2s ease;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  color: var(--red);
}

.breadcrumbs span {
  margin: 0 9px;
  color: #9aaabd;
}

.breadcrumbs strong {
  color: var(--ink);
}

/* ============ Layout ============ */
.legal-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  padding: 56px 0 104px;
}

/* ============ Índice (escritorio) ============ */
.legal-index {
  position: sticky;
  top: 104px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.legal-index > strong {
  display: block;
  margin: 0 0 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--blue-900);
  font: 800 10px var(--display);
  text-transform: uppercase;
  letter-spacing: .13em;
}

.legal-index a {
  display: block;
  position: relative;
  padding: 8px 11px;
  border-left: 2px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.legal-index a + a {
  margin-top: 2px;
}

.legal-index a:hover,
.legal-index a:focus-visible {
  color: var(--blue-700);
  background: var(--blue-100);
  border-left-color: var(--yellow);
}

/* ============ Documento ============ */
.legal-document {
  min-width: 0;
  padding: 52px 60px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.legal-document > * {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
}

.legal-document h2 {
  margin: 0 0 16px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: var(--blue-900);
  font: 700 clamp(22px, 2.6vw, 27px)/1.25 var(--display);
  letter-spacing: -.035em;
  scroll-margin-top: 104px;
}

.legal-document h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-document h2:not(:first-child) {
  margin-top: 34px;
}

.legal-document p,
.legal-document ul {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 14.5px;
}

.legal-document p:last-child,
.legal-document ul:last-child {
  margin-bottom: 0;
}

.legal-document strong {
  color: var(--ink);
  font-weight: 700;
}

.legal-document ul {
  padding-left: 22px;
}

.legal-document li {
  padding: 3px 0;
}

.legal-document li::marker {
  color: var(--yellow);
}

/* ============ Elementos visuales útiles ============ */
.legal-update {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: var(--muted);
  font-size: 11px;
}

.legal-update strong {
  color: var(--blue-900);
}

.pending {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px dashed #dcb94d;
  background: var(--yellow-soft);
  color: #8a6200;
  font-weight: 700;
  white-space: nowrap;
}

.legal-note {
  margin: 28px 0;
  padding: 20px 22px;
  border-radius: 10px;
  border-left: 4px solid var(--yellow);
  background: linear-gradient(180deg, #fffdf5, #fff9e2);
  box-shadow: var(--shadow-sm);
}

.legal-note p {
  margin: 0;
  color: #5e5336;
  font-size: 13.5px;
}

.legal-note p + p {
  margin-top: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 800;
  border-bottom: 1px solid rgba(20, 80, 163, .35);
  transition: color .2s ease, border-color .2s ease;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--red);
  border-color: rgba(223, 91, 83, .4);
}

/* ============ Documentos relacionados ============ */
.legal-related {
  margin-top: 50px;
  padding-top: 32px;
  border-top: 1px dashed var(--line);
}

.legal-related h2 {
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  font: 800 12px/1.4 var(--display) !important;
  text-transform: uppercase;
  letter-spacing: .12em !important;
}

.legal-related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.legal-related-links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue-700);
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.legal-related-links a:hover,
.legal-related-links a:focus-visible {
  transform: translateY(-2px);
  border-color: #afc5e1;
  background: var(--blue-100);
  box-shadow: var(--shadow-sm);
}

.legal-related-links a[aria-current="page"] {
  color: var(--blue-900);
  background: var(--blue-100);
  border-color: #afc5e1;
  cursor: default;
}

.legal-related-links a[aria-current="page"]:hover,
.legal-related-links a[aria-current="page"]:focus-visible {
  transform: none;
}

.legal-related-links a span {
  font-size: 14px;
  color: var(--yellow);
  flex-shrink: 0;
}

.legal-related-links a[aria-current="page"] span {
  color: var(--green);
}

/* ============ Footer ============ */
.legal-footer {
  color: #c8d7e9;
  background: var(--blue-950);
}

.legal-footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 46px;
  padding: 52px 0 44px;
}

.legal-footer-brand p {
  max-width: 300px;
  margin: 16px 0 0 51px;
  color: var(--yellow);
  font: 700 14px var(--display);
}

.legal-footer-column strong {
  display: block;
  margin-bottom: 14px;
  color: #a9c5e7;
  font: 800 10px var(--display);
  text-transform: uppercase;
  letter-spacing: .13em;
}

.legal-footer-column a {
  display: block;
  padding: 5px 0;
  color: #91a8c4;
  font-size: 12px;
  font-weight: 600;
  transition: color .2s ease, transform .2s ease;
}

.legal-footer-column a:hover,
.legal-footer-column a:focus-visible {
  color: var(--yellow);
  transform: translateX(3px);
}

.legal-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: #7f98b7;
  font-size: 10px;
}

.legal-footer-bottom strong {
  color: var(--yellow);
}

/* ============ Burbuja WhatsApp ============ */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--white);
  background: var(--green);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(7, 27, 55, .28);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  color: var(--white);
  background: #0e6f58;
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(7, 27, 55, .34);
}

.whatsapp-float svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.whatsapp-tooltip {
  position: absolute;
  right: 68px;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 6px;
  color: var(--white);
  background: var(--blue-950);
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateX(5px);
  transition: opacity .2s ease, transform .2s ease;
}

.whatsapp-float:hover .whatsapp-tooltip,
.whatsapp-float:focus-visible .whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .shell {
    width: min(100% - 36px, 720px);
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 38px 0 72px;
  }

  .legal-index {
    position: static;
    top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
  }

  .legal-index > strong {
    flex: 0 0 auto;
    margin: 0 6px 0 0;
    padding: 0;
    border: 0;
  }

  .legal-index a {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-left: 0;
    border-radius: 999px;
    background: var(--mist);
    border: 1px solid var(--line);
    font-size: 11px;
  }

  .legal-index a + a {
    margin-top: 0;
  }

  .legal-index a:hover,
  .legal-index a:focus-visible {
    border-color: #afc5e1;
  }

  .legal-document {
    padding: 44px 46px;
  }

  .legal-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, 560px);
  }

  .legal-nav {
    min-height: 70px;
  }

  .legal-nav-links {
    gap: 14px;
    font-size: 10px;
  }

  .legal-nav-links a:nth-child(n + 3) {
    display: none;
  }

  .legal-hero {
    padding: 50px 0 54px;
  }

  .legal-document {
    padding: 34px 26px;
    border-radius: 12px;
  }

  .legal-document p,
  .legal-document ul {
    font-size: 13.5px;
  }

  .legal-document h2 {
    margin-top: 28px;
  }

  .legal-footer-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 42px 0 38px;
  }

  .legal-footer-bottom {
    display: block;
  }

  .legal-footer-bottom span {
    display: block;
  }

  .legal-footer-bottom span + span {
    margin-top: 8px;
  }
}

@media (max-width: 430px) {
  .legal-nav-links a:nth-child(n + 2) {
    display: none;
  }

  .legal-hero h1 {
    font-size: 38px;
  }

  .legal-document {
    padding: 28px 20px;
  }

  .whatsapp-float {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .whatsapp-tooltip {
    display: none;
  }
}

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

  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
}