/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1a1d1f;
  --text-muted: #5b6166;
  --border: #e4e1da;
  --accent: #0f6e5c;
  --accent-contrast: #ffffff;
  --neto: #0f6e5c;
  --ss: #d9a441;
  --irpf: #c85a4a;
  --radius: 14px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Manrope", var(--sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181a;
    --surface: #1b2124;
    --text: #eef1f0;
    --text-muted: #a3aaad;
    --border: #2c3336;
    --accent: #35b79a;
    --accent-contrast: #0b1210;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.1; font-family: var(--display); letter-spacing: -0.01em; }
::selection { background: var(--accent); color: var(--accent-contrast); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 760px; margin-inline: auto; padding-inline: 1.25rem; }
.muted { color: var(--text-muted); }
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--surface); color: var(--text);
  z-index: 9999; border-radius: 8px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Header / Footer
   ============================================================= */
.site-header { border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--accent); }
.header-row nav a { font-size: .9rem; font-weight: 600; }

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-block: 1.5rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: .875rem; }
.footer-row nav { display: flex; gap: 1rem; }

/* =============================================================
   5. Hero + tool card
   ============================================================= */
.hero { padding-block: 2.25rem 1rem; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); max-width: 22ch; margin-inline: auto; }
.hero-sub { color: var(--text-muted); max-width: 46ch; margin: .75rem auto 1.75rem; font-size: 1.02rem; }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 12px 32px -16px rgba(0,0,0,.12);
}

.field-row { display: flex; gap: .75rem; margin-bottom: .9rem; }
.field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.field-narrow { flex: 0 1 40%; }
.field label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.field input, .field select {
  font: inherit; font-size: 1rem; padding: .65rem .75rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%; margin-top: .4rem;
  background: var(--accent); color: var(--accent-contrast);
  font-weight: 700; font-size: 1.02rem;
  padding: .85rem 1rem; border-radius: 10px;
  transition: transform .2s var(--ease-out), filter .2s var(--ease-out);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.98); }

.btn-text { font-weight: 600; color: var(--accent); font-size: .9rem; margin-top: 1rem; }

.tool-error { display: none; color: var(--irpf); font-weight: 600; margin-top: .75rem; }
.tool-card[data-state="error"] .tool-error { display: block; }
.tool-card[data-state="error"] .tool-result { display: none; }

.tool-result { display: none; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.tool-card[data-state="done"] .tool-result { display: block; }

.result-headline { display: flex; flex-direction: column; gap: .15rem; margin-bottom: 1rem; }
.result-label { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.result-value { font-family: var(--display); font-size: 2.1rem; font-weight: 800; color: var(--accent); }

.result-bar {
  --pct-neto: 60%; --pct-ss: 15%; --pct-irpf: 25%;
  display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border);
}
.result-bar .bar-neto { width: var(--pct-neto); background: var(--neto); }
.result-bar .bar-ss { width: var(--pct-ss); background: var(--ss); }
.result-bar .bar-irpf { width: var(--pct-irpf); background: var(--irpf); }

.bar-legend { display: flex; gap: 1.1rem; list-style: none; padding: 0; margin: .6rem 0 0; font-size: .8rem; color: var(--text-muted); }
.bar-legend li { display: flex; align-items: center; gap: .35rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-neto { background: var(--neto); }
.dot-ss { background: var(--ss); }
.dot-irpf { background: var(--irpf); }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; margin-top: 1.4rem; }
.result-grid > div { display: flex; flex-direction: column; gap: .15rem; }
.result-grid dt { font-size: .78rem; color: var(--text-muted); }
.result-grid dd { font-weight: 700; font-size: 1.05rem; }

.privacy-badge { margin-top: 1.25rem; font-size: .85rem; color: var(--text-muted); }
.limits-note { margin-top: .4rem; font-size: .78rem; color: var(--text-muted); }

.js-off-note { padding: 1rem 1.25rem; background: #fff3cd; color: #664d03; border-radius: 10px; margin: 1rem auto; }

/* =============================================================
   6. Ad slots
   ============================================================= */
.ad-slot {
  min-height: 90px; margin-block: 2rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text-muted); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
}

/* =============================================================
   7. Content sections
   ============================================================= */
.content-block { padding-block: 1.75rem; }
.content-block h2 { font-size: 1.35rem; margin-bottom: .75rem; }
.content-block p { margin-bottom: 1rem; color: var(--text); }
.content-block + .content-block { border-top: 1px solid var(--border); }

.steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }

.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; padding: .2rem .9rem; background: var(--surface); }
.faq-item summary { cursor: pointer; font-weight: 600; padding-block: .75rem; }
.faq-item p { color: var(--text-muted); padding-bottom: .85rem; margin: 0; }

.tools-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.tools-list a { font-weight: 600; color: var(--accent); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .field-row { gap: 1rem; }
}
@media (min-width: 720px) {
  .hero { padding-block: 3.5rem 1.5rem; }
  .result-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 539px) {
  .field-row { flex-direction: column; }
  .field-narrow { flex: 1 1 auto; }
}

/* =============================================================
   9. Reduced motion — solo lo intrusivo (aquí no hay animación intrusiva)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .btn-primary { transition: none; }
}
