/* =========================================================
   FinLargo — design tokens
   ========================================================= */
:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef2e9;
  --surface-3: #e4eadf;
  --text: #10201a;
  --muted: #5a6b62;
  --line: #dfe6db;
  --brand: #0f7a5a;
  --brand-strong: #0a5c44;
  --brand-soft: #d9f2e7;
  --accent: #e0a415;
  --accent-soft: #fdf3d6;
  --danger: #b4451f;
  --danger-soft: #fbe8e0;
  --info: #2563eb;
  --alloc-equity: #0f7a5a;
  --alloc-bonds: #3b82f6;
  --alloc-cash: #d99a06;
  --shadow-sm: 0 1px 2px rgba(16, 32, 26, .06), 0 4px 12px rgba(16, 32, 26, .04);
  --shadow-md: 0 10px 30px rgba(16, 32, 26, .10);
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1160px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1512;
  --surface: #11201a;
  --surface-2: #162a22;
  --surface-3: #1d352b;
  --text: #e9f3ed;
  --muted: #9fb3a8;
  --line: #243b31;
  --brand: #3ddc9a;
  --brand-strong: #7ff0bd;
  --brand-soft: #143829;
  --accent: #f5c44e;
  --accent-soft: #3a2f10;
  --danger: #ff8a63;
  --danger-soft: #3b1c12;
  --info: #7aa7ff;
  --alloc-equity: #3ddc9a;
  --alloc-bonds: #7aa7ff;
  --alloc-cash: #f5c44e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, .45);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.9rem); font-weight: 760; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 720; }
h3 { font-size: 1.12rem; font-weight: 680; }
p { margin: 0 0 1rem; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 820px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 100;
  background: var(--brand); color: #fff;
  padding: .7rem 1rem; border-radius: 10px; text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-inner {
  display: flex; align-items: center; gap: 1.4rem;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 760; letter-spacing: -.02em; font-size: 1.08rem;
  text-decoration: none; flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent);
}
.brand-mark svg { width: 20px; height: 20px; }
[data-theme="dark"] .brand-mark { color: #06251a; }

.nav {
  display: flex; gap: 1.35rem; margin-left: auto;
  font-size: .92rem; font-weight: 560;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; color: var(--muted);
  padding: .35rem 0; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav a:hover { color: var(--text); border-color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: .4rem; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.icon-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 620; font-size: .97rem;
  padding: .78rem 1.25rem; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 28%, transparent);
}
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
[data-theme="dark"] .btn-primary { color: #06251a; }
[data-theme="dark"] .btn-primary:hover { background: var(--brand); }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); }
.btn-sm { padding: .52rem .9rem; font-size: .88rem; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* =========================================================
   Hero
   ========================================================= */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem); }
.hero::before,
.hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(70px); opacity: .55; pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px; top: -220px; right: -140px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 30%, transparent), transparent 70%);
}
.hero::after {
  width: 420px; height: 420px; bottom: -260px; left: -160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .86rem; font-weight: 660; letter-spacing: .02em;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  padding: .38rem .8rem; border-radius: 999px; margin-bottom: 1.2rem;
}
[data-theme="dark"] .eyebrow { color: var(--brand); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.hl {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand) 55%, var(--accent) 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.02rem, 1.6vw, 1.16rem); color: var(--muted); max-width: 34rem; margin-bottom: 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.4rem; }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: .35rem 1.15rem;
  list-style: none; padding: 0; margin: 0;
  font-size: .84rem; color: var(--muted);
}
.hero-badges li { display: inline-flex; align-items: center; gap: .4rem; }
.hero-badges span { color: var(--brand); font-weight: 800; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.6rem 1.6rem 1.1rem;
  box-shadow: var(--shadow-md);
  color: var(--brand-strong);
  position: relative;
  transform: rotate(-1.2deg);
  transition: transform .3s ease;
}
.hero-card:hover { transform: rotate(0deg) translateY(-3px); }
[data-theme="dark"] .hero-card { color: var(--brand); }
.hero-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.pill {
  font-size: .74rem; font-weight: 680; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-2); color: var(--muted);
  padding: .3rem .6rem; border-radius: 999px;
}
.hero-card-tag { font-size: .8rem; font-weight: 620; color: var(--muted); }
.hero-card-label { font-size: .86rem; color: var(--muted); margin-bottom: .1rem; }
.hero-card-number {
  font-size: clamp(2.1rem, 4vw, 2.8rem); font-weight: 780; letter-spacing: -.03em;
  color: var(--text); margin: 0;
  font-variant-numeric: tabular-nums;
}
.hero-card-sub { font-size: .84rem; color: var(--muted); margin-bottom: 1.4rem; }
.spark { width: 100%; height: auto; color: var(--brand); }
.spark-line { stroke-dasharray: 520; stroke-dashoffset: 520; animation: draw 2.2s ease forwards .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-card-foot { font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .85rem; margin: 1rem 0 0; }

/* =========================================================
   Sections
   ========================================================= */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.section-head p { color: var(--muted); margin-bottom: 0; }
.step {
  display: inline-block; font-size: .78rem; font-weight: 760; letter-spacing: .12em;
  color: var(--brand); margin-bottom: .55rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.3rem;
}
.card-head h3 { margin-bottom: 0; }

/* =========================================================
   Quiz
   ========================================================= */
.quiz { padding: clamp(1.2rem, 3vw, 2rem); max-width: 860px; }
.quiz-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; font-size: .85rem; color: var(--muted); font-weight: 600; }
.progress {
  flex: 1; height: 7px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  border-radius: inherit; transition: width .35s ease;
}
.progress.slim { height: 5px; margin-bottom: 1rem; }

.quiz-body { min-height: 216px; }
.quiz-q { font-size: clamp(1.15rem, 2.1vw, 1.4rem); font-weight: 700; margin-bottom: .35rem; }
.quiz-hint { color: var(--muted); font-size: .88rem; margin-bottom: 1.15rem; }
.quiz-options { display: grid; gap: .55rem; }
.option {
  display: flex; align-items: center; gap: .8rem; width: 100%;
  text-align: left; font: inherit; font-size: .96rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: .8rem .95rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.option:hover { border-color: var(--brand); background: var(--surface-2); }
.option .radio {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center;
  transition: border-color .15s ease;
}
.option .radio::after {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); transform: scale(0); transition: transform .15s ease;
}
.option[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.option[aria-checked="true"] .radio { border-color: var(--brand); }
.option[aria-checked="true"] .radio::after { transform: scale(1); }
.quiz-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: 1.4rem; }

/* =========================================================
   Resultado
   ========================================================= */
.result { padding: clamp(1.3rem, 3vw, 2.2rem); margin-top: 1.2rem; }
.result-grid { display: grid; grid-template-columns: 220px 1fr; gap: clamp(1.4rem, 4vw, 2.6rem); align-items: start; }
.result-badge { font-size: .76rem; font-weight: 720; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.result-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: .2rem 0 .4rem; }
.result-tagline { color: var(--muted); max-width: 46rem; }
.result-score { color: var(--muted); font-size: .84rem; }

.donut {
  --eq: 30; --bd: 60; --ca: 10;
  width: 190px; height: 190px; border-radius: 50%;
  background: conic-gradient(
    var(--alloc-equity) 0 calc(var(--eq) * 1%),
    var(--alloc-bonds) 0 calc((var(--eq) + var(--bd)) * 1%),
    var(--alloc-cash) 0 100%
  );
  display: grid; place-items: center;
  margin-inline: auto;
  position: relative;
}
.donut::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--line) 90%, transparent);
}
.donut-hole {
  width: 72%; height: 72%; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.donut-hole strong { font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.donut-hole span { font-size: .74rem; color: var(--muted); }

.alloc-list { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; gap: .55rem; }
.alloc-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: .65rem; align-items: center; font-size: .92rem; }
.alloc-dot { width: 12px; height: 12px; border-radius: 4px; }
.alloc-example { display: block; font-size: .78rem; color: var(--muted); }
.alloc-pct { font-weight: 720; font-variant-numeric: tabular-nums; }

.alerts { display: grid; gap: .6rem; margin: 1.2rem 0; }
.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  font-size: .9rem; padding: .8rem .95rem; border-radius: 12px;
  border: 1px solid; line-height: 1.5;
}
.alert strong { display: block; font-size: .88rem; }
.alert-warn { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

.result-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.6rem; }
.result-cols h4 { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .55rem; }
.steps li { display: flex; gap: .65rem; font-size: .92rem; counter-increment: step; }
.steps li::before {
  content: counter(step); flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-strong);
  display: grid; place-items: center;
  font-size: .74rem; font-weight: 740;
}
[data-theme="dark"] .steps li::before { color: var(--brand); }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* =========================================================
   Calculadora
   ========================================================= */
.calc-grid, .goal-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 1.2rem; align-items: start; }
.form-card { padding: clamp(1.2rem, 2.6vw, 1.8rem); }
.result-card, .goal-result { padding: clamp(1.3rem, 2.8vw, 2rem); }

.select-wrap select {
  font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px;
  padding: .4rem .6rem; cursor: pointer;
}

.field { margin-bottom: 1.35rem; }
.field:last-child { margin-bottom: 0; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.field-top label { font-size: .9rem; font-weight: 600; }
.input-affix {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: .28rem .5rem;
  transition: border-color .15s ease;
}
.input-affix:focus-within { border-color: var(--brand); }
.input-affix input {
  font: inherit; font-size: .9rem; font-weight: 650;
  color: var(--text); background: transparent; border: 0;
  width: 6.2rem; text-align: right; padding: 0;
  font-variant-numeric: tabular-nums;
}
.input-affix input:focus { outline: none; }
.input-affix span { font-size: .8rem; color: var(--muted); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--surface-3); cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .12s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.hint { font-size: .78rem; color: var(--muted); margin: .55rem 0 0; line-height: 1.5; }

.result-label { font-size: .86rem; color: var(--muted); margin-bottom: .15rem; font-weight: 560; }
.big-number {
  font-size: clamp(2.3rem, 5.2vw, 3.4rem); font-weight: 790;
  letter-spacing: -.035em; line-height: 1.05; margin: 0 0 .2rem;
  font-variant-numeric: tabular-nums;
  color: var(--brand-strong);
}
[data-theme="dark"] .big-number { color: var(--brand); }
.result-sub { color: var(--muted); font-size: .86rem; margin-bottom: 1.3rem; }

.chart-wrap { margin: 1.2rem 0 1.4rem; }
.chart-legend { display: flex; gap: 1.1rem; font-size: .78rem; color: var(--muted); margin-bottom: .6rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch-contrib { background: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.swatch-growth { background: var(--brand); }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--text); color: var(--bg);
  font-size: .74rem; line-height: 1.45; padding: .45rem .6rem;
  border-radius: 8px; white-space: nowrap;
  transform: translate(-50%, -115%);
  box-shadow: var(--shadow-md);
}
.chart-tip strong { display: block; font-size: .8rem; }
.chart-tip span { display: block; opacity: .8; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.stats-2 { grid-template-columns: 1fr 1fr; margin-top: 1.3rem; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .8rem;
}
.stat span { display: block; font-size: .74rem; color: var(--muted); margin-bottom: .15rem; }
.stat strong { font-size: .98rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.note {
  margin: 1.1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--muted);
}
.note strong { color: var(--text); }

.goal-verdict { margin: 0 0 .2rem; font-size: .9rem; }
.goal-verdict .ok { color: var(--brand-strong); font-weight: 650; }
[data-theme="dark"] .goal-verdict .ok { color: var(--brand); }
.goal-verdict .gap { color: var(--danger); font-weight: 650; }
.goal-verdict .gap-ok { color: var(--brand); font-weight: 650; }

/* =========================================================
   Principios y checklist
   ========================================================= */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.principle { padding: 1.35rem; }
.principle-icon { font-size: 1.5rem; display: block; margin-bottom: .6rem; }
.principle h3 { font-size: 1.02rem; }
.principle p { font-size: .87rem; color: var(--muted); margin: 0; }

.checklist-wrap { display: grid; grid-template-columns: 1.45fr .55fr; gap: 1rem; margin-top: 1.2rem; align-items: start; }
.checklist { padding: clamp(1.2rem, 2.6vw, 1.7rem); }
.check-count { font-size: .82rem; font-weight: 700; color: var(--brand); white-space: nowrap; }
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.check-item { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; font-size: .92rem; padding: .55rem .65rem; border-radius: 10px; transition: background .15s ease; }
.check-item:hover { background: var(--surface-2); }
.check-item input {
  appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; margin: 1px 0 0;
  transition: background .15s ease, border-color .15s ease;
}
.check-item input::after {
  content: "✓"; font-size: .78rem; font-weight: 800; color: #fff;
  transform: scale(0); transition: transform .12s ease;
}
.check-item input:checked { background: var(--brand); border-color: var(--brand); }
[data-theme="dark"] .check-item input::after { color: #06251a; }
.check-item input:checked::after { transform: scale(1); }
.check-item input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.check-item.done span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); }

.callout { padding: 1.4rem; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 20%, transparent); }
.callout h3 { color: var(--brand-strong); }
[data-theme="dark"] .callout h3 { color: var(--brand); }
.callout p { font-size: .9rem; }
.callout .hint { color: var(--brand-strong); opacity: .75; }
[data-theme="dark"] .callout .hint { color: var(--brand); }

/* =========================================================
   FAQ
   ========================================================= */
.faq { display: grid; gap: .65rem; }
.faq details { padding: 0; overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.25rem; font-weight: 620; font-size: .97rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 1.3rem; font-weight: 400; color: var(--brand);
  line-height: 1; flex-shrink: 0; transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { padding: 0 1.25rem 1.15rem; margin: 0; color: var(--muted); font-size: .92rem; max-width: 60rem; }

/* =========================================================
   CTA final y footer
   ========================================================= */
.cta-final { padding-top: 0; }
.cta-card {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background:
    radial-gradient(600px 260px at 100% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    var(--surface);
}
.cta-card h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: .4rem; }
.cta-card p { color: var(--muted); margin: 0; max-width: 42rem; }

.site-footer { border-top: 1px solid var(--line); padding: 2.6rem 0 1.4rem; background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr .4fr; gap: 2rem; }
.footer-grid nav { display: grid; gap: .45rem; align-content: start; font-size: .9rem; }
.footer-grid nav a { text-decoration: none; color: var(--muted); }
.footer-grid nav a:hover { color: var(--text); }
.disclaimer { font-size: .78rem; color: var(--muted); max-width: 52rem; margin: 1rem 0 0; line-height: 1.65; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.1rem;
  font-size: .76rem; color: var(--muted);
}

/* =========================================================
   Radar de titulares
   ========================================================= */
.radar-top {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
  align-items: stretch;
}

.gauge-card {
  padding: clamp(1.2rem, 2.6vw, 1.6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
}
.gauge-card[data-level="calma"] { --level: var(--brand); --level-text: var(--brand-strong); }
.gauge-card[data-level="moderada"] { --level: var(--accent); --level-text: #8a5a00; }
.gauge-card[data-level="tensa"] { --level: #e07a1f; --level-text: #a8480a; }
.gauge-card[data-level="muy-tensa"] { --level: var(--danger); --level-text: var(--danger); }
[data-theme="dark"] .gauge-card[data-level="calma"] { --level-text: var(--brand); }
[data-theme="dark"] .gauge-card[data-level="moderada"] { --level-text: var(--accent); }
[data-theme="dark"] .gauge-card[data-level="tensa"] { --level-text: #ffab6b; }
[data-theme="dark"] .gauge-card[data-level="muy-tensa"] { --level-text: var(--danger); }

.gauge-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.gauge-value {
  display: flex;
  align-items: baseline;
  gap: .2rem;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 760;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gauge-value small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.gauge-label { font-size: .88rem; font-weight: 700; color: var(--level-text); }

.meter {
  position: relative;
  height: 12px;
  margin: .55rem 0 .2rem;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--level);
  transition: width .5s ease, background-color .3s ease;
}
.meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--surface) calc(10% - 2px) 10%);
  pointer-events: none;
}

.legend-card { padding: clamp(1.2rem, 2.6vw, 1.6rem); }
.legend-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .8rem; }
.legend-list li { display: grid; gap: .3rem; justify-items: start; }
.legend-list p { margin: 0; font-size: .86rem; color: var(--muted); }

.impact {
  display: inline-block;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.impact-alto {
  color: #8a5a00;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.impact-bajo {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
}
[data-theme="dark"] .impact-alto { color: var(--accent); }
[data-theme="dark"] .impact-bajo { color: var(--brand); }

.radar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .42rem .85rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip span {
  font-size: .72rem;
  font-weight: 700;
  padding: .05rem .4rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip.is-active span {
  background: color-mix(in srgb, #fff 26%, transparent);
  color: #fff;
}
[data-theme="dark"] .chip.is-active { color: #06251a; }
[data-theme="dark"] .chip.is-active span { color: #06251a; }

.radar-stamp { margin: 0; font-size: .76rem; color: var(--muted); }

.radar-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.news {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.3rem 1.4rem;
  border-left: 3px solid var(--line);
}
.news-alto { border-left-color: var(--accent); }
.news-bajo { border-left-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.news-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.news-cat { font-size: .74rem; font-weight: 600; color: var(--muted); }
.news h3 { font-size: 1.02rem; margin: 0; }
.news h3 a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}
.news h3 a:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .news h3 a:hover { color: var(--brand); }
.news h3 a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .45rem;
  margin: 0;
  font-size: .76rem;
  color: var(--muted);
}
.news-meta .news-medio { font-weight: 650; color: var(--text); }
.news-meta time { font-variant-numeric: tabular-nums; }

.news-read { margin: 0; font-size: .9rem; }

.news-vol {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px dashed var(--line);
}
.news-vol-label { font-size: .72rem; font-weight: 600; color: var(--muted); }
.vol { display: inline-flex; gap: 2px; }
.vol i {
  display: block;
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: var(--surface-3);
}
.vol i.on { background: var(--accent); }
.vol-bajo i.on { background: var(--brand); }
.vol-alto i.on { background: var(--danger); }
.vol-num {
  margin-left: auto;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.news-assets { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.news-assets li {
  font-size: .72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .1rem .5rem;
}
.news-do { margin: 0; font-size: .85rem; color: var(--muted); }
.news-do strong { color: var(--text); }

.radar-empty { padding: 1.4rem; margin: 0; font-size: .9rem; color: var(--muted); }

.assets-block { margin-top: 2.2rem; }
.assets-block h3 { font-size: 1.15rem; }
.assets-intro { font-size: .9rem; color: var(--muted); max-width: 54rem; }
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.assets-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .86rem; }
.assets-table th,
.assets-table td {
  text-align: left;
  vertical-align: top;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
}
.assets-table thead th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}
.assets-table tbody th { font-weight: 650; white-space: nowrap; }
.assets-table tbody tr:last-child th,
.assets-table tbody tr:last-child td { border-bottom: 0; }

/* =========================================================
   Informe imprimible
   ========================================================= */
.print-only { display: none; }

@media print {
  @page { margin: 16mm 14mm; }

  body[data-print="plan"] {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #f4f4f4;
    --surface-3: #e8e8e8;
    --text: #111;
    --muted: #555;
    --line: #d0d0d0;
    --brand: #0f7a5a;
    --brand-strong: #0a5c44;
    --brand-soft: #e6f6ef;
    --accent: #8a6a00;
    --accent-soft: #fdf3d6;
    --danger: #8f3517;
    --danger-soft: #fbe8e0;
    --alloc-equity: #0f7a5a;
    --alloc-bonds: #3b82f6;
    --alloc-cash: #d99a06;
    background: #fff !important;
    color: #111 !important;
    transition: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body[data-print="plan"] > *:not(main) { display: none !important; }
  body[data-print="plan"] main > *:not(#diagnostico) { display: none !important; }
  body[data-print="plan"] #diagnostico > .wrap > *:not(#resultado) { display: none !important; }
  body[data-print="plan"] .print-only { display: block !important; }

  body[data-print="plan"] #diagnostico { padding: 0 !important; }
  body[data-print="plan"] #diagnostico > .wrap { width: 100% !important; max-width: none !important; }
  body[data-print="plan"] .result {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }
  body[data-print="plan"] .result-actions { display: none !important; }
  body[data-print="plan"] .result-grid { grid-template-columns: 140px 1fr; gap: 12mm; }
  body[data-print="plan"] .donut { width: 140px; height: 140px; }
  body[data-print="plan"] .alert,
  body[data-print="plan"] .result-cols,
  body[data-print="plan"] .alloc-list li { break-inside: avoid; }

  .print-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: .5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ccc;
    font-size: .78rem;
    color: #444;
  }
  .print-head strong { font-size: 1rem; letter-spacing: -.02em; color: #0f7a5a; }
  .print-foot {
    margin-top: 1.2rem;
    padding-top: .6rem;
    border-top: 1px solid #ccc;
    font-size: .66rem;
    line-height: 1.5;
    color: #555;
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 440px; transform: none; }
  .hero-card:hover { transform: translateY(-3px); }
  .calc-grid, .goal-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr 1fr; }
  .checklist-wrap { grid-template-columns: 1fr; }
  .radar-top { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .donut { width: 170px; height: 170px; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .radar-list { grid-template-columns: 1fr; }
  .result-cols { grid-template-columns: 1fr; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid nav { grid-auto-flow: column; justify-content: start; gap: 1.2rem; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .wrap { width: min(100% - 1.6rem, var(--wrap)); }
  .principles { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stats-2 { grid-template-columns: 1fr 1fr; }
  .hero-actions .btn { flex: 1 1 auto; }
  .quiz { padding: 1.1rem; }
  .quiz-nav { flex-direction: row; }
  .input-affix input { width: 5.2rem; }
  .footer-bottom { flex-direction: column; gap: .3rem; }
}

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