/* ANVAR Studio — páginas legales (términos y privacidad).
   Hoja independiente: repite los tokens de styles.css para no cargar los estilos de la landing. */
/* Fuentes de respaldo con las medidas de Onest y Young Serif (medidas en el navegador): mientras llega la
   fuente de Google, el texto ocupa casi lo mismo y al cambiar no empuja el resto de la página (menos CLS). */
@font-face { font-family: "Onest Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto"); font-weight: 100 549; size-adjust: 104%; ascent-override: 93%; descent-override: 30%; line-gap-override: 0%; }
@font-face { font-family: "Onest Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Roboto Bold"); font-weight: 550 900; size-adjust: 99.4%; ascent-override: 97%; descent-override: 31%; line-gap-override: 0%; }
@font-face { font-family: "Young Serif Fallback"; src: local("Georgia"), local("Noto Serif"); size-adjust: 112.7%; ascent-override: 93%; descent-override: 33%; line-gap-override: 0%; }

:root {
  --bg: #FFFFFF;
  --panel: #F1F2F6;
  --ink: #16163A;
  --ink-2: #55557A;
  --ink-3: #6B6B8C;
  --line: #E1E3EC;
  --cobalt: #3346F0;
  --cobalt-press: #2B3BD6;
  --cobalt-soft: #E6E9FE;
  --sale: #FFD23F;
  --ok: #1E9E57;

  --serif: "Young Serif", "Young Serif Fallback", Georgia, "Times New Roman", serif;
  --sans: "Onest", "Onest Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-panel: 24px;
  --r-btn: 14px;

  --sh-1: 0 1px 2px rgba(22, 22, 58, .06), 0 2px 8px -2px rgba(22, 22, 58, .06);
  --sh-2: 0 1px 2px rgba(22, 22, 58, .05), 0 6px 16px -6px rgba(22, 22, 58, .12), 0 18px 40px -18px rgba(22, 22, 58, .18);

  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --ease-out: cubic-bezier(.22, .8, .32, 1);

  --z-header: 30;
  --z-skip: 40;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; left: 16px; top: 12px; z-index: var(--z-skip);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-btn);
  text-decoration: none; font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s var(--ease-out);
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Botones (iguales a la landing) ---------- */
.btn {
  --bh: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--bh); padding: 0 16px;
  border-radius: var(--r-btn); border: 0;
  font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--cobalt); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(22, 22, 58, .2), 0 6px 16px -8px rgba(51, 70, 240, .7);
}
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(22, 22, 58, .2); }
@media (hover: hover) {
  .btn-primary:hover { background: var(--cobalt-press); }
  .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  height: var(--header-h);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 rgba(22, 22, 58, .07);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; margin-right: auto; }
.brand-mark { flex-shrink: 0; }
.header-cta { gap: 0; }
.header-cta .hide-xs { margin-left: .3em; }
.brand-word { white-space: nowrap; font-family: var(--serif); font-size: 21px; letter-spacing: -.01em; line-height: 1; }

/* ---------- Encabezado del documento ---------- */
.doc-head { padding-top: calc(var(--header-h) + clamp(28px, 5vw, 64px)); padding-bottom: clamp(28px, 4vw, 44px); }
.docs {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-btn);
  background: var(--panel);
}
.docs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 10px; /* 14 - 4 de relleno: concéntrico */
  font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.docs a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
@media (hover: hover) { .docs a:not([aria-current="page"]):hover { color: var(--ink); } }

.doc-head h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(2.35rem, 5vw, 3.9rem);
  line-height: 1.04; letter-spacing: -.01em;
  max-width: 16ch;
}
.doc-lead { margin-top: 18px; max-width: 62ch; font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.doc-meta { margin-top: 14px; font-size: 15px; color: var(--ink-3); }

/* ---------- Cuerpo: índice + texto ---------- */
.doc-body {
  display: grid; grid-template-columns: 252px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px); align-items: start;
  padding-bottom: clamp(64px, 9vw, 112px);
}

.toc { position: sticky; top: calc(var(--header-h) + 24px); }
.toc summary {
  display: none; /* en escritorio el índice siempre está abierto */
}
.toc summary::-webkit-details-marker { display: none; }
.toc-title { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 0 12px 8px; }
.toc ol { display: grid; gap: 1px; counter-reset: toc; }
.toc a {
  position: relative;
  display: flex; align-items: baseline; gap: 10px;
  min-height: 40px; padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px; line-height: 1.35; color: var(--ink-2); text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.toc a::before {
  counter-increment: toc; content: counter(toc);
  flex: 0 0 1.4em; font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 14px;
}
.toc a[aria-current="true"] { color: var(--ink); background: var(--panel); }
.toc a[aria-current="true"]::before { color: var(--cobalt); }
@media (hover: hover) { .toc a:not([aria-current="true"]):hover { color: var(--ink); background: rgba(241, 242, 246, .6); } }

.doc { max-width: 70ch; min-width: 0; }

/* Resumen en simple */
.summary {
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--r-panel);
  background: var(--panel);
}
.summary h2 { font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.summary ul { margin-top: 16px; display: grid; gap: 10px; }
.summary li { position: relative; padding-left: 30px; line-height: 1.5; }
.summary li::before, .yes li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='%231E9E57' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.summary-note { margin-top: 16px; font-size: 14.5px; color: var(--ink-2); }

.intro { margin-top: 32px; line-height: 1.7; }

/* Cláusulas */
.clause { padding-top: clamp(40px, 5vw, 56px); }
.clause h2 {
  display: flex; align-items: baseline; gap: .45em;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  line-height: 1.15; letter-spacing: -.01em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.clause h2 .n { flex: 0 0 auto; color: var(--cobalt); }
.clause h3 { margin-top: 26px; font-size: 18px; font-weight: 600; line-height: 1.35; }
.clause > p, .clause > ul, .clause > ol, .clause > .box, .clause > .split, .clause > .table-scroll, .clause > dl { margin-top: 16px; }
.clause p, .clause li, .clause dd { line-height: 1.7; }
.clause a, .summary a, .note a { color: var(--cobalt); font-weight: 500; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (hover: hover) { .clause a:hover, .summary a:hover, .note a:hover { text-decoration-thickness: 2px; } }
strong { font-weight: 600; }

.clause ul:not(.plain) > li { position: relative; padding-left: 22px; }
.clause ul:not(.plain) > li + li { margin-top: 8px; }
.clause ul:not(.plain) > li::before {
  content: ""; position: absolute; left: 4px; top: .72em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt);
}
.clause ol.steps { counter-reset: paso; display: grid; gap: 10px; }
.clause ol.steps > li { position: relative; padding-left: 40px; }
.clause ol.steps > li::before {
  counter-increment: paso; content: counter(paso);
  position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cobalt-soft); color: var(--cobalt);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1;
}

/* Ficha de identificación */
.idcard {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px;
  margin: 16px 0 0; padding: 22px 24px;
  border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
}
.idcard dt { font-size: 15px; color: var(--ink-2); }
.idcard dd { margin: 0; font-weight: 500; }

/* Recuadros */
.box {
  padding: 18px 22px; border-radius: 18px;
  background: var(--cobalt-soft);
}
.box p + p { margin-top: 8px; }
.box-title { font-weight: 600; }

/* Sí / no */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split > div { padding: 20px 22px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.split h3 { margin: 0 0 12px; font-size: 16.5px; }
.split ul { display: grid; gap: 9px; }
.split li { position: relative; padding-left: 30px; font-size: 16px; line-height: 1.5; }
.no li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12h12' fill='none' stroke='%236B6B8C' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Tabla de planes */
.table-scroll { overflow-x: auto; border-radius: 18px; box-shadow: inset 0 0 0 1.5px var(--line); }
.plans-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.plans-table caption { text-align: left; padding: 16px 20px 0; font-size: 14.5px; color: var(--ink-2); }
.plans-table th, .plans-table td { padding: 14px 20px; text-align: left; vertical-align: top; line-height: 1.45; }
.plans-table thead th { font-size: 14.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.plans-table tbody tr + tr > * { border-top: 1px solid var(--line); }
.plans-table tbody th { font-family: var(--serif); font-weight: 400; font-size: 19px; white-space: nowrap; }
.plans-table .money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.plans-table thead .money { text-align: right; }

/* Dinero: el amarillo se usa solo aquí */
.sale { padding: 1px 7px; border-radius: 6px; background: var(--sale); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Aviso final */
.note {
  margin-top: clamp(48px, 6vw, 64px);
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px 22px; border-radius: 18px;
  background: var(--panel); color: var(--ink-2); font-size: 15.5px; line-height: 1.6;
}
.note svg { flex-shrink: 0; margin-top: 2px; color: var(--ink-2); }
.doc-next { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }

/* Al saltar a una sección desde el índice, el título se marca un instante */
.clause:target h2 { animation: marca 1.6s var(--ease-out); }
@keyframes marca {
  0%, 30% { background-color: var(--cobalt-soft); box-shadow: 0 0 0 8px var(--cobalt-soft); }
  100% { background-color: transparent; box-shadow: 0 0 0 8px transparent; }
}
.clause h2 { border-radius: 6px; }

/* ---------- Footer ---------- */
.site-footer { padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.brand-footer { margin-right: 0; }
.brand-footer .brand-word { font-size: 19px; }
.footer-legal { font-size: 14.5px; color: var(--ink-2); flex: 1 1 360px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); text-underline-offset: 3px; }
.footer-links a[aria-current="page"] { color: var(--ink); }
@media (hover: hover) { .footer-links a:hover { color: var(--ink); } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .doc-body { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .doc { max-width: 72ch; }
  .toc {
    position: static;
    border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  }
  .toc summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 56px; padding: 0 18px; cursor: pointer; list-style: none;
    font-weight: 600; font-size: 16px; border-radius: 18px;
  }
  .toc summary::after {
    content: ""; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%2316163A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
    transition: transform .22s var(--ease-out);
  }
  .toc[open] summary::after { transform: rotate(180deg); }
  .toc summary:focus-visible { outline-offset: -3px; }
  .toc-title { display: none; }
  .toc ol { padding: 0 8px 10px; }
  .toc a { min-height: 44px; align-items: center; }
}
@media (max-width: 640px) {
  .split { grid-template-columns: 1fr; }
  .idcard { grid-template-columns: 1fr; gap: 2px; padding: 18px 20px; }
  .idcard dd + dt { margin-top: 10px; }
  .doc-lead { font-size: 17.5px; }
  .plans-table th, .plans-table td { padding: 12px 14px; }
  .plans-table tbody th { font-size: 17px; }
  .header-back { display: none; }
}
@media (max-width: 480px) {
  .footer-links { flex-direction: column; gap: 0; margin-left: -10px; }
  .docs { display: flex; }
  .docs a { flex: 1; justify-content: center; }
}
@media (max-width: 440px) { .hide-xs { display: none; } }
@media (max-width: 380px) {
  .site-header .brand { gap: 7px; }
  .site-header .brand-word { font-size: 17px; }
  .header-inner .btn { padding: 0 12px; font-size: 14.5px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .btn:active { transform: none; }
}

/* ---------- Impresión ---------- */
@media print {
  .site-header, .toc, .skip, .docs, .doc-next, .footer-links { display: none !important; }
  .doc-head { padding-top: 0; }
  .doc-body { display: block; }
  .doc { max-width: none; }
  body { font-size: 11.5pt; }
  .summary, .box, .note, .split > div, .idcard, .table-scroll { background: none; box-shadow: none; border: 1px solid #ccc; }
  .clause { break-inside: auto; }
  .clause h2 { break-after: avoid; }
  a { color: inherit !important; }
}
