/* Nómina Clara. Shape rule: buttons pill, cards 16px, inputs 10px. One accent: deep green. */
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --bg: #f2f4f3; --surface: #fbfcfc; --surface-2: #e8ecea; --field: #ffffff;
  --ink: #121816; --muted: #55615c; --line: #d8dedb; --line-strong: #b4beb9;
  --accent: #0b6e51; --accent-hover: #095c44; --accent-ink: #f4fbf8; --accent-text: #0a6449;
  --seg-1: #0b6e51; --seg-2: #6f8c82; --seg-3: #a9b9b2; --seg-4: #d3ddd8;
  --danger: #b42318; --r-s: 10px; --r-m: 16px; --r-btn: 999px;
  --shadow: 0 24px 60px -28px rgb(16 46 36 / .35), 0 2px 6px rgb(16 46 36 / .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c100f; --surface: #131917; --surface-2: #101614; --field: #0e1412;
    --ink: #e7edea; --muted: #98a6a0; --line: #222b28; --line-strong: #34413c;
    --accent: #3dbd8d; --accent-hover: #59cfa2; --accent-ink: #04130d; --accent-text: #63d5a9;
    --seg-1: #3dbd8d; --seg-2: #4d6b61; --seg-3: #34473f; --seg-4: #24302b;
    --danger: #f97066; --shadow: 0 24px 60px -24px rgb(0 0 0 / .7);
  }
}
.lg-bg { fill: var(--accent); } .lg-fg { fill: var(--accent-ink); }

/* ------------------------------------------------------------------ hero calculator */
.calc { padding-block: 32px 24px; }
@media (min-width: 1024px) { .calc { padding-block: 56px 40px; } }
.calc-grid { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .calc-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; } }
.calc h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.035em; font-weight: 700; margin-bottom: .35em; }
.calc h1 em { font-style: normal; color: var(--accent-text); }
.calc-lead { color: var(--muted); font-size: 1.08rem; max-width: 46ch; margin-bottom: 28px; }
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.bruto input { font-family: var(--f-mono); font-size: 1.5rem; min-height: 62px; font-weight: 500; letter-spacing: -0.02em; }
.slider { margin-top: 2px; }
.more { border-top: 1px solid var(--line); padding-top: 16px; }
.more summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; min-height: 32px; }
.more summary::-webkit-details-marker { display: none; }
.more summary .i { transition: transform .3s cubic-bezier(.16,1,.3,1); }
.more[open] summary .i { transform: rotate(180deg); }
.more .form { margin-top: 16px; }
.stepper { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--field); min-height: 50px; }
.stepper button { height: 100%; min-height: 48px; background: none; border: 0; cursor: pointer; font-size: 1.3rem; color: var(--muted); }
.stepper button:hover { color: var(--ink); }
.stepper output { text-align: center; font-family: var(--f-mono); font-size: 1.05rem; }

/* result panel */
.result { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 1024px) { .result { position: sticky; top: 88px; padding: 32px; } }
.result-label { color: var(--muted); font-size: .95rem; margin: 0; }
.big { font-family: var(--f-mono); font-size: clamp(3rem, 9vw, 5.2rem); line-height: 1; letter-spacing: -0.05em; font-weight: 500; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.big-sub { color: var(--muted); margin: 0 0 22px; min-height: 1.6em; }
.flow { display: flex; height: 18px; border-radius: 999px; overflow: hidden; gap: 3px; margin-bottom: 18px; }
.flow span { flex-basis: 0; min-width: 0; transition: flex-grow .7s cubic-bezier(.16,1,.3,1); }
.flow .f-neto { background: var(--seg-1); } .flow .f-irpf { background: var(--seg-2); } .flow .f-ss { background: var(--seg-3); } .flow .f-emp { background: var(--seg-4); }
.legend { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; font-size: .95rem; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend .pct { color: var(--muted); font-family: var(--f-mono); font-size: .85rem; min-width: 4.2em; text-align: right; }
.legend .amt { font-family: var(--f-mono); min-width: 6.5em; text-align: right; }
.legend li.total { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kpis div { background: var(--surface); padding: 12px 14px; }
.kpis dt { font-size: .78rem; color: var(--muted); }
.kpis dd { margin: 2px 0 0; font-family: var(--f-mono); font-size: 1.05rem; }
.steps { margin-top: 18px; font-size: .92rem; }
.steps summary { cursor: pointer; color: var(--accent-text); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.steps ol { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: s; }
.steps li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.steps li span:last-child { font-family: var(--f-mono); white-space: nowrap; }
.note-exento { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: .9rem; }

/* ------------------------------------------------------------------ sections */
.sec { padding-block: 72px 0; }
.sec h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -0.03em; max-width: 22ch; }
.sec-lead { color: var(--muted); max-width: 62ch; margin-bottom: 28px; }
.ref-table td:first-child { font-weight: 600; }
.ref-table tbody tr { transition: background .2s; }
.ref-table tbody tr:hover { background: var(--surface-2); }

/* insights bento: 1 wide + 3 */
.bento { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .bento { grid-template-columns: repeat(6, 1fr); } .b-wide { grid-column: span 4; } .b-tall { grid-column: span 2; grid-row: span 2; } .b-half { grid-column: span 2; } }
.b { border-radius: var(--r-m); padding: 26px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.b .fig { font-family: var(--f-mono); font-size: clamp(2.2rem, 4vw, 3.2rem); letter-spacing: -0.04em; line-height: 1; }
.b p { margin: 0; color: var(--muted); }
.b strong { color: var(--ink); font-weight: 600; }
.b-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.b-accent p, .b-accent strong { color: var(--accent-ink); }
.b-tall { background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); justify-content: flex-end; }
.b-grid { background-image: radial-gradient(var(--line-strong) 1px, transparent 1px); background-size: 14px 14px; background-color: var(--surface); }

/* guide index rows */
.guides { display: grid; border-top: 1px solid var(--line); }
.guides a { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center; padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .3s cubic-bezier(.16,1,.3,1), background .3s; }
.guides a:hover { padding-left: 14px; background: var(--surface); }
.guides h3 { font-size: 1.25rem; margin: 0; }
.guides p { grid-column: 1; margin: 0; color: var(--muted); font-size: .95rem; }
.guides .i { grid-row: 1 / span 2; grid-column: 2; width: 22px; height: 22px; color: var(--accent-text); transition: transform .3s; }
.guides a:hover .i { transform: translate(3px, -3px); }

.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.faq summary { cursor: pointer; padding: 18px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { transition: transform .3s cubic-bezier(.16,1,.3,1); flex: none; }
.faq details[open] summary .i { transform: rotate(45deg); }
.faq details > div { padding: 0 20px 18px; color: var(--muted); }

/* ------------------------------------------------------------------ article pages */
.article { padding-block: 48px 0; }
.article-head { max-width: 760px; margin-bottom: 36px; }
.article-head h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); letter-spacing: -0.035em; }
.article-head p { color: var(--muted); font-size: 1.12rem; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.callout { border-left: 3px solid var(--accent); padding: 14px 18px; background: var(--surface); border-radius: 0 12px 12px 0; margin: 1.5em 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.formula { font-family: var(--f-mono); font-size: .92rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; white-space: pre; line-height: 1.7; }

/* entrance for the hero: headline then panel */
@media (prefers-reduced-motion: no-preference) {
  .calc h1, .calc-lead, .form, .result { animation: rise .8s cubic-bezier(.16,1,.3,1) both; }
  .calc-lead { animation-delay: .06s; } .form { animation-delay: .12s; } .result { animation-delay: .18s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

@media (max-width: 480px) {
  .result { padding: 20px; }
  .legend li { grid-template-columns: 12px 1fr auto; }
  .legend .pct { display: none; }
  .kpis div { padding: 10px; }
  .kpis dd { font-size: .95rem; }
}

/* finiquito breakdown */
.fin-lines { list-style: none; margin: 0 0 18px; padding: 0; display: grid; }
.fin-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.fin-lines li small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.fin-lines .amt { font-family: var(--f-mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-lines li.neg .amt { color: var(--danger); }
.result .help { margin: 12px 0 0; }
