/* ==========================================================================
   SueldoLimpio — estilos
   1. Variables  2. Base  3. Cabecera  4. Hero  5. Calculadora  6. Resultado
   7. Anuncios  8. Contenido  9. FAQ  10. Pie  11. Responsive
   ========================================================================== */

/* 1. Variables ------------------------------------------------------------ */
:root {
  --bg: #f5f4ef;
  --bg-2: #ecebe4;
  --card: #ffffff;
  --ink: #15233f;
  --ink-2: #4a5568;
  --ink-3: #7a8494;
  --line: #e2e0d8;
  --accent: #0b7f58;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3ec;
  --ss: #4f6fd1;
  --irpf: #e3a21a;
  --danger: #b4372c;
  --warn-bg: #fff6e0;
  --warn-ink: #7a5300;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 35, 63, .05), 0 8px 28px rgba(21, 35, 63, .07);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1522; --bg-2: #151d2d; --card: #182134; --ink: #eef1f6; --ink-2: #b8c0cf;
    --ink-3: #8a94a7; --line: #283349; --accent: #2fbf86; --accent-ink: #062016;
    --accent-soft: #143528; --ss: #7f98ec; --irpf: #f0b93d; --warn-bg: #3a2e12; --warn-ink: #f4d58a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
  }
}

/* 2. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* 3. Cabecera ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo svg { flex: none; }
.logo b { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .93rem; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* 4. Hero ----------------------------------------------------------------- */
.hero { padding: 26px 0 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); font-weight: 800; margin-bottom: 6px; }
.hero p { color: var(--ink-2); font-size: 1.04rem; max-width: 62ch; margin: 0; }

/* 5. Calculadora ---------------------------------------------------------- */
.tool {
  display: grid; gap: 20px; align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  grid-template-areas: "main result" "more result";
  grid-template-rows: auto 1fr;
}
.tool-main { grid-area: main; }
.tool-more { grid-area: more; }
.tool-result { grid-area: result; position: sticky; top: 78px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.noscript { padding: 14px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.hint { display: block; color: var(--ink-3); font-size: .82rem; font-weight: 500; margin-top: 5px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type="text"], input[type="number"], input[type="date"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.money { position: relative; }
.money input { font-size: 1.6rem; font-weight: 800; padding: 12px 44px 12px 14px; min-height: 62px; letter-spacing: -.01em; }
.money .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 1.3rem; color: var(--ink-3); pointer-events: none; }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--ink-2); transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); }
.seg-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 12px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; flex: none; }

details.more { padding: 0; }
details.more > summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary small { display: block; font-weight: 500; color: var(--ink-3); font-size: .84rem; }
details.more > summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--accent); transition: transform .2s; }
details.more[open] > summary::after { transform: rotate(45deg); }
details.more .more-body { padding: 0 22px 22px; border-top: 1px solid var(--line); padding-top: 18px; }

.privacy { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: .85rem; margin-top: 12px; }

/* 6. Resultado ------------------------------------------------------------ */
.result-label { color: var(--ink-2); font-weight: 700; font-size: .9rem; margin: 0; }
.big { font-size: clamp(2.5rem, 7vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.big small { font-size: .4em; color: var(--ink-3); font-weight: 700; letter-spacing: 0; }
.sub { color: var(--ink-2); font-size: .95rem; margin: 0 0 16px; }
.sub strong { color: var(--ink); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--bg); border-radius: var(--radius-sm); padding: 11px 13px; }
.kpi span { display: block; font-size: .78rem; color: var(--ink-3); font-weight: 700; }
.kpi strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--bg-2); margin: 6px 0 10px; }
.bar i { display: block; height: 100%; transition: width .35s ease; }
.bar .b-neto { background: var(--accent); }
.bar .b-ss { background: var(--ss); }
.bar .b-irpf { background: var(--irpf); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--ink-2); margin: 0 0 16px; padding: 0; list-style: none; }
.legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

.breakdown { width: 100%; border-collapse: collapse; font-size: .93rem; font-variant-numeric: tabular-nums; }
.breakdown td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.breakdown td:last-child { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 12px; }
.breakdown tr.total td { border-bottom: 0; font-weight: 800; font-size: 1rem; padding-top: 12px; }
.breakdown tr.minus td:last-child { color: var(--danger); }
.breakdown tr.sec td { font-weight: 800; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding-top: 16px; }
.breakdown td small { color: var(--ink-3); display: block; font-size: .78rem; }

.notes { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.notes li { font-size: .86rem; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-2); }
.notes li.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notes li.ok { background: var(--accent-soft); color: var(--ink); }
.disclaimer { font-size: .78rem; color: var(--ink-3); margin: 14px 0 0; }
.cross { display: block; margin-top: 14px; padding: 12px 14px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); font-weight: 700; font-size: .92rem; text-decoration: none; }
.cross:hover { border-color: var(--accent); background: var(--accent-soft); }

.tramos { width: 100%; border-collapse: collapse; font-size: .93rem; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.tramos th, .tramos td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.tramos th { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tramos td:nth-child(n+2) { text-align: right; font-weight: 700; }
.tramos th:nth-child(n+2) { text-align: right; }

.error-box { padding: 14px; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-sm); font-weight: 600; }

/* 7. Anuncios (huecos reservados) ----------------------------------------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center; margin: 28px auto;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127,127,127,.04) 10px 20px);
  color: var(--ink-3); font-size: .75rem; font-weight: 800; letter-spacing: .2em;
}
.ad-leaderboard { min-height: 100px; max-width: 970px; }
.ad-incontent { min-height: 250px; max-width: 728px; }

/* 8. Contenido ------------------------------------------------------------ */
.section { padding: 40px 0; }
.section + .section { padding-top: 10px; }
.lead { color: var(--ink-2); max-width: 70ch; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; padding: 0; margin: 20px 0 0; list-style: none; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 12px; }
.steps p { color: var(--ink-2); margin: 0; font-size: .95rem; }
.prose { max-width: 74ch; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 18px 0; }
.data { width: 100%; border-collapse: collapse; font-size: .94rem; font-variant-numeric: tabular-nums; min-width: 520px; }
.data th, .data td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); }
.data th:first-child, .data td:first-child { text-align: left; }
.data thead th { background: var(--bg); font-size: .8rem; color: var(--ink-2); }
.data tbody tr:last-child > * { border-bottom: 0; }
.data a { font-weight: 700; text-decoration: none; }
.caption { font-size: .82rem; color: var(--ink-3); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.tool-link { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-link strong { display: block; font-size: 1.05rem; margin: 10px 0 4px; }
.tool-link span { color: var(--ink-2); font-size: .92rem; }
.tool-link .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tool-link.soon { opacity: .6; pointer-events: none; }

/* 9. FAQ ------------------------------------------------------------------ */
.faq { max-width: 820px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: var(--ink-2); }
.faq details > div p:last-child { margin: 0; }

/* 10. Pie ----------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 40px; color: var(--ink-3); font-size: .88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.legal-page .prose { padding: 30px 0; }
.todo { background: var(--warn-bg); color: var(--warn-ink); padding: 0 4px; border-radius: 4px; }

/* 11. Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .tool { grid-template-columns: 1fr; grid-template-areas: "main" "result" "more"; }
  .tool-result { position: static; }
  .steps, .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .card { padding: 18px; }
  details.more > summary { padding: 16px 18px; }
  details.more .more-body { padding: 16px 18px 18px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .row .field { margin-bottom: 16px; }
  .row.row-keep { grid-template-columns: 1fr 1fr; gap: 12px; }
  .row.row-keep .field { margin-bottom: 0; }
  .hero { padding: 18px 0 12px; }
  .hero p { font-size: .97rem; }

  .site-header .wrap { height: 56px; }
  .nav a { padding: 6px 9px; font-size: .85rem; }
  .ad-incontent { min-height: 200px; }
}
@media (max-width: 430px) {
  .logo > span { display: none; }
}
@media print {
  .site-header, .ad-slot, .tool-more, .site-footer, .cards { display: none !important; }
}
