/* ── Base ─────────────────────────────────────────────────────────────────── */
:root {
  --brand: #0f766e;
  --brand-d: color-mix(in srgb, var(--brand) 80%, #000);
  --brand-50: color-mix(in srgb, var(--brand) 8%, #fff);
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --bg: #f6f7fb; --card: #fff;
  --wa: #15803d; --wa-d: #166534;
  --r: 14px; --r-sm: 10px;
  --sh: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Encabezado y pie ─────────────────────────────────────────────────────── */
.top { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.logo svg { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 7px 10px; border-radius: 9px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand); }
.menu-btn { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; font-size: 18px; cursor: pointer; }

.foot { background: #0f172a; color: #cbd5e1; margin-top: 64px; padding: 40px 18px 28px; font-size: 14.5px; }
.foot-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot a { color: #e2e8f0; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot h4 { color: #fff; margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot .logo { color: #fff; }
.foot-legal { max-width: 1180px; margin: 26px auto 0; padding-top: 18px; border-top: 1px solid #1e293b; font-size: 13px; color: #94a3b8; }

main { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ── Héroe ────────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 30px 0 20px; max-width: 860px; margin: 0 auto; }
.hero h1 { font-size: clamp(27px, 4.2vw, 42px); margin: 0 0 12px; font-weight: 850; }
.hero h1 span { color: var(--brand); }
.hero p { font-size: clamp(16px, 2vw, 19px); color: var(--ink-2); margin: 0 auto; max-width: 720px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.pills li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.crumbs { font-size: 13.5px; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }

/* ── Formularios y botones ────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.full { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span:first-child, fieldset.fld legend { font-size: 12.5px; font-weight: 650; color: var(--muted); }
fieldset.fld { border: 0; padding: 0; margin: 0; }
fieldset.fld legend { padding: 0; margin-bottom: 6px; }
input, select { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #cbd5e1; border-radius: var(--r-sm); padding: 9px 11px; width: 100%; min-width: 0; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.money-in { display: flex; align-items: center; border: 1px solid #cbd5e1; border-radius: var(--r-sm); background: #fff; }
.money-in i { font-style: normal; color: var(--muted); padding-left: 11px; }
.money-in input { border: 0; padding-left: 6px; }
.money-in input:focus { box-shadow: none; }
.money-in:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radios label { display: flex; align-items: center; gap: 7px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 13px; cursor: pointer; font-weight: 600; font-size: 15px; background: #fff; }
.radios input { width: auto; }
.radios label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.extra summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--brand); }
.extra[open] summary { margin-bottom: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 750; font-size: 15.5px; cursor: pointer; text-decoration: none; border: 1px solid transparent; line-height: 1.2; text-align: center; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-pri { background: var(--brand); color: #fff; }
.btn-pri:hover { background: var(--brand-d); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-d); }
.btn-sec { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn-sec:hover { border-color: var(--brand); color: var(--brand); }

/* ── Calculadora ──────────────────────────────────────────────────────────── */
.calc { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--sh); max-width: 900px; margin: 0 auto; min-height: 260px; }
.calc-loading { padding: 50px 0; text-align: center; color: var(--muted); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px 14px; }
.calc-out { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 18px; }
.calc-empty { color: var(--muted); text-align: center; padding: 14px 0; }
.calc-total { background: var(--brand); color: #fff; border-radius: 14px; padding: 16px 18px; display: grid; gap: 2px; }
.calc-total span { font-size: 14px; opacity: .92; font-weight: 600; }
.calc-total b { font-size: clamp(30px, 6vw, 40px); letter-spacing: -.02em; line-height: 1.1; }
.calc-total small { opacity: .92; font-size: 14px; }
.calc-tbl { width: 100%; border-collapse: collapse; margin-top: 12px; }
.calc-tbl td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.calc-tbl td b { display: block; }
.calc-tbl td small { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.calc-tbl td em { display: inline-block; font-style: normal; font-size: 12px; font-weight: 650; color: var(--brand); background: var(--brand-50); border-radius: 6px; padding: 1px 7px; margin-top: 6px; }
.calc-tbl .r { text-align: right; white-space: nowrap; font-weight: 750; padding-left: 12px; }
.calc-tbl tr.sep td { background: #f8fafc; }
.calc-notes { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 6px; }
.calc-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.calc-acts .btn { flex: 1 1 190px; }
.calc-status { min-height: 1.2em; margin: 8px 0 0; }
.calc-disclaimer { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.shared-note { background: var(--brand-50); color: var(--brand-d); border-radius: 10px; padding: 9px 12px; font-weight: 600; margin: 0 0 14px; font-size: 14.5px; }

/* ── Contenido (SEO) ──────────────────────────────────────────────────────── */
.content { max-width: 860px; margin: 44px auto 0; }
.content h2 { font-size: clamp(22px, 3vw, 28px); margin: 42px 0 12px; }
.content h3 { font-size: 18px; margin: 24px 0 8px; }
.content p, .content li { color: var(--ink-2); line-height: 1.7; }
.content li { margin: 4px 0; }
.lead { font-size: 18px; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 14px 58px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; list-style: none; padding: 0; }
.links a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 15px; height: 100%; }
.links a:hover { border-color: var(--brand); color: var(--brand); }
.links small { display: block; color: var(--muted); font-weight: 500; font-size: 13.5px; margin-top: 2px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin: 8px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 2px; }
.tbl-wrap { overflow-x: auto; border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); font-size: 15px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--brand-50); font-size: 13.5px; color: var(--ink-2); }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 14px; color: #78350f; font-size: 15px; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); font-size: 14.5px; overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 8px 0; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); font-weight: 650; }
.kpi b { font-size: 20px; }
.updated { font-size: 13.5px; color: var(--muted); }
.sources { padding-left: 18px; }
.sources li { font-size: 14.5px; }
.cta-box { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 65%, #1e3a8a)); color: #fff; border-radius: 18px; padding: 22px 24px; margin: 40px 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.cta-box p { color: #ecfeff; margin: 4px 0 0; }
.cta-box h2 { margin: 0; color: #fff; font-size: 22px; }
.cta-box .btn { background: #fff; color: var(--brand); }

/* ── Anuncios (AdSense) ───────────────────────────────────────────────────── */
.ad { max-width: 860px; margin: 36px auto; min-height: 120px; text-align: center; }
.ad-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.ad--demo::after { content: "Espacio para anuncio · se llena con Google AdSense cuando publiques el sitio"; display: flex; align-items: center; justify-content: center; min-height: 160px; padding: 12px; border: 2px dashed #cbd5e1; border-radius: 14px; color: var(--muted); font-size: 14px; background: repeating-linear-gradient(45deg, #f8fafc 0 10px, #f1f5f9 10px 20px); }

/* ── Responsivo ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px 12px; flex-direction: column; align-items: stretch; box-shadow: var(--sh); }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; font-size: 16px; }
}
@media (max-width: 560px) {
  main { padding: 0 12px; }
  .hero { padding: 22px 0 14px; }
  .calc { padding: 14px; border-radius: 14px; }
  .grid2 { grid-template-columns: 1fr; }
  input, select { font-size: 16px; }
  .calc-tbl td { padding: 10px 2px; }
  .foot-in { grid-template-columns: 1fr; }
}
