/* Calculadora ASER (/aser). Todo va dentro de .aser para no pisar los estilos del sitio. */
.aser {
  --surface: #ffffff; --surface-2: #f3f6f2; --fg: var(--texto); --muted: var(--suave);
  --line: var(--borde); --accent: var(--verde);
  --good: #17703a; --good-bg: #e5f3e9; --bad: var(--rojo-hondo); --bad-bg: #fbeaea;
  --neto: #8fb39a; --prest: var(--rojo); --ex: var(--sol);
  max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; display: grid; gap: 18px;
  font-size: 16px; line-height: 1.5; color: var(--fg);
}
.aser h2, .aser h3 { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 800; text-wrap: balance; }
.aser p { margin: 0; }
.aser .num { font-variant-numeric: tabular-nums; }

.aser .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 14px; }
.aser .panel h2 { font-size: 1.15rem; color: var(--verde-hondo); }
.aser .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

.aser .field { display: grid; gap: 4px; }
.aser .money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.aser .money span { padding-left: 10px; color: var(--muted); }
.aser .money input, .aser .rowname { border: 0; background: transparent; color: var(--fg); font: inherit; padding: 9px 10px; width: 100%; min-width: 0; }
.aser .money input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.aser .loans { display: grid; gap: 8px; }
.aser .loan { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,150px) auto; gap: 8px; align-items: center; }
.aser .loan .rowname { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.aser .icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; font-size: 20px; line-height: 1; }
.aser .icon-btn:hover { color: var(--bad); border-color: var(--bad); }
.aser .btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.aser .btn { border: 2px solid var(--accent); color: var(--accent); background: transparent; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.aser .btn:hover { background: var(--surface-2); }
.aser .btn.ghost { border-color: var(--line); color: var(--muted); font-weight: 600; }
.aser .as-total { font-weight: 700; }
.aser .as-total b { color: var(--bad); }

.aser .slider { display: grid; grid-template-columns: minmax(0,1fr) 76px; gap: 12px; align-items: center; }
.aser input[type=range] { width: 100%; accent-color: var(--verde-vivo); }
.aser .pct { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.aser .pct input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-weight: 700; text-align: right; padding: 8px 4px 8px 8px; }
.aser .pct span { padding-right: 8px; color: var(--muted); }

/* Barra */
.aser .bar-wrap { position: relative; padding-top: 22px; }
.aser .bar { position: relative; height: 34px; border-radius: 8px; overflow: hidden; display: flex; background: var(--surface-2); }
.aser .bar .seg { height: 100%; transition: width .25s ease; }
.aser .seg.neto { background: var(--neto); }
.aser .seg.prest { background: var(--prest); }
.aser .marker { position: absolute; top: 18px; bottom: -4px; width: 0; border-left: 3px dashed var(--fg); transition: left .25s ease; }
.aser .marker-label { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; font-weight: 700; white-space: nowrap; transition: left .25s ease; }
.aser .legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.aser .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.aser .c-neto { background: var(--neto); }
.aser .c-prest { background: var(--prest); }
.aser .c-ex { background: var(--ex); }

.aser .calc { display: grid; gap: 6px; }
.aser .calc .r { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding: 5px 0; }
.aser .calc .r:last-child { border-bottom: 0; }
.aser .calc .r span:first-child { color: var(--muted); }
.aser .calc .r strong { font-variant-numeric: tabular-nums; text-align: right; }

.aser .result { background: var(--good-bg); border: 2px solid var(--verde-vivo); border-radius: 12px; padding: 20px; display: grid; gap: 6px; text-align: center; }
.aser .result.none { background: var(--surface-2); border-color: var(--line); }
.aser .result .big { font-family: var(--display); font-size: 3rem; font-weight: 900; line-height: 1.05; color: var(--good); }
.aser .result.none .big { color: var(--muted); }
.aser .result .final { font-size: 1.05rem; font-weight: 700; }

.aser .scen { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.aser .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.aser .card h3 { font-size: 1.02rem; }
.aser .delta { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.aser .delta.up { background: var(--good-bg); color: var(--good); }
.aser .delta.down { background: var(--bad-bg); color: var(--bad); }
.aser .delta.same { background: var(--surface-2); color: var(--muted); }
.aser .card .val { font-family: var(--display); font-size: 2.1rem; font-weight: 900; line-height: 1.05; }
.aser .card p { font-size: 13px; color: var(--muted); }

/* Explicado fácil */
.aser .easy-intro { font-size: 1.08rem; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.aser .legend--col { flex-direction: column; gap: 6px; margin-top: 10px; }
.aser .step__t { font-weight: 800; color: var(--verde-hondo); }
.aser .ejemplo { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.aser .ejemplo summary { cursor: pointer; font-weight: 700; color: var(--verde-hondo); }
.aser .ejemplo__pasos { margin: 10px 0 2px; padding-left: 22px; display: grid; gap: 6px; }
.aser .glosario { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 0; }
.aser .glosario div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.aser .glosario dt { font-weight: 800; }
.aser .glosario dd { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.aser .easy { gap: 18px; }
.aser .easy-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.aser .squares { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; width: 100%; }
.aser .sq { aspect-ratio: 1; border-radius: 3px; background: var(--neto); transition: background .25s ease; }
.aser .sq.ok { background: var(--prest); }
.aser .sq.ex { background: var(--ex); }
.aser .sq-cap { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.aser .steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.aser .step { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; align-items: start; }
.aser .step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); }
.aser .step b.big { font-size: 1.3rem; display: block; }
.aser .step p { margin-top: 2px; }
.aser .chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.aser .sum { background: var(--good-bg); border-radius: 10px; padding: 14px; text-align: center; }
.aser .sum strong { font-family: var(--display); font-size: 2rem; font-weight: 900; line-height: 1.1; color: var(--good); display: block; margin-top: 4px; }
.aser .foot { font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 620px) {
  .aser .scen, .aser .easy-grid, .aser .glosario { grid-template-columns: 1fr; }
  .aser .squares { max-width: 300px; margin: 0 auto; }
  .aser .loan { grid-template-columns: minmax(0,1fr) minmax(0,120px) auto; }
}
@media (prefers-reduced-motion: reduce) { .aser .bar .seg, .aser .marker, .aser .marker-label, .aser .sq { transition: none; } }

/* Video y guía de uso */
.aser .video__v { width: 100%; max-width: 360px; height: auto; margin: 0 auto; display: block; border-radius: 14px; background: #123b22; }
.aser .video__nota { font-size: 14px; color: var(--muted); text-align: center; }
.aser .guia__lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.aser .guia__paso { display: grid; gap: 8px; align-content: start; background: var(--surface-2); border-radius: 12px; padding: 14px; }
.aser .guia__t { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--verde-hondo); font-size: 1.05rem; }
.aser .guia__t .n { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sol); color: var(--verde-hondo); }
.aser .guia__paso img { width: 100%; max-width: 380px; margin: 4px auto 0; border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 620px) { .aser .guia__lista { grid-template-columns: 1fr; } }
