/* Prestalio — sistema visual. Tinta índigo de noche, bugambilia, lima y papel cálido.
   Motivo: la «tira» de talones de pago que une el monto con sus fechas. */

@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/sora-latin-var.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #1d1a39;
  --ink-2: #45415e;
  --ink-3: #5f5b78;
  --night: #17142e;
  --night-2: #221e42;
  --paper: #faf7f1;
  --paper-2: #f3eee4;
  --surface: #ffffff;
  --line: #e4ddd1;
  --line-2: #cbc2b3;
  --berry: #b3245b;
  --berry-ink: #8e1a47;
  --berry-soft: #fbe8ef;
  --lime: #cdeb6c;
  --lime-2: #b5d84a;
  --lime-soft: #f2f9da;
  --lime-ink: #3b5300;
  --lilac: #ece9f7;
  --lilac-2: #d8d3ef;
  --warn-bg: #fff3d6;
  --warn-ink: #6e4600;
  --ok-ink: #2c6a33;
  --focus: #b3245b;

  --f-display: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --f-text: "Schibsted Grotesk", "Helvetica Neue", "Segoe UI", sans-serif;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 26px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow-1: 0 1px 2px rgba(29, 26, 57, .06), 0 6px 18px rgba(29, 26, 57, .06);
  --shadow-2: 0 2px 4px rgba(23, 20, 46, .08), 0 18px 48px rgba(23, 20, 46, .18);
  --bar-h: 0px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  padding-bottom: var(--bar-h);
}
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--berry-ink); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--berry); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--lime); }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 4.6vw, 3.55rem); font-weight: 700; }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.22rem; font-weight: 650; letter-spacing: -.01em; }
h4 { font-size: 1.05rem; font-weight: 650; letter-spacing: 0; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li + li { margin-top: .35em; }
strong { font-weight: 700; }
small, .small { font-size: .9rem; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.talon span, .range-scale, td.n, th.n, .cal-grid, .clabe-parts, .phone-row b { font-family: var(--f-display); letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: calc(780px + var(--gutter) * 2); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding: clamp(36px, 5vw, 64px) 0; }
.section--paper2 { background: var(--paper-2); }
.section--surface { background: var(--surface); }
.section--night { background: var(--night); color: #f4f1ff; }
.section--night a { color: var(--lime); }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--ink-2); font-size: 1.12rem; }
.section--night .section-head p { color: #cdc8e8; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--f-display); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--berry-ink); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--berry) 0 45%, transparent 45% 55%, var(--lime-2) 55%); }
.section--night .eyebrow, .hero .eyebrow, .page-hero .eyebrow, .card--night .eyebrow { color: var(--lime); }

/* Enlace de salto */
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-s); font-weight: 700; }
.skip:focus { top: 12px; color: #fff; }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(250, 247, 241, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.42rem; letter-spacing: -.035em; min-height: 48px; }
.brand:hover { color: var(--ink); }
.brand svg { width: 38px; height: 38px; }
.brand .dot { color: var(--berry); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav li + li { margin-top: 0; }
.nav ul a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav ul a:hover { background: var(--lilac); color: var(--ink); }
.nav ul a[aria-current="page"], .nav ul a[aria-current="true"] { background: var(--ink); color: #fff; }
.header-cta { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 700 1rem var(--f-text); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: 2px solid transparent;
  font: 700 1.02rem/1.15 var(--f-text); text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { background: var(--berry); color: #fff; }
.btn--primary:hover { background: var(--berry-ink); color: #fff; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--night-2); color: #fff; }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--lime:hover { background: var(--lime-2); color: var(--ink); }
.btn--ghost-light { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn--ghost-light:hover { background: #fff; color: var(--ink); }
.btn--small { min-height: 48px; padding: 0 18px; font-size: .96rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 700; min-height: 48px; }
.link-arrow svg { width: 18px; height: 18px; transition: transform .15s ease; }
.link-arrow:hover svg { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .btn, .link-arrow svg { transition: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--night); color: #f4f1ff; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .085) 1.3px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}
.hero-ring { position: absolute; right: -180px; top: -160px; width: 620px; height: 620px; pointer-events: none; opacity: .9; }
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: clamp(28px, 5vw, 72px); align-items: start; padding-top: clamp(40px, 6vw, 84px); padding-bottom: clamp(48px, 6vw, 88px); }
.hero h1 { color: #fff; max-width: 15ch; }
.hero h1 .mark { background: linear-gradient(transparent 62%, rgba(205, 235, 108, .42) 62% 92%, transparent 92%); padding: 0 .06em; }
.hero-lead { font-size: clamp(1.12rem, 1.6vw, 1.3rem); color: #d9d4f2; max-width: 34ch; }
.hero-facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.hero-facts li { display: flex; gap: 12px; align-items: flex-start; margin: 0; color: #e8e4fb; }
.hero-facts svg { flex: none; width: 24px; height: 24px; color: var(--lime); margin-top: 1px; }
.hero-legal { margin-top: 26px; font-size: .9rem; color: #bdb7dc; max-width: 46ch; }
.hero-legal a { color: #fff; }

/* Calculadora */
.calc-stack { position: relative; }
.clip-x { overflow-x: clip; }
.calc-stack::before, .calc-stack::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-l); z-index: 0; }
.calc-stack::before { background: var(--lilac-2); transform: rotate(-3.2deg) translate(-10px, 8px); }
.calc-stack::after { background: var(--lime); transform: rotate(2.2deg) translate(10px, 12px); }
.calc { position: relative; z-index: 1; background: var(--surface); color: var(--ink); border-radius: var(--r-l); box-shadow: var(--shadow-2); padding: clamp(20px, 3vw, 32px); }
.calc h2, .calc .calc-title { font-size: 1.32rem; margin-bottom: 4px; }
.calc-sub { color: var(--ink-2); font-size: .95rem; margin-bottom: 18px; }
.calc fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.calc legend, .calc .field-label { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: var(--paper-2); border-radius: 999px; }
.segmented label { flex: 1 1 0; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: .95rem; color: var(--ink-2); white-space: nowrap; }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.segmented--terms span { min-width: 52px; }
.amount-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.money-input { position: relative; flex: 1; }
.money-input span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font: 700 1.5rem var(--f-display); color: var(--ink-3); }
.money-input input { width: 100%; min-height: 60px; padding: 0 70px 0 40px; border: 2px solid var(--line-2); border-radius: var(--r-m); font: 700 1.6rem var(--f-display); color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.money-input input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--lilac-2); }
.money-input input[aria-invalid="true"] { border-color: var(--berry); }
.money-input em { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 700; color: var(--ink-3); font-size: .9rem; }
.range { width: 100%; margin: 6px 0 4px; accent-color: var(--berry); height: 36px; }
.range-scale { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.field-hint { font-size: .88rem; color: var(--ink-3); margin: 6px 0 0; }
.calc .field { margin-bottom: 18px; }
.result .field-label { margin-top: 18px; }
.field-error { font-size: .92rem; color: var(--berry-ink); font-weight: 600; margin: 8px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.field-error:empty { display: none; }
.date-input { min-height: 48px; border: 2px solid var(--line-2); border-radius: var(--r-s); padding: 0 12px; font: 600 1rem var(--f-text); color: var(--ink); background: var(--surface); }
.calc-more { margin: 0 0 16px; }
.calc-more summary { cursor: pointer; font-weight: 700; color: var(--ink-2); min-height: 44px; display: flex; align-items: center; gap: 6px; }
.calc-more[open] summary { margin-bottom: 8px; }

.result { border-top: 1.5px dashed var(--line-2); margin-top: 6px; padding-top: 18px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 0; }
.result-grid div { min-width: 0; }
.result-grid dt { font-size: .86rem; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.result-grid dd { margin: 0; font: 700 1.25rem/1.2 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.result-grid .total { grid-column: 1 / -1; background: var(--night); color: #fff; border-radius: var(--r-m); padding: 14px 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.result-grid .total dt { color: #cdc8e8; font-size: .95rem; }
.result-grid .total dd { font-size: clamp(1.7rem, 3.4vw, 2.15rem); color: var(--lime); }
.result-grid .cat dd { color: var(--berry-ink); }
.result-note { font-size: .86rem; color: var(--ink-3); margin: 12px 0 0; }
.loyalty-note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--lime-soft); font-size: .9rem; }
.loyalty-note[hidden] { display: none; }
.result-status { display: none; }
.result-status.is-visible { display: flex; gap: 10px; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-s); padding: 12px 14px; font-size: .95rem; margin-bottom: 12px; }
.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.calc-actions .btn { flex: 1 1 220px; }
.calc-actions .btn--primary { flex-basis: 100%; }
.calc-fineprint { font-size: .86rem; color: var(--ink-3); margin: 14px 0 0; }

/* La tira: talones de pago */
.tira { list-style: none; margin: 14px 0 0; padding: 4px 2px 8px; display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tira li { margin: 0; scroll-snap-align: start; }
.talon {
  position: relative; flex: 1 0 96px; min-width: 96px; padding: 10px 14px 11px;
  background: var(--lilac); border-radius: 12px; font-variant-numeric: tabular-nums;
  -webkit-mask: radial-gradient(circle 6px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 6px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat;
}
.talon::after { content: ""; position: absolute; left: 7px; right: 7px; top: 34px; border-top: 1.5px dashed rgba(29, 26, 57, .28); }
.talon b { display: block; font: 700 .98rem/1.2 var(--f-display); letter-spacing: -.01em; height: 24px; }
.talon span { display: block; padding-top: 8px; font-size: .9rem; font-weight: 600; }
.talon small { display: block; font-size: .74rem; color: var(--ink-2); }
.talon--last { background: var(--lime); }
.talon--more { background: transparent; border: 1.5px dashed var(--line-2); -webkit-mask: none; mask: none; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.section--night .talon { background: var(--night-2); color: #fff; }
.section--night .talon small { color: #bdb7dc; }
.section--night .talon::after { border-color: rgba(255, 255, 255, .25); }
.section--night .talon--last { background: var(--lime); color: var(--ink); }
.section--night .talon--last small { color: var(--ink-2); }

/* Tarjetas y rejillas */
.grid { display: grid; gap: clamp(16px, 2.4vw, 26px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: clamp(20px, 2.6vw, 28px); position: relative; }
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card--link { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: border-color .15s ease, box-shadow .15s ease; }
.card--link:hover { color: var(--ink); border-color: var(--ink); box-shadow: var(--shadow-1); }
.card--link .link-arrow { margin-top: auto; color: var(--berry-ink); }
.card--lilac { background: var(--lilac); border-color: transparent; }
.card--lime { background: var(--lime-soft); border-color: #dbeca3; }
.card--night { background: var(--night); color: #f4f1ff; border-color: transparent; }
.card-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--lilac); color: var(--ink); display: grid; place-items: center; margin-bottom: 16px; }
.card-icon svg { width: 26px; height: 26px; }
.card-icon--berry { background: var(--berry-soft); color: var(--berry-ink); }
.card-icon--lime { background: var(--lime); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--lilac); color: var(--ink); }
.tag--warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag--lime { background: var(--lime); }
.tag--berry { background: var(--berry-soft); color: var(--berry-ink); }

/* Pasos */
.steps { counter-reset: paso; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 32px); list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: paso; margin: 0; background: var(--surface); border-radius: var(--r-l); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.steps figure { margin: 0; background: var(--lilac); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.steps figure img { width: 100%; height: 100%; object-fit: cover; }
.steps .step-body { padding: 22px 24px 26px; }
.steps h3::before { content: counter(paso, decimal-leading-zero); display: block; font: 700 .85rem var(--f-display); color: var(--berry-ink); letter-spacing: .1em; margin-bottom: 8px; }
.steps p { color: var(--ink-2); margin: 0; }

/* Composición del pago */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split--top { align-items: start; }
.cost { margin: 0; background: var(--surface); border-radius: var(--r-l); border: 1px solid var(--line); padding: clamp(20px, 3vw, 32px); }
.cost-bar { display: block; width: 100%; height: 54px; border-radius: 14px; margin: 18px 0 20px; }
.cost-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cost-legend li { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: baseline; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cost-legend li:last-child { border-bottom: 0; padding-bottom: 0; }
.cost-legend i { width: 14px; height: 14px; border-radius: 4px; display: block; transform: translateY(2px); }
.cost-legend b { font-family: var(--f-display); font-size: 1.05rem; }
.cost-legend .sum { border-top: 2px solid var(--ink); padding-top: 12px; border-bottom: 0; }
.cost-legend .sum b { font-size: 1.35rem; }
.i-capital { background: var(--ink); }
.i-interest { background: var(--berry); }
.i-iva { background: var(--lime); background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(29, 26, 57, .2) 4px 5px); }
.i-none { background: transparent; }

/* Calendario visual */
.cal { background: var(--surface); color: var(--ink); border-radius: var(--r-l); padding: 22px; box-shadow: var(--shadow-1); max-width: 440px; }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cal-head b { font: 700 1.1rem var(--f-display); text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; }
.cal-grid .dow { font-size: .72rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; padding-bottom: 4px; }
.cal-grid .d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); }
.cal-grid .d--pay { background: var(--berry); color: #fff; font-weight: 700; }
.cal-grid .d--start { background: var(--lime); color: var(--ink); font-weight: 700; }
.cal-grid .d--empty { visibility: hidden; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .85rem; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; }
.cal-legend .dot-start { background: var(--lime); }
.cal-legend .dot-pay { background: var(--berry); border-radius: 50%; }

/* Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
caption { text-align: left; padding: 16px 18px 6px; font-weight: 700; font-family: var(--f-display); caption-side: top; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); background: var(--paper); font-weight: 700; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td, tfoot th { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; background: var(--paper); }
.table-kv th { width: 38%; font-weight: 700; }

/* Avisos */
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r-m); background: var(--lilac); margin: 0 0 1.4em; }
.callout svg { flex: none; width: 24px; height: 24px; margin-top: 2px; }
.callout p:last-child { margin-bottom: 0; }
.callout--warn { background: var(--warn-bg); color: var(--warn-ink); }
.callout--warn a { color: var(--warn-ink); }
.callout--lime { background: var(--lime-soft); }
.callout--berry { background: var(--berry-soft); }
.callout--night { background: var(--night); color: #f4f1ff; }
.callout--night a { color: var(--lime); }

/* Encabezado de página interior */
.page-hero { background: var(--night); color: #f4f1ff; position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1.3px, transparent 1.4px); background-size: 24px 24px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); pointer-events: none; }
.page-hero .wrap { position: relative; padding-top: clamp(28px, 4vw, 44px); padding-bottom: clamp(40px, 6vw, 72px); }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: center; }
.page-hero h1 { color: #fff; max-width: 22ch; }
.page-hero .lead { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: #d9d4f2; max-width: 60ch; margin: 0; }
.page-hero-art img { width: 100%; max-width: 340px; margin-left: auto; }
.page-hero .tag { margin-bottom: 14px; }
.breadcrumbs { font-size: .9rem; margin-bottom: 20px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumbs li { margin: 0; color: #bdb7dc; display: inline-flex; gap: 8px; align-items: center; }
.breadcrumbs li + li::before { content: "/"; color: #8a84ad; }
.breadcrumbs a { color: #fff; display: inline-flex; min-height: 32px; align-items: center; }

/* Contenido largo */
.layout-doc { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin-top: 1.9em; scroll-margin-top: 100px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5em; }
.prose > ul li::marker, .prose > ol li::marker { color: var(--berry); font-weight: 700; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .9rem; color: var(--ink-3); margin-top: 8px; }
.prose .table-wrap { margin: 1.2em 0 1.6em; }
.aside { position: sticky; top: 96px; display: grid; gap: 16px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; }
.toc b { display: block; font-family: var(--f-display); margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.toc li:last-child a { border-bottom: 0; }
.toc a:hover { color: var(--berry-ink); }
.review { font-size: .9rem; color: var(--ink-2); border-top: 1px solid var(--line); margin-top: 40px; padding-top: 18px; }
.review ul { margin: 6px 0 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 34px; margin: 0 0 12px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 7px; background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1a39' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 15px no-repeat; }
.nolist { list-style: none; padding: 0; }
.nolist li { position: relative; padding-left: 34px; margin: 0 0 12px; }
.nolist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 7px; background: var(--berry-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e1a47' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 13px no-repeat; }

/* Preguntas frecuentes */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 20px; min-height: 56px; font-weight: 700; font-size: 1.04rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lilac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1a39' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 16px no-repeat; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--lime); }
.faq .answer { padding: 0 20px 18px; color: var(--ink-2); }
.faq .answer p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* Búsqueda de ayuda */
.search { position: relative; max-width: 640px; }
.search label { display: block; font-weight: 700; margin-bottom: 8px; color: #fff; }
.search input { width: 100%; min-height: 58px; padding: 0 18px 0 52px; border-radius: 999px; border: 2px solid transparent; font: 600 1.08rem var(--f-text); color: var(--ink); background: var(--surface); }
.search input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 4px rgba(205, 235, 108, .35); }
.search svg { position: absolute; left: 18px; bottom: 18px; width: 22px; height: 22px; color: var(--ink-3); pointer-events: none; }
.search-results { margin-top: 26px; }
.search-results[hidden] { display: none; }
.search-results ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.search-results li { margin: 0; }
.search-results a { display: block; padding: 14px 18px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.search-results a:hover { border-color: var(--ink); }
.search-results a b { display: block; font-family: var(--f-display); }
.search-results a span { color: var(--ink-2); font-size: .95rem; }
.search-count { font-weight: 700; margin-bottom: 10px; }

/* Herramienta CLABE */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(20px, 3vw, 30px); margin: 1.6em 0; }
.tool label { font-weight: 700; display: block; margin-bottom: 8px; }
.tool input[type="text"] { width: 100%; min-height: 56px; padding: 0 16px; border: 2px solid var(--line-2); border-radius: var(--r-m); font: 700 1.25rem var(--f-display); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.tool input[type="text"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--lilac-2); }
.tool-out { margin-top: 14px; min-height: 1.6em; font-weight: 600; }
.clabe-parts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.clabe-parts li { margin: 0; background: var(--lilac); border-radius: 10px; padding: 8px 12px; font: 700 1rem var(--f-display); letter-spacing: .05em; }
.clabe-parts li small { display: block; font: 600 .72rem var(--f-text); letter-spacing: 0; color: var(--ink-2); }
.clabe-parts li.ctrl { background: var(--lime); }

/* Figura: dónde ver la CLABE */
.phone { width: 260px; max-width: 100%; margin: 0 auto; background: var(--night); border-radius: 36px; padding: 14px; box-shadow: var(--shadow-2); }
.phone-screen { background: var(--paper); border-radius: 26px; padding: 18px 16px 22px; min-height: 380px; color: var(--ink); }
.phone-bar { height: 6px; width: 70px; border-radius: 3px; background: var(--line-2); margin: 0 auto 18px; }
.phone-title { font: 700 1rem var(--f-display); margin-bottom: 12px; }
.phone-row { background: var(--surface); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; font-size: .82rem; color: var(--ink-2); }
.phone-row b { display: block; color: var(--ink); font: 700 .92rem var(--f-display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.phone-row--hl { outline: 3px solid var(--berry); outline-offset: 2px; }
.phone-stamp { display: inline-block; margin-top: 10px; font-size: .72rem; font-weight: 800; letter-spacing: .14em; color: var(--berry-ink); border: 2px solid var(--berry); border-radius: 6px; padding: 2px 8px; transform: rotate(-4deg); }

/* Niveles del programa */
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 26px); }
.level { background: var(--surface); border-radius: var(--r-l); border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.level img { width: 92px; height: 92px; }
.level h3 { margin: 6px 0 0; font-size: 1.4rem; }
.level p { margin: 0; color: var(--ink-2); }
.level .crit { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: .92rem; }

/* Pie de página */
.site-footer { background: var(--night); color: #d9d4f2; padding: clamp(48px, 6vw, 80px) 0 calc(28px + var(--bar-h)); font-size: .96rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--lime); text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)); gap: 32px; padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin-top: 12px; max-width: 32ch; }
.site-footer h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0; }
.site-footer li a { display: inline-flex; min-height: 40px; align-items: center; }
.footer-legal { padding-top: 26px; display: grid; gap: 12px; font-size: .88rem; color: #bdb7dc; }
.footer-legal dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 24px; margin: 0; }
.footer-legal dt { font-weight: 700; color: #fff; }
.footer-legal dd { margin: 0; }
.footer-legal p a { text-decoration: underline; }

/* Utilidades */
.mt { margin-top: 28px; }
.no-margin { margin: 0; }
.rounded { border-radius: var(--r-l); }
.h3 { font-size: 1.22rem; }
.faq-heading { margin: clamp(36px, 5vw, 56px) 0 16px; font-size: 1.35rem; }
.guide-card img { border-radius: 12px; margin-bottom: 18px; width: 100%; }
.callout--night h2 { color: #fff; margin-bottom: .4em; }
.callout--night ul { margin-bottom: .8em; }
.section-head .tag { margin-bottom: 14px; }

.defs { margin: 0 0 1.4em; }
.defs dt { font-family: var(--f-display); font-weight: 700; margin-top: 14px; }
.defs dd { margin: 4px 0 0; color: var(--ink-2); }
.calc-page h2 { font-size: 1.5rem; }
.tool-out.is-ok { color: var(--ok-ink); }
.tool-out.is-bad { color: var(--berry-ink); }
.notfound h1 { margin-top: 4px; }
.lead-text { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }

/* Barra inferior móvil */
.bottom-bar { display: none; }

/* 404 */
.notfound { text-align: center; }
.notfound img { margin: 0 auto 24px; width: min(340px, 80%); }
.notfound .btn-row { justify-content: center; }

@media (max-width: 1080px) {
  .nav a { padding: 0 10px; }
  .header-cta .btn { padding: 0 16px; }
  .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; flex-direction: column; align-items: stretch; box-shadow: var(--shadow-1); }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; }
  .nav ul a { min-height: 52px; border-radius: var(--r-s); font-size: 1.08rem; }
  .header-cta { margin: 8px 0 0; }
  .header-cta .btn { width: 100%; }
  .header-row { position: relative; }
  .hero-grid, .split, .page-hero-grid, .layout-doc { grid-template-columns: minmax(0, 1fr); }
  .page-hero-art { display: none; }
  .aside { position: static; }
  .grid--3, .grid--4, .steps, .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-ring { width: 420px; height: 420px; right: -200px; top: -120px; opacity: .5; }
}

@media (max-width: 720px) {
  :root { --bar-h: calc(68px + env(safe-area-inset-bottom)); }
  body { font-size: 1.03rem; }
  .grid--2, .grid--3, .grid--4, .steps, .levels { grid-template-columns: minmax(0, 1fr); }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-row { min-height: 64px; }
  .site-header { position: relative; }
  html { scroll-padding-top: 16px; }
  .bottom-bar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(29, 26, 57, .08);
  }
  .bottom-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: .8rem; font-weight: 700; }
  .bottom-bar a svg { width: 22px; height: 22px; }
  .bottom-bar a[aria-current="page"] { background: var(--lilac); }
  .bottom-bar a.is-primary { color: var(--berry-ink); }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .result-grid dd { font-size: 1.12rem; }
  .calc-stack::before { transform: rotate(-2deg) translate(-4px, 6px); }
  .calc-stack::after { transform: rotate(1.6deg) translate(4px, 9px); }
  th, td { padding: 10px 12px; }
  .table-kv th { width: auto; }
  .table-kv tr { display: grid; }
  .table-kv th { border-bottom: 0; padding-bottom: 0; }
}

@media (max-width: 380px) {
  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .segmented span { padding: 0 8px; font-size: .9rem; }
  .segmented:not(.segmented--terms) { border-radius: 22px; }
  .segmented:not(.segmented--terms) label { flex-basis: 100%; }
  .segmented--terms span { min-width: 38px; padding: 0 4px; }
  .brand { font-size: 1.28rem; }
  .nav-toggle { padding: 0 12px; }
}

/* Impresión: cálculo con fecha, versión, monto y calendario */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; padding: 0; }
  .site-header, .site-footer, .bottom-bar, .skip, .no-print, .calc-actions, .hero-ring, .calc-stack::before, .calc-stack::after, nav.breadcrumbs, .aside { display: none !important; }
  .hero, .page-hero, .section--night { background: #fff !important; color: #000 !important; }
  .hero h1, .page-hero h1, .hero-lead, .page-hero .lead { color: #000 !important; }
  .calc { box-shadow: none; border: 1px solid #999; }
  .result-grid .total { background: #fff; color: #000; border: 2px solid #000; }
  .result-grid .total dd, .result-grid .total dt { color: #000; }
  .talon { -webkit-mask: none; mask: none; border: 1px solid #999; background: #fff !important; }
  .print-only { display: block !important; }
  details.table-details > *:not(summary) { display: block !important; }
  details.table-details summary { display: none; }
  a { color: #000; text-decoration: none; }
  .table-wrap { border: 1px solid #999; overflow: visible; }
}
.print-only { display: none; }
