/* ===== Cuentas Claras — estilos ===== */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --text: #101a17;
  --muted: #5b6863;
  --line: #e1e7e4;
  --accent: #0b7a5c;
  --accent-2: #12a07a;
  --accent-soft: #e4f4ee;
  --accent-ink: #075e47;
  --warn: #a35a00;
  --warn-soft: #fff4e5;
  --ok: #0b7a5c;
  --shadow: 0 1px 2px rgba(16, 26, 23, .04), 0 4px 16px rgba(16, 26, 23, .06);
  --shadow-lg: 0 2px 4px rgba(16, 26, 23, .04), 0 12px 32px rgba(16, 26, 23, .10);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1210;
    --surface: #141c19;
    --surface-2: #19231f;
    --text: #e9efec;
    --muted: #97a59f;
    --line: #26322e;
    --accent: #34c79c;
    --accent-2: #5fdcb6;
    --accent-soft: #123128;
    --accent-ink: #8ff0cf;
    --warn: #f3b55c;
    --warn-soft: #33260f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.page { max-width: 760px; }

/* ===== Encabezado ===== */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -.03em; text-decoration: none; color: var(--text); }
.logo-txt b { font-weight: inherit; color: var(--accent); }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.logo-mark svg { width: 19px; height: 19px; }
.menu { display: flex; gap: 4px; }
.menu a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.menu a:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 720px) { .menu { display: none; } }

/* ===== Portada ===== */
.hero {
  background:
    radial-gradient(900px 380px at 85% -10%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    radial-gradient(700px 300px at -10% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  padding: 56px 0 36px; border-bottom: 1px solid var(--line);
}
.eyebrow { display: inline-block; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(34px, 8vw, 58px); line-height: 1.04; letter-spacing: -.045em; margin: 0 0 16px; font-weight: 800; }
.hero h1 span { color: var(--accent); }
.hero .lead { max-width: 620px; font-size: clamp(16px, 2.4vw, 19px); }
.search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin-top: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; padding: 14px 0; outline: none; box-shadow: none; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips a { font-size: 13px; font-weight: 500; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 8px; }
.features > div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.features svg { grid-row: span 2; width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.features strong { font-size: 15px; }
.features span { font-size: 14px; color: var(--muted); line-height: 1.4; }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }

.cat { margin-top: 36px; }
.cat-head { margin-bottom: 14px; }
.cat-head h2 { margin: 0; font-size: 22px; }
.cat-head p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.home-text { margin: 48px 0 8px; max-width: 760px; }

/* ===== Tarjetas ===== */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
a.tile {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tile-ico { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tile-ico .ico { width: 24px; height: 24px; }
.tile-txt { flex: 1; min-width: 0; }
.tile-txt strong { display: block; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.tile-txt span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.tile-arrow { width: 18px; height: 18px; color: var(--muted); flex: none; transition: transform .15s ease, color .15s ease; }
a.tile:hover .tile-arrow { transform: translateX(3px); color: var(--accent); }

/* ===== Páginas de calculadora ===== */
main { min-height: 60vh; }
.page { padding-top: 20px; padding-bottom: 40px; }
.crumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
h1 { font-size: clamp(28px, 6vw, 38px); line-height: 1.12; letter-spacing: -.035em; margin: 10px 0 8px; font-weight: 800; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.02em; margin: 36px 0 10px; }
h3 { font-size: 17px; margin: 22px 0 4px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 22px; font-size: 17px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.calc { display: grid; gap: 16px; }
.calc-title { margin: 0; font-size: 18px; }
.row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } .card { padding: 18px; } }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 16px; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.result {
  background: linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 16px; padding: 20px;
}
.result.mini { padding: 16px; }
.result .label { font-size: 14px; font-weight: 500; color: var(--accent-ink); }
.result .big { font-size: clamp(30px, 8vw, 44px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.result.mini .big { font-size: clamp(26px, 6vw, 34px); }
.result p { margin: 10px 0 0; }
table.detail { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
table.detail td, table.detail th { padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)); }
table.detail th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); }
table.detail td:last-child, table.detail th:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.detail td + td:not(:last-child), table.detail th + th:not(:last-child) { text-align: right; padding-right: 12px; font-variant-numeric: tabular-nums; }
table.detail tr.total td { font-weight: 700; }
details.tabla { margin-top: 14px; }
details.tabla summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent-ink); }
details.tabla table { font-size: 14px; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.result .note.warn, .note.warn { color: var(--warn); }

.article { margin-top: 8px; }
.article p, .article li { color: var(--text); }
.article li { margin: 4px 0; }
.article em { font-style: normal; font-weight: 500; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

.faq { margin-top: 12px; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
.faq details summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
details p { margin: 8px 0 0; color: var(--muted); }

.related { margin-top: 40px; }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.ad { margin: 24px 0; }
.ad:empty { display: none; }

.rates { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 12px; }
.rate { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); box-shadow: var(--shadow); }
.rate b { display: block; font-size: 20px; color: var(--text); letter-spacing: -.02em; }

/* ===== Pie ===== */
footer.bottom { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); padding: 36px 0 28px; font-size: 14px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 2fr 1fr; gap: 28px; }
.foot-grid h3 { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 4px 0; }
.foot-list { columns: 2; column-gap: 20px; }
footer.bottom a { color: var(--muted); text-decoration: none; }
footer.bottom a:hover { color: var(--accent); }
footer.bottom .logo { color: var(--text); }
footer.bottom .logo-txt b { font-weight: inherit; color: var(--accent); }
.legal { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; gap: 22px; } }
.foot-grid h3.mt { margin-top: 18px; }
.big-table { font-size: 14px; }
.big-table td:first-child { font-weight: 600; }
.big-table { display: block; overflow-x: auto; }
.big-table td, .big-table th { white-space: normal !important; vertical-align: top; padding-right: 10px; }
.big-table td:last-child, .big-table th:last-child { padding-right: 0; }

/* ===== Compartir ===== */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 28px 0 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.share > span { flex: 1 1 160px; font-weight: 600; font-size: 15px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn.wa:hover { background: #188046; color: #fff; }
.split-out li { margin: 4px 0; }
