/* ==========================================================================
   Tu Vida Financiera — sistema de diseño
   Tema claro único, deliberado. Sin fuentes externas: cero bloqueo de render.
   ========================================================================== */

:root {
  /* Fondos */
  --ground:        #FFFFFF;
  --ground-warm:   #F7F6F3;
  --ground-deep:   #16233D;
  --surface:       #FFFFFF;

  /* Tinta */
  --ink:           #14161B;
  --ink-2:         #4B515C;
  --ink-3:         #767D8A;
  --ink-invert:    #F4F2ED;
  --ink-invert-2:  #AFB8C7;

  /* Marca */
  --navy:          #16233D;
  --navy-2:        #24365A;
  --gold:          #8A6A1F;
  --gold-bright:   #C99C33;
  --gold-wash:     #FBF4E3;

  /* Semántica */
  --alert:         #9C3A2B;
  --alert-wash:    #FAEBE8;
  --good:          #2C6440;
  --good-wash:     #E8F1EA;

  /* Trazos */
  --rule:          #E3E1DB;
  --rule-strong:   #C9C6BE;

  /* Tipografía */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Ritmo */
  --nav-h: 62px;
  --wrap:  1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ---------- Tipografía ---------- */

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.35rem); line-height: 1.18; margin-bottom: .5em; }
h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: .35em; }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 650; margin-bottom: .3em; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

.lead { font-size: 1.19rem; color: var(--ink-2); line-height: 1.6; }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 14px; font-weight: 500;
}
.eyebrow.on-dark { color: var(--gold-bright); }

a { color: var(--navy-2); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gold); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 2px;
}

strong { font-weight: 650; }
small { font-size: .875rem; }

/* ---------- Navegación ---------- */

.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-in {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px;
  height: var(--nav-h); display: flex; align-items: center; gap: 28px;
}
.brand {
  font-family: var(--serif); font-size: 1.13rem; font-weight: 650;
  color: var(--navy); text-decoration: none; letter-spacing: -.02em; white-space: nowrap;
}
.brand:hover { color: var(--navy); }
.brand em { font-style: normal; color: var(--gold); }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { font-size: .93rem; color: var(--ink-2); text-decoration: none; }
.nav-links a:hover { color: var(--navy); }
@media (max-width: 860px) { .nav-links .hide-sm { display: none; } }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1;
  padding: 14px 24px; border: 1px solid transparent; border-radius: 3px;
  text-decoration: none; cursor: pointer; transition: background-color .16s, color .16s, border-color .16s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-gold { background: var(--gold-bright); color: var(--navy); }
.btn-gold:hover { background: #B98D26; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 9px 16px; font-size: .9rem; }
.btn-lg { padding: 17px 32px; font-size: 1.06rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

.btn-note { font-size: .85rem; color: var(--ink-3); margin-top: 12px; }

/* ---------- Secciones ---------- */

.sec { padding: 76px 0; }
.sec-sm { padding: 52px 0; }
.sec-warm { background: var(--ground-warm); }
.sec-dark { background: var(--ground-deep); color: var(--ink-invert); }
.sec-dark h1, .sec-dark h2, .sec-dark h3 { color: #fff; }
.sec-dark p { color: var(--ink-invert-2); }
.sec-dark a { color: var(--gold-bright); }
.sec + .sec { border-top: 1px solid var(--rule); }
.sec-warm + .sec-warm, .sec-dark + .sec-dark { border-top: none; }

/* ---------- Héroe ---------- */

.hero { padding: 74px 0 66px; }
.hero .lead { max-width: 60ch; margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 34px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: start; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- Tarjetas ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 4px; padding: 26px 24px;
}
.card h3 { font-family: var(--sans); font-size: 1.06rem; font-weight: 650; letter-spacing: 0; }
.card p { color: var(--ink-2); font-size: .96rem; margin-bottom: 0; }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .16s; }
.card-link:hover { border-color: var(--navy); color: inherit; }
.card-kw { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em; margin-top: 14px; }

/* ---------- Bloque de conversión ---------- */

.convert {
  background: var(--ground-deep); color: var(--ink-invert);
  border-radius: 5px; padding: 42px 40px; margin: 44px 0;
}
.convert h2, .convert h3 { color: #fff; font-size: 1.7rem; margin-bottom: .4em; }
.convert p { color: var(--ink-invert-2); max-width: 54ch; }
.convert .btn { margin-top: 22px; }
.convert-note { font-size: .85rem; color: #8E99AC; margin-top: 14px; }
@media (max-width: 640px) { .convert { padding: 32px 24px; } }

.convert-inline {
  border: 1px solid var(--rule); border-left: 3px solid var(--gold-bright);
  background: var(--gold-wash); border-radius: 3px; padding: 24px 26px; margin: 34px 0;
}
.convert-inline h4 { margin-bottom: .35em; }
.convert-inline p { color: var(--ink-2); font-size: .97rem; }
.convert-inline .btn { margin-top: 16px; }

/* ---------- Datos ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.stat { background: var(--surface); padding: 22px 20px; }
.stat-fig { font-family: var(--mono); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--navy); display: block; }
.stat-lab { font-size: .88rem; color: var(--ink-2); margin-top: 6px; display: block; line-height: 1.45; }
.sec-dark .stat { background: #1E2E4C; }
.sec-dark .stat-fig { color: var(--gold-bright); }
.sec-dark .stat-lab { color: var(--ink-invert-2); }

/* ---------- Prosa de artículo ---------- */

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.7em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--gold); }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold-bright);
  font-family: var(--serif); font-size: 1.14rem; color: var(--ink-2);
}

.steps { list-style: none; padding: 0; counter-reset: s; margin: 28px 0; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; margin-bottom: 26px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--navy); background: var(--gold-wash); border: 1px solid var(--gold-bright); border-radius: 50%;
}
.steps strong { display: block; margin-bottom: 3px; }

/* ---------- Tablas ---------- */

.tscroll { overflow-x: auto; margin: 28px 0; border: 1px solid var(--rule); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: .94rem; background: var(--surface); }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; border-bottom: 1px solid var(--rule-strong); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Avisos ---------- */

.note { border: 1px solid var(--rule); border-left: 3px solid var(--navy); background: var(--ground-warm); padding: 20px 22px; border-radius: 3px; margin: 28px 0; }
.note.warn { border-left-color: var(--gold-bright); background: var(--gold-wash); }
.note.alert { border-left-color: var(--alert); background: var(--alert-wash); }
.note p { font-size: .96rem; color: var(--ink-2); }
.note-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 7px; }

/* ---------- Preguntas frecuentes ---------- */

.faq { border-top: 1px solid var(--rule); margin-top: 34px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; padding: 17px 30px 17px 0; font-weight: 600; position: relative;
  list-style: none; font-size: 1.01rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 1.2rem; color: var(--gold); font-weight: 400;
}
.faq details[open] summary::after { content: "\2212"; }
.faq .faq-body { padding: 0 0 20px; color: var(--ink-2); font-size: .97rem; max-width: 68ch; }

/* ---------- Pie ---------- */

.foot { background: var(--ground-deep); color: var(--ink-invert-2); padding: 56px 0 34px; font-size: .93rem; }
.foot a { color: var(--ink-invert-2); text-decoration: none; }
.foot a:hover { color: var(--gold-bright); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7C879B; margin-bottom: 14px; font-weight: 500; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 9px; }
.foot .brand { color: #fff; }
.foot-legal { border-top: 1px solid #2A3A58; margin-top: 40px; padding-top: 22px; font-size: .84rem; color: #7C879B; max-width: 80ch; }
.foot-legal p { margin-bottom: .7em; }

/* ---------- Migas ---------- */

.crumbs { font-size: .85rem; color: var(--ink-3); padding: 20px 0 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--navy); }
.crumbs span { margin: 0 7px; color: var(--rule-strong); }

/* ---------- Utilidades ---------- */

.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; } .mt-36 { margin-top: 36px; }
.center { text-align: center; }
.center .lead, .center h2 { margin-left: auto; margin-right: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Diagnóstico ---------- */

.q-shell {
  max-width: 700px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 5px; padding: 38px 38px 42px;
}
@media (max-width: 640px) { .q-shell { padding: 26px 20px 30px; border-radius: 0; border-left: none; border-right: none; } }

.q-head { margin-bottom: 30px; }
.q-progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.q-progress-bar { height: 100%; width: 0; background: var(--gold-bright); transition: width .3s ease; }
.q-count { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 12px 0 0; }

.q-title { font-size: clamp(1.5rem, 3.2vw, 2rem); line-height: 1.16; margin-bottom: .35em; }
.q-help { color: var(--ink-2); font-size: 1rem; margin-bottom: 26px; }

.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-opt {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  padding: 15px 18px; font-family: var(--sans); color: var(--ink);
  transition: border-color .14s, background-color .14s;
}
.q-opt:hover { border-color: var(--navy); background: var(--ground-warm); }
.q-opt.is-sel { border-color: var(--navy); background: var(--gold-wash); }
.q-opt-t { display: block; font-weight: 600; font-size: 1.02rem; }
.q-opt-d { display: block; font-size: .9rem; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }

.q-back {
  margin-top: 22px; background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: .92rem; color: var(--ink-3); padding: 6px 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.q-back:hover { color: var(--navy); }

.q-form { display: flex; flex-direction: column; gap: 18px; }
.q-field { display: flex; flex-direction: column; gap: 6px; }
.q-field span { font-size: .92rem; font-weight: 600; }
.q-field input {
  font-family: var(--sans); font-size: 1rem; padding: 13px 15px;
  border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink);
}
.q-field input:focus { border-color: var(--navy); }
.q-check { display: flex; gap: 11px; align-items: flex-start; font-size: .91rem; color: var(--ink-2); line-height: 1.5; }
.q-check input { margin-top: 3px; flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--navy); }
.q-error { color: var(--alert); font-size: .92rem; margin: 0; font-weight: 500; }

.q-result .eyebrow { margin-bottom: 10px; }
.q-steps-h { font-family: var(--sans); font-size: 1.05rem; font-weight: 650; margin-top: 2em; }
.q-legal { font-size: .84rem; color: var(--ink-3); margin-top: 26px; line-height: 1.55; }

/* ==========================================================================
   Consentimiento de cookies
   Barra inferior, no modal: informa sin secuestrar la lectura. Sin sombras.
   ========================================================================== */

.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--ground-deep);
  color: var(--ink-invert);
  border-top: 1px solid var(--navy-2);
  transform: translateY(100%);
  transition: transform .2s ease-out;
}
.consent.is-open { transform: translateY(0); }

.consent-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.consent-txt p { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--ink-invert-2); }
.consent-h {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-invert) !important;
  margin-bottom: 3px !important;
}
.consent-txt a { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 2px; }
.consent-txt a:hover { color: #fff; }

.consent-btns { display: flex; gap: 10px; flex-shrink: 0; margin-left: auto; }
.consent-btns .btn-ghost { color: var(--ink-invert); border-color: var(--navy-2); background: transparent; }
.consent-btns .btn-ghost:hover { color: #fff; border-color: var(--ink-invert-2); }
.consent-btns .btn-primary { background: var(--gold-bright); color: var(--navy); }
.consent-btns .btn-primary:hover { background: #B98D26; color: var(--navy); }

@media (max-width: 720px) {
  .consent-in { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 20px; }
  .consent-btns { margin-left: 0; }
  .consent-btns .btn { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .consent { transition: none; }
}

.convert-note-alert { color: var(--alert); }
