/* =============================================================
   Cuentas Claras — styles.css
   1. Tokens · 2. Reset · 3. Layout · 4. Componentes · 5. Calculadoras · 6. Responsive
   ============================================================= */
:root {
  --bg: #f3f5fa;
  --paper: #ffffff;
  --ink: #14213d;
  --muted: #5b6478;
  --line: #dde2ee;
  --green: #14213d;
  --green-2: #23365f;
  --lime: #ffc53d;
  --amber: #e8a33d;
  --red: #c2412d;
  --radius: 18px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Bricolage Grotesque", var(--sans);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.6; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
a { color: var(--green); text-underline-offset: 3px; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.1; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--ink); color: #fff; z-index: 99; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.container { width: min(100% - 32px, 1040px); margin-inline: auto; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.logo { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.1rem; flex: none; }
.logo i { font-family: var(--serif); font-style: normal; font-weight: 800; font-size: 1.15rem; color: #e39a00; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green); }
.logo-mark svg { width: 20px; height: 20px; fill: none; stroke: var(--lime); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: .45rem .75rem; border-radius: 999px; font-size: .9rem; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--bg); }
.nav a[aria-current] { color: #fff; background: var(--green); }

/* Hero */
.hero { padding: 2rem 0 1.2rem; }
.hero h1 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.03em; font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.8rem); letter-spacing: -0.01em; }
.lead { color: var(--muted); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); max-width: 60ch; margin-top: .4rem; }

/* Tool card */
.tool-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 28px); box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 18px 40px -28px rgba(20,33,61,.35); }
.grid-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-form .check { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; min-width: 0; }
.money input { width: 100%; }
.field small { color: var(--muted); font-weight: 500; }
.money { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.money:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,33,61,.12); }
.money input { flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; border: 0; background: none; font-size: 1.15rem; font-weight: 600; outline: none; font-variant-numeric: tabular-nums; }
.money i { font-style: normal; color: var(--muted); padding-right: 14px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: center; font-size: .9rem; min-height: 48px; cursor: pointer; align-self: end; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .88rem; }
.chip:hover { border-color: var(--green); }
.chip.is-on { background: var(--green); border-color: var(--green); color: #fff; }

/* Result */
.result { margin-top: 20px; }
.result:empty { display: none; }
.res-main { display: grid; gap: 4px; padding: 18px 20px; border-radius: 14px; background: var(--green); color: #fff; }
.res-main small { color: rgba(255,255,255,.75); font-size: .85rem; }
.res-main .big { font-family: var(--serif); font-weight: 800; font-size: clamp(2.4rem, 1.6rem + 4vw, 3.6rem); line-height: 1; color: var(--lime); font-variant-numeric: tabular-nums; }
.res-main p { color: rgba(255,255,255,.9); font-size: .95rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat small { display: block; color: var(--muted); font-size: .8rem; }
.stat b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.warn { margin-top: 10px; padding: 12px 14px; border-radius: 12px; font-size: .92rem; border: 1px solid; }
.warn.bad { background: #fbeee9; border-color: #efc5b9; color: #7a2a1c; }
.warn.ok { background: #eef6e4; border-color: #cfe5b4; color: #2f5512; }
.warn.mid { background: #fdf4e3; border-color: #f0d9a8; color: #6b4a10; }
.nojs { color: var(--red); font-weight: 600; }

/* Chart */
.chart { margin-top: 18px; }
.chart:empty { display: none; }
.chart svg { width: 100%; height: auto; }
.chart .ax { stroke: var(--line); }
.chart text { fill: var(--muted); font: 500 11px var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

/* Tablas */
.table-wrap, .sub { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.table-wrap summary, .sub summary { cursor: pointer; font-weight: 600; color: var(--green); }
.tbl-scroll { overflow-x: auto; margin-top: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--muted); font-weight: 600; background: var(--bg); }
.sub .grid-form { margin-top: 12px; }

.privacy { color: var(--muted); font-size: .86rem; margin: 12px 4px 0; }
.ad-slot { display: grid; place-items: center; min-height: 100px; margin: 28px 0; border: 1px dashed #c9d0e0; border-radius: 12px; background: rgba(255,255,255,.4); }
.ad-slot.ad-in-content { min-height: 250px; }
.ad-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #8a93a8; }

/* Secciones */
.section { margin: 44px 0; }
.section h2 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); margin-bottom: .8rem; }
.prose { max-width: 70ch; }
.prose p { margin-bottom: 1rem; }
.prose h3 { margin: 1.4rem 0 .5rem; font-size: 1.1rem; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; }
.faq details p { padding: 0 16px 16px; color: var(--muted); }
.tool-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tool-link { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .2s var(--ease), border-color .2s; }
.tool-link:hover { transform: translateY(-2px); border-color: var(--green); }
.tool-link small { display: block; color: var(--muted); font-size: .85rem; }
.tl-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff3d6; }
.tl-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.post.legal { padding-top: 1.6rem; max-width: 72ch; }
.post.legal h1 { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; margin-bottom: 1rem; }
.post.legal h2 { margin-top: 1.4rem; font-size: 1.2rem; }
.post.legal p { margin-bottom: .8rem; }

.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 0 36px; background: var(--paper); }
.footer-inner { display: grid; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.disclaimer { color: var(--muted); font-size: .8rem; max-width: 90ch; }


@media (min-width: 960px) { .grid-form { grid-template-columns: repeat(3, 1fr); } .grid-form .check { grid-column: auto; } }
@media (max-width: 400px) { .money input { font-size: 1.05rem; padding: 0 10px; } .money i { padding-right: 10px; } .field { font-size: .82rem; } }
@media (max-width: 719px) {
  .header-inner { flex-wrap: wrap; padding: 8px 0; min-height: 0; }
  .nav { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.sel { min-height: 50px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 1rem; font-weight: 600; width: 100%; }
.tl-icon svg { stroke: #14213d; }
[hidden] { display: none !important; }
