/* =============================================================================
   CuántoPagaré — styles.css
   1 Tokens · 2 Reset · 3 Utilidades · 4 Tipografía · 5 Componentes
   6 Secciones · 7 Anuncios · 8 Responsive · 9 Impresión · 10 Reduced motion
   ============================================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:            #f4f6f9;
  --surface:       #ffffff;
  --surface-2:     #eef2f7;
  --ink:           #0b1f33;
  --ink-2:         #33475b;
  --muted:         #63788c;
  --line:          #dde5ee;
  --line-strong:   #c6d2e0;

  --accent:        #0d7a63;
  --accent-ink:    #ffffff;
  --accent-soft:   #e2f3ee;
  --accent-2:      #0f5d8f;

  --warn:          #a8560c;
  --warn-soft:     #fdf1e3;
  --warn-line:     #f0cfa8;

  --panel:         #0b1f33;
  --panel-2:       #12314d;
  --panel-ink:     #eef4fa;
  --panel-muted:   #9db1c6;
  --panel-line:    rgba(255,255,255,.13);

  --chart-grid:    #dde5ee;
  --chart-axis:    #8496a8;
  --chart-line:    #0d7a63;
  --chart-fill-a:  rgba(13,122,99,.28);
  --chart-fill-b:  rgba(13,122,99,.02);
  --chart-capital: #0d7a63;
  --chart-interes: #d98324;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;

  --radius:   14px;
  --radius-s: 9px;
  --radius-l: 20px;

  --shadow-s: 0 1px 2px rgba(11,31,51,.06), 0 1px 3px rgba(11,31,51,.05);
  --shadow-m: 0 4px 12px rgba(11,31,51,.07), 0 12px 32px rgba(11,31,51,.06);
  --shadow-l: 0 18px 48px rgba(11,31,51,.14);

  --gutter: clamp(1rem, 4vw, 2rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0a141d;
    --surface:     #11202d;
    --surface-2:   #16293a;
    --ink:         #e9f0f6;
    --ink-2:       #c2d2e0;
    --muted:       #8ea4b8;
    --line:        #22384c;
    --line-strong: #2f4c66;

    --accent:      #2bb894;
    --accent-ink:  #04241d;
    --accent-soft: #10352e;
    --accent-2:    #4aa3dd;

    --warn:        #e8a44a;
    --warn-soft:   #33240f;
    --warn-line:   #614318;

    --panel:       #0d1c28;
    --panel-2:     #123044;
    --panel-ink:   #eef4fa;
    --panel-muted: #93a8bd;
    --panel-line:  rgba(255,255,255,.10);

    --chart-grid:  #22384c;
    --chart-axis:  #6e879e;
    --chart-line:  #2bb894;
    --chart-fill-a: rgba(43,184,148,.28);
    --chart-fill-b: rgba(43,184,148,.02);
    --chart-capital: #2bb894;
    --chart-interes: #e0a44a;

    --shadow-s: 0 1px 2px rgba(0,0,0,.3);
    --shadow-m: 0 4px 12px rgba(0,0,0,.32), 0 12px 32px rgba(0,0,0,.28);
    --shadow-l: 0 18px 48px rgba(0,0,0,.45);
  }
}
/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  font-feature-settings: "tnum" 0;
}

/* `hidden` debe ganar SIEMPRE a los display de las clases (.alert, .field-row…),
   o los bloques que el JS oculta seguirían viéndose. */
[hidden] { display: none !important; }

img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em;
       background: var(--surface-2); padding: .12em .38em; border-radius: 5px; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 5px; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.wrap { width: min(1120px, 100% - var(--gutter) * 2); margin-inline: auto; }
.wrap--narrow { width: min(760px, 100% - var(--gutter) * 2); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .65rem 1.1rem; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-s); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Tipografía
   ============================================================= */
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.14;
  letter-spacing: -0.021em;
  text-wrap: balance;
  font-weight: 800;
}
h1 { font-size: clamp(1.95rem, 1.35rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.15rem); }
h3 { font-size: clamp(1.1rem, 1rem + .45vw, 1.32rem); font-weight: 700; }

.num { font-variant-numeric: tabular-num; font-feature-settings: "tnum" 1; }

/* =============================================================
   5. Componentes
   ============================================================= */

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; }

.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand__mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 1.06rem; letter-spacing: -.02em; }
.brand__name strong { font-weight: 800; color: var(--accent); }

.site-nav { display: none; gap: 1.4rem; font-size: .9rem; color: var(--muted); font-weight: 500; }
.site-nav a { transition: color .2s var(--ease-out); }
.site-nav a:hover { color: var(--accent); }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: var(--radius-s);
  font-weight: 600; font-size: .93rem; line-height: 1;
  border: 1px solid transparent;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out),
              color .2s var(--ease-out), transform .12s var(--ease-out);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 84%, #000); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: .5rem .85rem; font-size: .85rem; }
.btn--full { width: 100%; }

/* --- Tool card --- */
.tool-card {
  display: grid; gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
  overflow: hidden;
}
.panel { padding: clamp(1.15rem, 1rem + 1.6vw, 1.9rem); }

.panel--result {
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  color: var(--panel-ink);
  order: -1;                        /* móvil: el resultado se ve primero */
}

/* --- Resultado principal --- */
.result-main__label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 600; color: var(--panel-muted);
}
.result-main__value {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.7rem, 1.6rem + 5.4vw, 4.1rem);
  line-height: 1.02; letter-spacing: -.035em;
  margin-top: .15rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.result-main__meta { font-size: .88rem; color: var(--panel-muted); margin-top: .3rem; }

.result-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .1rem 1rem;
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--panel-line);
}
.result-grid__item { padding: .45rem 0; }
.result-grid dt { font-size: .78rem; color: var(--panel-muted); font-weight: 500; }
.result-grid dd {
  font-size: 1.12rem; font-weight: 700; font-family: var(--display);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* --- Barra LTV --- */
.ltv-bar {
  position: relative; height: 8px; margin-top: 1.15rem;
  background: rgba(255,255,255,.13); border-radius: 99px; overflow: hidden;
}
.ltv-bar__fill {
  height: 100%; width: 0; border-radius: 99px; background: #35c79f;
  transition: width .35s var(--ease-out), background .3s var(--ease-out);
}
.ltv-bar[data-over="1"] .ltv-bar__fill { background: #e8a44a; }
.ltv-bar__limit { position: absolute; inset: 0 auto 0 80%; width: 2px; background: rgba(255,255,255,.55); }
.ltv-bar__limit span {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: .66rem; color: var(--panel-muted); white-space: nowrap;
}

.alert {
  display: block; margin-top: 1.9rem; padding: .85rem 1rem;
  border-radius: var(--radius-s); font-size: .88rem; line-height: 1.55;
}
.alert--warn { background: rgba(232,164,74,.14); border: 1px solid rgba(232,164,74,.36); color: #f6d9b3; }
.alert--warn strong { color: #ffce8f; }

/* --- Formulario --- */
.field { margin-bottom: 1.15rem; border: 0; padding: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }

.field > label, .field > legend {
  display: block; font-size: .87rem; font-weight: 600; color: var(--ink-2);
  margin-bottom: .38rem; padding: 0;
}
.field__hint { font-weight: 500; color: var(--muted); font-size: .82rem; margin-left: .3rem; }

.field__input {
  display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); overflow: hidden;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.field__input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field__input input, .field__input select {
  flex: 1; min-width: 0; width: 100%;
  padding: .62rem .8rem; border: 0; background: none; color: var(--ink);
  font: 600 1.02rem/1.3 var(--sans); font-variant-numeric: tabular-nums;
}
.field__input input:focus, .field__input select:focus { outline: none; }
.field__input input::-webkit-outer-spin-button,
.field__input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field__input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field__unit {
  padding: 0 .8rem; font-size: .9rem; font-weight: 600; color: var(--muted);
  border-left: 1px solid var(--line-strong); align-self: stretch; display: flex; align-items: center;
}
.field__input--select { position: relative; }
.field__input--select::after {
  content: ""; position: absolute; right: .9rem; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.field__input--select select { appearance: none; padding-right: 2.4rem; cursor: pointer; }

.field__note { font-size: .8rem; color: var(--muted); margin-top: .4rem; line-height: 1.5; }
.field__note--wide { grid-column: 1 / -1; }
.field__note strong { color: var(--ink); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; margin-bottom: 1.15rem; }
.field-row--4 { grid-template-columns: 1fr 1fr; }
.field-row .field { margin-bottom: .9rem; }

/* Slider */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; margin-top: .45rem; background: none; cursor: pointer;
}
.slider::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: var(--line-strong); }
.slider::-moz-range-track { height: 5px; border-radius: 99px; background: var(--line-strong); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(11,31,51,.28);
  transition: transform .15s var(--ease-out);
}
.slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(11,31,51,.28);
}
.slider:hover::-webkit-slider-thumb { transform: scale(1.12); }

/* Segmented control */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); padding: 3px; gap: 3px;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  text-align: center; padding: .5rem .6rem; border-radius: 6px;
  font-size: .9rem; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.segmented label:hover { color: var(--ink); }
.segmented input:checked + label { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-s); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Detalles plegables de ajuste */
.tweak {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-s);
  padding: .75rem .9rem; margin-top: .3rem;
}
.tweak > summary { font-size: .87rem; font-weight: 600; color: var(--accent); cursor: pointer; list-style: none; }
.tweak > summary::-webkit-details-marker { display: none; }
.tweak > summary::before { content: "＋ "; font-weight: 700; }
.tweak[open] > summary::before { content: "－ "; }
.tweak__intro { font-size: .8rem; color: var(--muted); margin: .6rem 0 .8rem; }

/* --- Avisos --- */
.disclaimer {
  display: flex; gap: .7rem; align-items: flex-start;
  margin-top: 1.1rem; padding: .85rem 1rem;
  background: var(--warn-soft); border: 1px solid var(--warn-line);
  border-radius: var(--radius-s); color: var(--warn);
  font-size: .85rem; line-height: 1.55;
}
.disclaimer svg { width: 19px; height: 19px; flex: none; margin-top: .1rem; }
.disclaimer strong { font-weight: 700; }

.privacy-badge {
  margin-top: .7rem; font-size: .83rem; color: var(--muted); text-align: center;
}

/* --- Tabla de gastos --- */
.cost-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cost-table th, .cost-table td { padding: .55rem 0; text-align: left; font-weight: 500; }
.cost-table td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cost-table tbody tr { border-bottom: 1px solid var(--panel-line); }
.cost-table small { display: block; font-size: .74rem; color: var(--panel-muted); font-weight: 500; }
.cost-table__tax th, .cost-table__tax td { font-weight: 700; }
.cost-table__sum th, .cost-table__sum td {
  padding-top: .8rem; font-weight: 800; font-size: 1.02rem; font-family: var(--display);
}

.savings {
  margin-top: 1.3rem; padding-top: 1.2rem; border-top: 2px solid var(--panel-line);
}
.savings__label { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; color: var(--panel-muted); }
.savings__value {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 2.9rem); line-height: 1.05;
  letter-spacing: -.03em; color: #fff; margin-top: .1rem;
  font-variant-numeric: tabular-nums;
}
.savings__break { font-size: .85rem; color: var(--panel-muted); margin-top: .3rem; }

.data-stamp {
  margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--panel-line);
  font-size: .76rem; line-height: 1.55; color: var(--panel-muted);
}
.data-stamp strong { color: var(--panel-ink); }

/* --- Gráficos --- */
.charts { display: grid; gap: 1.1rem; }
.chart-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow-s);
}
.chart-card figcaption { margin-bottom: .9rem; }
.chart-card figcaption p { font-size: .85rem; color: var(--muted); margin-top: .15rem; }
.chart-box { position: relative; width: 100%; height: 230px; }
.chart-box canvas { width: 100%; height: 100%; }
.chart-box--donut { height: 215px; }
.chart-note { font-size: .8rem; color: var(--muted); margin-top: .7rem; }

.chart-legend { list-style: none; display: flex; gap: 1.3rem; justify-content: center; margin-top: .8rem; font-size: .86rem; color: var(--muted); }
.chart-legend b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.dot--capital { background: var(--chart-capital); }
.dot--interes { background: var(--chart-interes); }

/* --- Comparativa amortización anticipada --- */
.compare { display: grid; gap: .8rem; }
.compare__card {
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.compare__card--best { border-color: rgba(53,199,159,.45); background: rgba(53,199,159,.09); }
.compare__card h3 { font-size: 1rem; color: #fff; }
.compare__hint { font-size: .78rem; color: var(--panel-muted); margin-bottom: .5rem; }
.compare__big {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.4rem, 1.15rem + .9vw, 1.7rem);
  letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums;
  line-height: 1.12; text-wrap: balance;
}
.compare__delta { font-size: .82rem; color: var(--panel-muted); }
.compare__save { font-size: .84rem; margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--panel-line); color: var(--panel-muted); }
.compare__save b { color: #35c79f; font-weight: 700; font-variant-numeric: tabular-nums; }
.compare__verdict { font-size: .87rem; color: var(--panel-muted); margin-top: .9rem; line-height: 1.6; }
.compare__verdict strong { color: #fff; }

/* --- Cuadro de amortización --- */
.table-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }

.table-scroll {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s);
  -webkit-overflow-scrolling: touch;
}
.amort { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.amort thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--ink-2);
  text-align: right; font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em;
  padding: .7rem .9rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.amort thead th:first-child { text-align: left; }
.amort td, .amort tbody th { padding: .55rem .9rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amort tbody th { text-align: left; font-weight: 600; }

.amort__year { cursor: pointer; border-top: 1px solid var(--line); }
.amort__year:hover { background: var(--surface-2); }
.amort__year > th { color: var(--ink); }
.amort__year td { font-weight: 600; }
.amort__year .caret {
  display: inline-block; width: 0; height: 0; margin-right: .5rem;
  border-left: 5px solid var(--accent); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .18s var(--ease-out); vertical-align: 1px;
}
.amort__year[aria-expanded="true"] .caret { transform: rotate(90deg); }
.amort__month { background: var(--surface-2); font-size: .84rem; color: var(--ink-2); }
.amort__month th { font-weight: 500; padding-left: 1.9rem; color: var(--muted); }
.amort__empty { text-align: center; color: var(--muted); padding: 2rem; }
.amort__extra th { color: var(--accent); font-weight: 700; }
.amort__extra td { color: var(--accent); font-weight: 700; }

/* --- Pasos --- */
.steps { list-style: none; display: grid; gap: 1rem; counter-reset: step; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.3rem 1.3rem; box-shadow: var(--shadow-s);
}
.step__num {
  position: absolute; top: -.75rem; left: 1.3rem;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 50%; font-family: var(--display); font-weight: 800; font-size: .95rem;
}
.step__icon { width: 26px; height: 26px; color: var(--accent); margin-bottom: .6rem; }
.step h3 { margin-bottom: .3rem; }
.step p { font-size: .9rem; color: var(--muted); }

/* --- FAQ --- */
.faq {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: .7rem; overflow: hidden;
}
.faq > summary {
  padding: 1rem 3rem 1rem 1.15rem; font-weight: 600; cursor: pointer;
  position: relative; list-style: none; font-size: 1rem;
  font-family: var(--display); letter-spacing: -.01em;
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after {
  content: ""; position: absolute; right: 1.25rem; top: 1.35rem;
  width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.faq[open] > summary::after { transform: rotate(-135deg); top: 1.55rem; }
.faq > summary:hover { color: var(--accent); }
.faq__body { padding: 0 1.15rem 1.15rem; color: var(--muted); font-size: .93rem; }
.faq__body p + p { margin-top: .7rem; }
.faq__body strong { color: var(--ink); }

/* =============================================================
   6. Secciones
   ============================================================= */
.hero { padding: clamp(1.8rem, 1rem + 3vw, 3.2rem) 0 1.5rem; }
.hero h1 { margin-bottom: .5rem; }
.hero__sub {
  font-size: clamp(.98rem, .94rem + .25vw, 1.1rem); color: var(--muted);
  max-width: 62ch; margin-bottom: clamp(1.3rem, 1rem + 1.4vw, 2rem);
}

.section { padding: clamp(2.4rem, 1.6rem + 3vw, 4rem) 0; }
.section--alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section > .wrap > h2 { margin-bottom: .45rem; }
.section__lead { color: var(--muted); max-width: 62ch; margin-bottom: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); }

.section--prose h3 { margin: 2rem 0 .6rem; }
.section--prose h3:first-of-type { margin-top: 1.4rem; }
.section--prose p { color: var(--muted); margin-bottom: .9rem; }
.section--prose strong { color: var(--ink); font-weight: 600; }
.section--prose ul { color: var(--muted); padding-left: 1.15rem; margin-bottom: .9rem; }
.section--prose li { margin-bottom: .55rem; }

/* --- Footer --- */
.site-footer { background: var(--panel); color: var(--panel-ink); padding: 2.4rem 0 2rem; }
.site-footer__in { display: grid; gap: 1.2rem; }
.site-footer__brand .brand__name { color: #fff; }
.site-footer__brand .brand__name strong { color: #35c79f; }
.site-footer__brand p { font-size: .87rem; color: var(--panel-muted); margin-top: .3rem; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .88rem; color: var(--panel-muted); }
.site-footer__nav a:hover { color: #fff; }
.site-footer__legal {
  font-size: .76rem; color: var(--panel-muted); line-height: 1.6;
  padding-top: 1.1rem; border-top: 1px solid var(--panel-line);
}
.site-footer__legal strong { color: var(--panel-ink); }

/* =============================================================
   7. Anuncios (SOLO huecos reservados — sin scripts de terceros)
   ============================================================= */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-s);
  background: repeating-linear-gradient(45deg,
    transparent, transparent 9px,
    color-mix(in srgb, var(--line) 45%, transparent) 9px,
    color-mix(in srgb, var(--line) 45%, transparent) 18px);
  color: var(--muted);
}
.ad-slot__label { font-size: .7rem; font-weight: 700; letter-spacing: .16em; }
.ad-slot__size { font-size: .68rem; opacity: .7; font-variant-numeric: tabular-nums; }

.ad-slot--leaderboard { min-height: 92px; margin: 1.6rem 0; }
.ad-slot--rect { min-height: 280px; max-width: 336px; margin: 0 auto; }
.ad-slot--modal { min-height: 250px; width: 100%; margin-block: .9rem; }
.ad-slot--toast { min-height: 92px; border-style: dashed; }
.ad-slot--inarticle { min-height: 250px; margin: 2rem 0; }
.ad-slot--infeed { min-height: 200px; margin: 1.4rem 0; }
.ad-slot--billboard { min-height: 250px; max-width: 970px; margin: 0 auto 2.4rem; }
.ad-slot--rail { min-height: 600px; }
.ad-slot--rail-sq { min-height: 250px; margin-top: 1rem; }

/* Columna lateral de anuncios: solo cuando de verdad sobra ancho */
.prose-grid { display: grid; gap: 2rem; }
.prose-grid__main { max-width: 68ch; margin-inline: auto; min-width: 0; }
.prose-grid__rail { display: none; }

/* Banda inferior fija (anchor) */
.ad-anchor {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; justify-content: center;
  padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: saturate(160%) blur(8px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(11, 31, 51, .13);
  animation: anchorIn .35s var(--ease-out) both;
}
.ad-anchor__close {
  position: absolute; top: -13px; right: .7rem;
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line-strong); color: var(--muted);
}
.ad-anchor__close:hover { color: var(--ink); }
.ad-anchor__close svg { width: 14px; height: 14px; }
.ad-slot--anchor { min-height: 52px; width: min(728px, 100%); }
@keyframes anchorIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }

/* Con la banda abierta, el pie y el aviso de esquina se apartan */
.has-anchor body { padding-bottom: 86px; }        /* respaldo; el JS lo mide y lo afina */
.has-anchor .ad-toast { bottom: calc(var(--anchor-h, 86px) + 1.2rem); }

/* Interstitial de descarga */
.ad-modal {
  border: 0; padding: 0; background: none;
  max-width: min(400px, calc(100vw - 2rem)); width: 100%;
  border-radius: var(--radius); box-shadow: var(--shadow-l);
  color: var(--ink);
}
.ad-modal::backdrop { background: rgba(11,31,51,.55); backdrop-filter: blur(3px); }
.ad-modal__in {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.25rem;
}
.ad-modal__close {
  position: absolute; top: .55rem; right: .55rem;
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; color: var(--muted);
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.ad-modal__close:hover { background: var(--surface-2); color: var(--ink); }
.ad-modal__close svg { width: 17px; height: 17px; }
.ad-modal__note { font-size: .92rem; font-weight: 600; text-align: center; }

/* Notificación de esquina */
.ad-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 70;
  width: min(300px, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-l);
  padding: .6rem; padding-top: 1.6rem;
  animation: toastIn .4s var(--ease-out) both;
}
.ad-toast[hidden] { display: none; }
.ad-toast__close {
  position: absolute; top: .3rem; right: .3rem;
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; color: var(--muted);
}
.ad-toast__close:hover { background: var(--surface-2); color: var(--ink); }
.ad-toast__close svg { width: 15px; height: 15px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .field-row--4 { grid-template-columns: repeat(4, 1fr); }
  .compare { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .site-footer__in { grid-template-columns: 1fr auto; align-items: start; }
  .site-footer__legal { grid-column: 1 / -1; }
  .result-grid { grid-template-columns: repeat(4, 1fr); }
  .charts { grid-template-columns: 1.35fr 1fr; align-items: start; }
}

@media (min-width: 960px) {
  .site-nav { display: flex; }
  .tool-card { grid-template-columns: 1.02fr 1fr; }
  .panel--result { order: 0; }                 /* escritorio: resultado a la derecha */
  .tool-card > .panel--form { order: -1; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-box { height: 265px; }
  .chart-box--donut { height: 240px; }
}

@media (min-width: 1280px) {
  .tool-card--gastos { grid-template-columns: 1fr 1.05fr; }
  .prose-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .prose-grid__main { margin-inline: 0; }
  .prose-grid__rail { display: block; position: sticky; top: 5rem; }
  .ad-slot--anchor { min-height: 90px; }
}

/* =============================================================
   9. Impresión — solo el resumen y el cuadro de amortización
   ============================================================= */
@media print {
  .site-header, .site-nav, .ad-slot, .ad-toast, .ad-modal,
  .ad-anchor, .prose-grid__rail,
  .hero__sub, .table-actions, .site-footer__nav,
  .section--alt:not(#cuadro), #graficos, #anticipada, #como-funciona,
  #guia, #faq, .skip-link, .slider, .tweak { display: none !important; }

  html, body { background: #fff !important; color: #000 !important; }
  .section, .hero { padding: 0 0 1rem !important; border: 0 !important; }
  .section--alt { background: #fff !important; }
  .wrap { width: 100% !important; }

  .tool-card { box-shadow: none !important; border: 1px solid #999 !important; page-break-inside: avoid; }
  .panel--result { background: #fff !important; color: #000 !important; border-bottom: 1px solid #999; }
  .result-main__value, .savings__value, .result-grid dd, .compare__big { color: #000 !important; }
  .result-main__label, .result-main__meta, .result-grid dt,
  .savings__label, .savings__break, .data-stamp, .cost-table small { color: #444 !important; }
  .cost-table tbody tr, .savings, .data-stamp { border-color: #ccc !important; }
  .ltv-bar { display: none; }

  .table-scroll { overflow: visible !important; border: 0 !important; box-shadow: none !important; }
  .amort { min-width: 0 !important; font-size: 9.5pt; }
  .amort thead th { position: static; background: #eee !important; color: #000 !important; }
  .amort__month { background: #fafafa !important; }
  .amort tbody tr { page-break-inside: avoid; }
  .amort__year { page-break-after: avoid; }
  .disclaimer { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; }

  a[href]::after { content: ""; }
  @page { margin: 14mm; }
}

/* =============================================================
   10. Reduced motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ad-toast, .ad-anchor { animation: none; }
  .ltv-bar__fill { transition: none; }
}
