/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  /* ── Colores principales ── */
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-mid:    #0878b0;   /* Tono intermedio azul→teal para gradientes */
  --primary-hover:  #1a56db;   /* Hover del botón primario */
  --primary-alt:    #3b82f6;   /* Blue-500, acentos secundarios y barras */
  --primary-light:  rgba(37,99,235,0.08);
  --primary-glow:   rgba(37,99,235,0.20);

  /* ── Secundario — verde esmeralda financiero ── */
  --secondary:      #059669;
  --secondary-dark: #047857;
  --secondary-light:rgba(5,150,105,0.08);

  /* ── Acento, peligro, purple, teal ── */
  --accent:         #d97706;
  --accent-alt:     #f59e0b;   /* Amber más saturado para disclaimers */
  --accent-light:   rgba(217,119,6,0.09);
  --danger:         #dc2626;
  --danger-light:   rgba(220,38,38,0.08);
  --purple:         #7c3aed;
  --purple-light:   rgba(124,58,237,0.08);
  --teal:           #0891b2;
  --teal-light:     rgba(8,145,178,0.08);

  /* ── Fondos ── */
  --bg:             #f3f6fb;
  --surface:        #ffffff;
  --surface-2:      #f8faff;
  --border:         #e2e8f4;
  --border-focus:   #2563eb;

  /* ── Bordes decorativos de color ── */
  --border-primary-subtle: rgba(37,99,235,0.14);
  --border-primary-soft:   rgba(37,99,235,0.20);

  /* ── Tipografía ── */
  --text:           #0a1628;
  --text-secondary: #3b5278;
  --text-muted:     #7c94b8;

  /* ── Header ── */
  --header-bg:      rgba(255,255,255,0.97);

  /* ── Footer (siempre oscuro) ── */
  --footer-bg-from: #0c1829;
  --footer-bg-to:   #060f1c;
  --footer-accent:  #4da3ff;   /* Color del logo en footer (siempre sobre fondo oscuro) */
  --border-footer:  rgba(37,99,235,0.14);

  /* ── PayPal ── */
  --paypal:         #0070ba;
  --paypal-hover:   #005ea6;

  /* ── Sombras base ── */
  --shadow-xs:      0 1px 2px rgba(8,20,55,0.05);
  --shadow-sm:      0 2px 6px rgba(8,20,55,0.07), 0 1px 2px rgba(8,20,55,0.04);
  --shadow:         0 4px 16px rgba(8,20,55,0.08), 0 2px 6px rgba(8,20,55,0.04);
  --shadow-md:      0 10px 30px rgba(8,20,55,0.10), 0 4px 10px rgba(8,20,55,0.05);
  --shadow-lg:      0 24px 56px rgba(8,20,55,0.12), 0 8px 20px rgba(8,20,55,0.06);
  --shadow-colored: 0 6px 20px rgba(37,99,235,0.20);

  /* ── Sombras semánticas de componentes ── */
  --shadow-result:              0 18px 44px -16px rgba(11,28,85,0.45), 0 4px 12px -4px rgba(37,99,235,0.16), inset 0 1px 0 rgba(255,255,255,0.14);
  --shadow-btn-primary:         0 5px 14px -4px rgba(37,99,235,0.30), 0 1px 2px rgba(11,28,85,0.12);
  --shadow-btn-primary-hover:   0 11px 24px -8px rgba(37,99,235,0.36), 0 2px 6px rgba(11,28,85,0.14);
  --shadow-btn-secondary:       0 5px 14px -4px rgba(5,150,105,0.26), 0 1px 2px rgba(11,28,85,0.10);
  --shadow-btn-secondary-hover: 0 11px 22px -8px rgba(5,150,105,0.30), 0 2px 6px rgba(11,28,85,0.12);
  --shadow-tab:                 0 6px 16px -5px rgba(37,99,235,0.32), 0 1px 3px rgba(11,28,85,0.10);

  /* ── Glows de hover para paneles/cards ── */
  --glow-panel:     0 0 0 1px rgba(37,99,235,0.18), 0 0 48px rgba(37,99,235,0.07);
  --glow-chart:     0 0 0 1px rgba(37,99,235,0.10);
  --glow-faq:       0 0 0 1px rgba(37,99,235,0.14);
  --glow-saved:     0 0 0 1px rgba(37,99,235,0.18);
  --glow-toggle:    0 0 0 3px rgba(37,99,235,0.20);

  /* ── Tap highlight ── */
  --tap-highlight:  rgba(37,99,235,0.12);

  /* ── Gradientes ── */
  --gradient-hero:         linear-gradient(140deg, #0b1c55 0%, #1a3fb5 42%, #0b6ea5 75%, #0b8a7a 100%);
  --gradient-card:         linear-gradient(160deg, #fff 0%, #f8faff 100%);
  --gradient-result:       linear-gradient(135deg, #1e3a8a 0%, var(--primary) 55%, var(--primary-mid) 100%);
  --gradient-btn-primary:  linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 55%, var(--primary-mid) 100%);
  --gradient-tab-active:   linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  --gradient-footer:       linear-gradient(180deg, var(--footer-bg-from) 0%, var(--footer-bg-to) 100%);

  /* ── Radios ── */
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius:    13px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --ease: cubic-bezier(0.4,0,0.2,1);
  --transition: 0.18s var(--ease);
  --header-h: 60px;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  /* ── Fondos oscuros ── */
  --bg:             #050d1a;
  --surface:        #0a1929;
  --surface-2:      #0f2236;
  --border:         #172f4a;
  --border-focus:   #4da3ff;

  /* ── Tipografía dark ── */
  --text:           #e2eeff;
  --text-secondary: #6ea8d0;
  --text-muted:     #355470;

  /* ── Colores vibrantes sobre fondo oscuro ── */
  --primary:        #4da3ff;
  --primary-dark:   #2563eb;
  --primary-mid:    #0891b2;
  --primary-hover:  #4da3ff;
  --primary-alt:    #60a5fa;
  --primary-light:  rgba(77,163,255,0.10);
  --primary-glow:   rgba(77,163,255,0.22);
  --secondary:      #34d399;
  --secondary-dark: #10b981;
  --secondary-light:rgba(52,211,153,0.10);
  --accent:         #fbbf24;
  --accent-alt:     #fbbf24;
  --accent-light:   rgba(251,191,36,0.10);
  --danger:         #f87171;
  --danger-light:   rgba(248,113,113,0.10);
  --purple:         #a78bfa;
  --purple-light:   rgba(167,139,250,0.10);
  --teal:           #22d3ee;
  --teal-light:     rgba(34,211,238,0.10);

  /* ── Header dark ── */
  --header-bg:      rgba(8,20,40,0.97);

  /* ── Footer dark ── */
  --footer-bg-from: #040810;
  --footer-bg-to:   #020508;
  --border-footer:  rgba(77,163,255,0.08);

  /* ── Bordes decorativos dark ── */
  --border-primary-subtle: rgba(77,163,255,0.08);
  --border-primary-soft:   rgba(77,163,255,0.20);

  /* ── Sombras oscuras ── */
  --shadow-xs:      0 1px 3px rgba(0,0,0,0.50);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.35);
  --shadow:         0 4px 18px rgba(0,0,0,0.60), 0 2px 6px rgba(0,0,0,0.40);
  --shadow-md:      0 10px 36px rgba(0,0,0,0.65), 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg:      0 24px 64px rgba(0,0,0,0.72), 0 8px 24px rgba(0,0,0,0.52);
  --shadow-colored: 0 6px 22px rgba(77,163,255,0.20);

  /* ── Sombras semánticas dark ── */
  --shadow-result:              0 8px 30px rgba(13,40,110,0.70), inset 0 1px 0 rgba(255,255,255,0.06);
  --shadow-btn-primary:         0 4px 16px rgba(77,163,255,0.28), 0 2px 4px rgba(77,163,255,0.15);
  --shadow-btn-primary-hover:   0 8px 30px rgba(77,163,255,0.42), 0 3px 8px rgba(77,163,255,0.22);
  --shadow-btn-secondary:       0 4px 14px rgba(52,211,153,0.22);
  --shadow-btn-secondary-hover: 0 8px 24px rgba(52,211,153,0.28);
  --shadow-tab:                 0 4px 16px rgba(77,163,255,0.32), 0 2px 6px rgba(77,163,255,0.18);

  /* ── Glows dark ── */
  --glow-panel:     0 0 0 1px rgba(77,163,255,0.15), 0 0 48px rgba(77,163,255,0.05);
  --glow-chart:     0 0 0 1px rgba(77,163,255,0.08);
  --glow-faq:       0 0 0 1px rgba(77,163,255,0.12);
  --glow-saved:     0 0 0 1px rgba(77,163,255,0.15);
  --glow-toggle:    0 0 0 3px rgba(77,163,255,0.18);

  /* ── Tap highlight dark ── */
  --tap-highlight:  rgba(77,163,255,0.10);

  /* ── Gradientes dark ── */
  --gradient-card:         linear-gradient(160deg, #0a1929 0%, #0f2236 100%);
  --gradient-result:       linear-gradient(135deg, #0c1f4a 0%, #163880 55%, #0b4a7a 100%);
  --gradient-tab-active:   linear-gradient(135deg, #2066eb 0%, var(--primary-mid) 100%);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 20px rgba(10,25,60,0.06);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.site-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary) 30%,
    var(--teal) 70%,
    transparent 100%
  );
  opacity: 0.55;
  pointer-events: none;
}
[data-theme="dark"] .site-header {
  background: var(--header-bg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 4px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .site-header::after {
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary) 30%,
    var(--teal) 70%,
    transparent 100%
  );
  opacity: 0.4;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}
.header-sep {
  width: 1px; height: 22px;
  background: var(--border);
  margin: 0 16px;
  flex-shrink: 0;
}

/* ── LOGO ── */
.logo {
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo svg {
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.logo:hover svg {
  transform: scale(1.07);
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}
[data-theme="dark"] .logo svg {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 2px 8px rgba(0,0,0,0.5);
}
.logo-text { display: flex; align-items: baseline; line-height: 1; }
.logo-brand {
  font-weight: 800; font-size: 1rem;
  color: var(--text); letter-spacing: -0.04em;
}
.logo-tld {
  font-weight: 700; font-size: 1rem;
  color: var(--primary); letter-spacing: -0.04em;
}

/* ── NAV ── */
.site-header nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 100%;
}
.site-header nav > a {
  display: flex; align-items: center;
  height: 100%;
  padding: 0 13px;
  font-size: 0.845rem; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.site-header nav > a:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-bottom-color: var(--primary);
  text-decoration: none;
}
.site-header nav > a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* ── THEME TOGGLE ── */
/* Compact language toggle: shows the CURRENT language; click navigates to the
   other URL (hreflang-driven). Sized so it sits balanced next to the EUR /
   theme toggles instead of looking like an unfinished 2-letter chip. */
.lang-toggle {
  margin-left: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 38px;
  height: 28px;
  padding: 0 10px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}
.lang-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
/* ── CURRENCY TOGGLE ── */
.currency-toggle {
  margin-left: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex; align-items: center;
  transition: all var(--transition);
  flex-shrink: 0;
  cursor: pointer;
  gap: 4px;
}
.currency-toggle::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  flex-shrink: 0;
  transition: background var(--transition);
}
.currency-toggle:hover {
  background: var(--secondary-light);
  color: var(--secondary-dark);
  border-color: var(--secondary);
}
.currency-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
  margin-left: 4px;
}
.currency-badge.usd {
  background: var(--accent-light);
  border-color: rgba(217,119,6,0.25);
  color: var(--accent);
}
.theme-toggle {
  margin-left: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px;
  color: var(--text-secondary);
  display: flex; align-items: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
[data-theme="light"] .icon-moon,
[data-theme="dark"]  .icon-sun  { display: none; }

/* Sub-nav de calculadoras (oculta: la cabecera ya incluye todos los enlaces) */

/* ============================================================
   HERO — main page
   ============================================================ */
/* ── SEO Hero minimalista ── */
.seo-hero {
  position: relative;
  padding: 36px 0 30px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.seo-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 70% at -5% 60%, var(--primary-light) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 100% 100%, var(--teal-light) 0%, transparent 60%),
    radial-gradient(ellipse 35% 45% at 105% 5%, var(--secondary-light) 0%, transparent 50%);
  pointer-events: none;
}
[data-theme="dark"] .seo-hero-bg {
  background:
    radial-gradient(ellipse 50% 70% at -5% 60%, var(--primary-light) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 100% 100%, var(--teal-light) 0%, transparent 60%),
    radial-gradient(ellipse 35% 45% at 105% 5%, var(--secondary-light) 0%, transparent 50%);
  pointer-events: none;
}

/* Gráfica SVG integrada en el fondo */
.seo-hero-chart-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.75;
}
[data-theme="dark"] .seo-hero-chart-bg {
  opacity: 0.55;
}
.seo-bg-line {
  stroke-dasharray: 4000;
  stroke-dashoffset: 4000;
  animation: shvDraw 2s 0.4s cubic-bezier(0.25,0.1,0.25,1) forwards;
}
.seo-bg-pulse {
  animation: seoPulse 2.5s 2.8s ease-in-out infinite;
  transform-origin: 1000px 1px;
}
@keyframes seoPulse {
  0%, 100% { r: 8; opacity: 0.10; }
  50%       { r: 14; opacity: 0.04; }
}

.seo-hero .container { position: relative; z-index: 1; }
.seo-hero-layout {
  display: flex;
  align-items: center;
  gap: 48px;
}
.seo-hero-text {
  flex: 1;
  min-width: 0;
  max-width: 580px;
}
.seo-hero-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  animation: seoFadeUp 0.55s 0.30s var(--ease) both;
}
.seo-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  min-width: 200px;
}
.seo-hero-btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.seo-hero-btn--primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}
.seo-hero-btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.seo-hero-btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Badge */
.seo-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
  background: var(--secondary-light);
  border: 1px solid var(--border-primary-soft);
  border-color: rgba(5,150,105,0.2);
  border-radius: 100px;
  padding: 4px 10px 4px 8px;
  margin-bottom: 12px;
  animation: seoFadeUp 0.5s var(--ease) both;
}
[data-theme="dark"] .seo-hero-badge { border-color: rgba(52,211,153,0.2); }

/* H1 */
.seo-hero-h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 10px;
  animation: seoFadeUp 0.55s 0.08s var(--ease) both;
}
.seo-hero-h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--primary) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtítulo del H1 */
.seo-hero-h1-sub {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  display: block;
  margin-top: 4px;
}

/* CTA hero */
.seo-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px var(--primary-glow);
  animation: seoFadeUp 0.55s 0.22s var(--ease) both;
}
.seo-hero-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
  color: #fff;
}

/* Subtítulo */
.seo-hero-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 20px;
  animation: seoFadeUp 0.55s 0.16s var(--ease) both;
}

/* Stats */
.seo-hero-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  row-gap: 10px;
  animation: seoFadeUp 0.55s 0.24s var(--ease) both;
}
.seo-stat {
  display: flex;
  flex-direction: column;
  padding: 0 28px 0 0;
  position: relative;
  cursor: default;
  transition: transform var(--transition);
}
.seo-stat::before {
  content: '';
  position: absolute;
  inset: -6px 2px;
  border-radius: var(--radius-xs);
  background: transparent;
  transition: background var(--transition);
  pointer-events: none;
  z-index: 0;
}
.seo-stat > * { position: relative; z-index: 1; }
.seo-stat:hover::before { background: var(--primary-light); }
.seo-stat:hover { transform: translateY(-1px); }
.seo-stat + .seo-stat {
  padding-left: 28px;
  border-left: 1px solid var(--border);
}
.seo-stat-num {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-top: 4px;
  transition: color var(--transition);
}
.seo-stat:hover .seo-stat-num { color: var(--primary); }
.seo-stat-suffix {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  transition: color var(--transition);
}
.seo-stat:hover .seo-stat-suffix { color: var(--primary); }
.seo-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  transition: color var(--transition);
}
.seo-stat:hover .seo-stat-label { color: var(--text-secondary); }

/* Breadcrumb dentro del seo-hero */
.seo-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 14px;
  list-style: none;
}
.seo-hero-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.seo-hero-breadcrumb a:hover { color: var(--primary); }
.seo-hero-breadcrumb span[aria-hidden] { opacity: 0.5; }

/* Animaciones */
@keyframes seoFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shvDraw {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 640px) {
  .seo-hero { padding: 24px 0 20px; }
  .seo-hero-layout { flex-direction: column; align-items: flex-start; gap: 20px; }
  .seo-hero-actions { display: none; }
  .seo-hero-h1 { font-size: 1.4rem; }
  .seo-hero-sub { font-size: 0.85rem; margin-bottom: 16px; }
  .seo-stat + .seo-stat { padding-left: 14px; }
  .seo-stat { padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .seo-hero-badge, .seo-hero-h1, .seo-hero-sub, .seo-hero-stats, .seo-hero-actions { animation: none; }
  .seo-bg-line { stroke-dashoffset: 0; animation: none; }
  .seo-hero-h1 em { background: none; -webkit-text-fill-color: var(--primary); }
  .seo-stat-num--text { background: none; -webkit-text-fill-color: var(--primary); }
}

.hero {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 28px 0 22px;
  position: relative;
}
.hero::before { display: none; }
.hero .container { position: relative; z-index: 1; }

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.hero-h1 {
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text);
}
.hero-em {
  font-style: normal;
  color: var(--primary);
}

.hero-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.hero-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ── Pill badge (used by legal hero pages) ── */

/* ── Glowing orbs (used by calc + legal hero pages) ── */

/* ── Bottom wave (used by calc + legal hero pages) ── */

/* Offset de scroll para compensar el header sticky */
[id] { scroll-margin-top: var(--header-h); }

.breadcrumb { margin-bottom: 18px; }
.breadcrumb ol { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.breadcrumb li { font-size: 0.8rem; color: rgba(255,255,255,0.56); }
.breadcrumb li::after { content: "›"; margin-left: 6px; }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: rgba(255,255,255,0.72); transition: color var(--transition); }
.breadcrumb a:hover { color: white; text-decoration: none; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 60px 0; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 900; margin-bottom: 8px;
  letter-spacing: -0.025em;
}
.section-header p { color: var(--text-secondary); font-size: 1rem; }

/* ============================================================
   CALCULATOR SECTION — fluid bg
   ============================================================ */
.calculator-section {
  background:
    radial-gradient(ellipse 55% 60% at 96% 8%,  var(--primary-light)    0%, transparent 100%),
    radial-gradient(ellipse 45% 50% at 4%  92%,  var(--secondary-light)  0%, transparent 100%),
    var(--bg);
}
[data-theme="dark"] .calculator-section {
  background:
    radial-gradient(ellipse 55% 60% at 96% 8%,  var(--primary-light)    0%, transparent 100%),
    radial-gradient(ellipse 45% 50% at 4%  92%,  var(--secondary-light)  0%, transparent 100%),
    var(--bg);
}

/* MODE TABS */
.mode-tabs {
  display: flex; gap: 3px; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--radius);
  padding: 4px; margin-bottom: 22px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .mode-tabs { background: var(--surface-2); }
.tab-btn {
  flex: 1; min-width: 110px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 14px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-size: 0.83rem; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.tab-btn:hover { background: var(--primary-light); color: var(--primary); }
.tab-btn.active {
  background: var(--primary); color: white;
  box-shadow: var(--shadow-colored);
  font-weight: 700;
}

/* CALCULATOR LAYOUT */
.calculator-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 22px; align-items: start;
}

/* FORM PANEL */
.form-panel {
  background: var(--gradient-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 26px; box-shadow: var(--shadow-md);
}
[data-theme="dark"] .form-panel { box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.03); }

.mode-desc {
  background: var(--primary-light); color: var(--primary);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.835rem; margin-bottom: 18px;
  border-left: 3px solid var(--primary); line-height: 1.45;
}

/* FIELD GROUP */
.field-group { margin-bottom: 20px; }
.field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.835rem; font-weight: 700; color: var(--text);
  margin-bottom: 7px; letter-spacing: -0.005em;
}
.input-row { display: flex; gap: 7px; align-items: center; }
.input-with-prefix, .input-with-suffix {
  display: flex; align-items: center; flex: 1;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-with-prefix:focus-within,
.input-with-suffix:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
[data-theme="dark"] .input-with-prefix,
[data-theme="dark"] .input-with-suffix { background: var(--surface-2); }
.input-prefix, .input-suffix {
  padding: 0 10px; background: var(--surface-2);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 700;
  height: 40px; display: flex; align-items: center; user-select: none;
  border-right: 1px solid var(--border); flex-shrink: 0;
}
[data-theme="dark"] .input-prefix,
[data-theme="dark"] .input-suffix { background: rgba(255,255,255,0.04); border-color: var(--border); }
.input-suffix { border-right: none; border-left: 1px solid var(--border); }
.input-with-prefix input,
.input-with-suffix input {
  border: none; outline: none; background: transparent;
  padding: 8px 11px; font-size: 0.875rem; font-weight: 700;
  color: var(--text); width: 100%; height: 40px; font-family: inherit;
}
/* Ocultar spinners nativos del input number (se usan sliders en su lugar) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }
.select-input {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background-color: var(--surface); color: var(--text);
  padding: 0 34px 0 11px; height: 40px; font-size: 0.835rem; font-weight: 600;
  font-family: inherit; cursor: pointer; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.select-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-glow); }
[data-theme="dark"] .select-input {
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10l4 4 4-4'/%3E%3C/svg%3E");
}

/* SLIDERS */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--border); border-radius: 99px;
  outline: none; margin: 9px 0 4px; cursor: pointer;
}
[data-theme="dark"] .slider { background: var(--border); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary);
  border: 2.5px solid white;
  box-shadow: 0 2px 8px var(--primary-glow);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
[data-theme="dark"] .slider::-webkit-slider-thumb { border-color: var(--surface); }
.slider::-webkit-slider-thumb:hover { transform: scale(1.18); box-shadow: 0 3px 14px var(--primary-glow); }
.slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 2.5px solid white;
  box-shadow: 0 2px 8px var(--primary-glow); cursor: pointer;
}
.slider-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

/* TOOLTIP */
.tooltip-btn {
  background: none; border: none; color: var(--text-muted); padding: 0;
  position: relative; display: inline-flex; align-items: center;
  transition: color var(--transition);
}
.tooltip-btn:hover { color: var(--primary); }
.tooltip-text {
  display: none; position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(100% + 10px);
  background: var(--text); color: var(--surface);
  font-size: 0.76rem; font-weight: 400; border-radius: var(--radius-sm);
  padding: 10px 13px; width: 226px; text-align: left;
  z-index: 60; box-shadow: var(--shadow-md); line-height: 1.45;
}
.tooltip-text::after {
  content: ""; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--text);
}
.tooltip-btn:hover .tooltip-text,
.tooltip-btn:focus .tooltip-text { display: block; }

/* RADIO */
.radio-group { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 0.845rem; color: var(--text-secondary); cursor: pointer; }
.radio-label input[type="radio"] { accent-color: var(--primary); width: 15px; height: 15px; }

/* ADVANCED TOGGLE */
.advanced-toggle button {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  color: var(--text-secondary); font-size: 0.835rem; font-weight: 600;
  width: 100%; transition: all var(--transition);
}
.advanced-toggle button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chevron { margin-left: auto; transition: transform 0.22s; }
.advanced-fields { overflow: hidden; max-height: 0; transition: max-height 0.38s var(--ease); }
.advanced-fields.open { max-height: 900px; margin-top: 16px; }

/* FORM ACTIONS */
.form-actions {
  display: flex; gap: 7px; flex-wrap: wrap;
  padding-top: 16px; margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 0.845rem; font-weight: 700; border: none;
  transition: all var(--transition); text-decoration: none;
  white-space: nowrap; letter-spacing: -0.005em; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-colored); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 24px var(--primary-glow); }
.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white; box-shadow: var(--shadow-btn-secondary);
}
.btn-secondary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-btn-secondary-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.btn-sm { padding: 6px 13px; font-size: 0.775rem; border-radius: var(--radius-xs); }

/* ── Botones de acción del formulario — colores semánticos sobrios ── */
.btn-reset {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-reset:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-share {
  background: var(--teal-light);
  color: var(--teal);
  border: 1px solid rgba(8,145,178,0.25);
}
.btn-share:hover {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  box-shadow: 0 4px 14px var(--teal-light);
}
[data-theme="dark"] .btn-share {
  border-color: rgba(34,211,238,0.25);
}
.btn-save {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-primary-soft);
}
.btn-save:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-btn-primary);
}

/* ============================================================
   RESULTS PANEL
   ============================================================ */
.results-panel {
  background: var(--gradient-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 26px; box-shadow: var(--shadow-md);
}

/* MAIN RESULT — full gradient card */
.result-main {
  text-align: center; padding: 30px 22px;
  background: var(--gradient-result);
  border-radius: var(--radius); margin-bottom: 22px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-result);
}
[data-theme="dark"] .result-main { box-shadow: var(--shadow-result); }
.result-main::before {
  content: ""; position: absolute;
  top: -50%; right: -15%; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255,255,255,0.05); pointer-events: none;
}
.result-label { font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }
.result-value { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 900; color: white; line-height: 1; margin-bottom: 10px; letter-spacing: -0.025em; }
.result-sublabel { font-size: 0.74rem; color: rgba(255,255,255,0.5); }

/* RESULT GRID */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.result-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  padding: 12px; transition: all var(--transition); position: relative;
}
[data-theme="dark"] .result-card { background: var(--surface-2); }
.result-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
#cardContributed { border-left-color: var(--primary); }
#cardInterest    { border-left-color: var(--secondary); }
#cardInflation   { border-left-color: var(--accent); }
#cardTax         { border-left-color: var(--danger); }
#cardCommission  { border-left-color: var(--purple); }
#cardAfterTax    { border-left-color: var(--teal); }

.card-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon--blue   { background: var(--primary-light);   color: var(--primary); }
.card-icon--green  { background: var(--secondary-light); color: var(--secondary); }
.card-icon--amber  { background: var(--accent-light);    color: var(--accent); }
.card-icon--red    { background: var(--danger-light);    color: var(--danger); }
.card-icon--purple { background: var(--purple-light);    color: var(--purple); }
.card-icon--teal   { background: var(--teal-light);      color: var(--teal); }
.card-content { min-width: 0; }
.card-label { font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 2px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.card-value { font-size: 0.9rem; font-weight: 800; color: var(--text); }

/* RATIO BAR */
.ratio-bar-container { margin-bottom: 14px; }
.ratio-label { display: flex; justify-content: space-between; font-size: 0.77rem; margin-bottom: 6px; }
.ratio-contrib  { color: var(--primary);   font-weight: 700; }
.ratio-interest { color: var(--secondary); font-weight: 700; }
.ratio-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--border); }
.ratio-bar-contrib  { background: linear-gradient(90deg, var(--primary), var(--primary-alt)); transition: width 0.55s var(--ease); }
.ratio-bar-interest { background: linear-gradient(90deg, var(--secondary), var(--secondary-dark)); flex: 1; }
.ratio-pct { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.dot--blue  { background: var(--primary); }
.dot--green { background: var(--secondary); }

.microcopy {
  font-size: 0.8rem; color: var(--text-secondary);
  font-style: italic; margin-bottom: 14px;
  padding: 10px 13px; background: var(--surface-2);
  border-radius: var(--radius-sm); border-left: 3px solid var(--secondary);
  line-height: 1.45;
}
[data-theme="dark"] .microcopy { background: rgba(255,255,255,0.03); }
.export-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 4px; }

/* SAVED SIMULATIONS */
.saved-section {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 22px; margin-top: 18px;
  box-shadow: var(--shadow);
}
.saved-section h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 14px; }
.saved-list { display: flex; gap: 10px; flex-wrap: wrap; }
.saved-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 0.835rem; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all var(--transition);
}
.saved-item:hover { border-color: var(--primary); box-shadow: var(--shadow-colored); transform: translateY(-1px); }
.saved-item-name   { font-weight: 700; color: var(--text); }
.saved-item-detail { color: var(--text-secondary); font-size: 0.75rem; }
.saved-item-delete { background: none; border: none; color: var(--danger); padding: 0; margin-left: auto; opacity: 0.5; transition: opacity var(--transition); }
.saved-item-delete:hover { opacity: 1; }

/* ============================================================
   CHARTS SECTION — fluid bg
   ============================================================ */
.charts-section {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--primary-light) 0%, transparent 100%),
    var(--surface-2);
}
[data-theme="dark"] .charts-section {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--primary-light) 0%, transparent 100%),
    var(--bg);
}
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 28px; }
.chart-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 22px;
  box-shadow: var(--shadow); transition: box-shadow var(--transition), transform var(--transition);
}
[data-theme="dark"] .chart-card { background: var(--surface); }
.chart-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.chart-card--wide { grid-column: 1 / -1; }
.chart-header { margin-bottom: 16px; }
.chart-header h3 { font-size: 0.9rem; font-weight: 800; margin-bottom: 3px; letter-spacing: -0.01em; }
.chart-desc { font-size: 0.77rem; color: var(--text-secondary); }
.chart-wrapper { position: relative; }
.chart-wrapper--sm { max-height: 255px; }
.chart-wrapper--donut {
  display: flex;
  justify-content: center;
  align-items: center;
}
.chart-wrapper--donut canvas {
  max-width: 255px !important;
  max-height: 255px !important;
}

/* TABLE */
.table-section {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow);
}
.table-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
[data-theme="dark"] .table-header-row { background: var(--surface-2); }
.table-header-row h3 { font-size: 0.9rem; font-weight: 800; letter-spacing: -0.01em; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.835rem; }
thead { background: var(--surface-2); }
[data-theme="dark"] thead { background: rgba(255,255,255,0.03); }
th {
  padding: 11px 15px; text-align: right;
  font-weight: 700; font-size: 0.72rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
th:first-child, td:first-child { text-align: left; }
td {
  padding: 10px 15px; text-align: right; color: var(--text);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--bg); }
[data-theme="dark"] tbody tr:nth-child(even) { background: rgba(255,255,255,0.017); }
tbody tr:hover { background: var(--primary-light); }
.table-empty { text-align: center !important; color: var(--text-muted); padding: 36px !important; font-style: italic; }
.td-positive  { color: var(--secondary); font-weight: 700; }
.td-negative  { color: var(--danger); font-weight: 700; }
.td-highlight { font-weight: 800; color: var(--primary); }

/* ============================================================
   CONTENT SECTION
   ============================================================ */
.content-section { background: var(--bg); }
.content-container { display: grid; grid-template-columns: 1fr 310px; gap: 48px; align-items: start; }

.content-main h2 {
  font-size: 1.28rem; font-weight: 900; color: var(--text);
  margin: 42px 0 15px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em; position: relative;
}
.content-main h2::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 40px; height: 2px; background: var(--primary); border-radius: 2px;
}
.content-main h2:first-child { margin-top: 0; }
.content-main p { margin-bottom: 13px; color: var(--text-secondary); line-height: 1.7; }
.content-main ul { margin: 13px 0; }
.content-main ul li { padding: 6px 0 6px 20px; position: relative; color: var(--text-secondary); line-height: 1.62; }
.content-main ul li::before { content: "→"; position: absolute; left: 0; color: var(--primary); font-size: 0.85em; font-weight: 700; }
.content-main strong { color: var(--text); font-weight: 700; }

/* FORMULA BLOCK */
.formula-block {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: var(--radius-sm);
  padding: 20px 24px; margin: 20px 0; box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .formula-block { background: var(--surface-2); }
.formula { font-size: 1.05rem; font-family: 'Courier New', monospace; font-weight: 700; color: var(--primary); margin-bottom: 16px; line-height: 1.9; }
.formula sup { font-size: 0.68em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 3px; }
.frac .num { border-bottom: 1px solid; padding-bottom: 1px; font-size: 0.82em; }
.frac .den { font-size: 0.82em; }
.formula-legend { padding-left: 0; }
.formula-legend li { font-size: 0.855rem; padding: 3px 0; color: var(--text-secondary); }
.formula-legend li::before { display: none; }
.formula-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-top: 8px; }
code { font-family: 'Courier New', monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 0.83em; }

/* EXAMPLE BLOCK */
.example-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin: 20px 0; box-shadow: var(--shadow);
}
[data-theme="dark"] .example-block { background: var(--surface-2); }
.example-params { display: grid; grid-template-columns: repeat(2,1fr); border-bottom: 1px solid var(--border); }
.example-param {
  padding: 13px 18px; display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.example-param:nth-child(2),.example-param:nth-child(4) { border-right: none; }
.example-param span { font-size: 0.72rem; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.example-param strong { font-size: 0.95rem; color: var(--text); font-weight: 800; }
.example-result { padding: 20px; }
.example-result-main { display: flex; align-items: baseline; gap: 12px; margin-bottom: 13px; }
.example-result-main span { color: var(--text-secondary); font-size: 0.875rem; }
.example-result-main strong { font-size: 1.6rem; font-weight: 900; color: var(--secondary); letter-spacing: -0.025em; }
.example-breakdown { display: flex; gap: 18px; margin-bottom: 12px; font-size: 0.845rem; color: var(--text-secondary); }
.example-note { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

/* COMPARISON LIST */
.comparison-list { margin: 14px 0 !important; display: flex; flex-direction: column; gap: 7px; }
.comparison-list li {
  padding: 12px 16px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--primary) !important;
  border-radius: 9px !important;
  color: var(--text-secondary) !important;
  transition: all var(--transition);
}
[data-theme="dark"] .comparison-list li { background: var(--surface-2) !important; }
.comparison-list li::before { display: none !important; }
.comparison-list li:hover { border-left-color: var(--primary) !important; background: var(--primary-light) !important; }

/* ERRORS LIST — elegant, no counter badges */
.errors-list { display: flex; flex-direction: column; gap: 7px; }
.errors-list li {
  padding: 12px 16px 12px 16px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--danger) !important;
  border-radius: 9px !important;
  color: var(--text-secondary) !important;
  transition: all var(--transition);
  list-style: none;
}
[data-theme="dark"] .errors-list li { background: var(--surface-2) !important; }
.errors-list li::before { display: none !important; }
.errors-list li:hover { background: var(--danger-light) !important; }

.disclaimer-inline {
  background: var(--accent-light);
  border: 1px solid var(--accent); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 11px 15px;
  font-size: 0.8rem; color: var(--text-secondary); font-style: italic; margin-top: 14px;
}

/* SIDEBAR */
.content-sidebar { position: sticky; top: calc(var(--header-h) + 18px); }
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .sidebar-card { background: var(--surface-2); }
.sidebar-card h3 { font-size: 0.875rem; font-weight: 800; margin-bottom: 13px; letter-spacing: -0.01em; }
.sidebar-links { display: flex; flex-direction: column; gap: 2px; }
.sidebar-links a {
  padding: 7px 10px; border-radius: var(--radius-xs);
  font-size: 0.845rem; color: var(--text-secondary);
  transition: all var(--transition); font-weight: 500;
}
.sidebar-links a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; padding-left: 14px; }
/* Original .reference-table was the flex list in the home page. Scoped to
   <div> so it doesn't break when used as a <table class="reference-table">. */
div.reference-table { display: flex; flex-direction: column; }

/* Reference table style on the Rule-of-72 page (and any future cheat sheet
   table) — taller rows, brand-tinted header, monospace numbers. */
table.reference-table {
  font-size: 0.9rem;
}
table.reference-table thead {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
table.reference-table th {
  padding: 13px 18px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
table.reference-table td {
  padding: 13px 18px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
table.reference-table td:first-child {
  font-weight: 700;
  color: var(--primary);
}
table.reference-table tbody tr { transition: background var(--transition); }
table.reference-table tbody tr:hover { background: var(--primary-light); }
.ref-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.ref-row:last-child { border-bottom: none; }
.ref-row span { color: var(--text-secondary); }
.ref-row strong { color: var(--secondary); font-size: 0.875rem; font-weight: 800; }
.sidebar-note { font-size: 0.72rem; color: var(--text-muted); font-style: italic; margin-top: 11px; }

/* ============================================================
   FAQ SECTION — fluid bg
   ============================================================ */
.faq-section {
  background:
    radial-gradient(ellipse 60% 50% at 50% 100%, var(--primary-light) 0%, transparent 100%),
    var(--surface-2);
}
[data-theme="dark"] .faq-section {
  background:
    radial-gradient(ellipse 60% 50% at 50% 100%, var(--primary-light) 0%, transparent 100%),
    var(--surface);
}
.faq-list { max-width: 840px; margin: 0 auto; display: flex; flex-direction: column; gap: 7px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
[data-theme="dark"] .faq-item { background: var(--surface-2); }
.faq-item:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 17px 20px;
  background: none; border: none; text-align: left;
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  gap: 12px; transition: background var(--transition); letter-spacing: -0.005em;
}
.faq-question:hover { background: var(--primary-light); }
.faq-question[aria-expanded="true"] { color: var(--primary); }
.faq-icon { flex-shrink: 0; transition: transform 0.22s var(--ease); }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(180deg); }
.faq-answer {
  padding: 15px 20px 18px; font-size: 0.875rem;
  color: var(--text-secondary); line-height: 1.65;
  border-top: 1px solid var(--border);
}
.faq-answer p:not(:last-child) { margin-bottom: 8px; }

/* ============================================================
   DISCLAIMER
   ============================================================ */
.disclaimer-section { background: var(--bg); padding: 32px 0; }
.disclaimer-box {
  display: flex; gap: 16px;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 20px 24px;
  align-items: flex-start; box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .disclaimer-box { background: var(--surface-2); }
.disclaimer-box svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.disclaimer-box h2 { font-size: 0.9rem; font-weight: 800; margin-bottom: 5px; color: var(--text); }
.disclaimer-box p { font-size: 0.845rem; line-height: 1.55; color: var(--text-secondary); }

/* ============================================================
   FOOTER — minimal
   ============================================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
[data-theme="dark"] .site-footer { background: var(--surface-2); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .logo-brand { font-size: 0.88rem; }
.footer-brand .logo-tld   { font-size: 0.82rem; }
.footer-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.footer-nav a {
  font-size: 0.82rem; color: var(--text-secondary);
  padding: 4px 11px; border-radius: 6px; font-weight: 600;
  transition: all var(--transition);
}
.footer-nav a:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }
.footer-copy { font-size: 0.74rem; color: var(--text-muted); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--text); color: var(--surface);
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 0.845rem; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 1000;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.28s, transform 0.28s;
  pointer-events: none; max-width: 320px;
}
[data-theme="dark"] .toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   LEGAL PAGES
   ============================================================ */

.legal-content { padding: 56px 0; }
.legal-content .container { max-width: 800px; }
.legal-content h2 {
  font-size: 1.15rem; font-weight: 900; color: var(--text);
  margin: 36px 0 13px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.018em; position: relative;
}
.legal-content h2::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 34px; height: 2px; background: var(--primary); border-radius: 2px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { margin-bottom: 13px; color: var(--text-secondary); line-height: 1.7; }
.legal-content ul { margin: 13px 0 13px 18px; list-style: disc; }
.legal-content ul li { color: var(--text-secondary); margin-bottom: 6px; line-height: 1.62; }
.legal-content strong { color: var(--text); font-weight: 700; }
.legal-content a { color: var(--primary); }
.legal-notice {
  background: var(--primary-light); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: var(--radius-sm);
  padding: 15px 18px; margin-bottom: 32px;
  font-size: 0.855rem; color: var(--text-secondary); line-height: 1.55;
}
[data-theme="dark"] .legal-notice { background: rgba(77,163,255,0.07); border-color: var(--border); border-left-color: var(--primary); }
.legal-note-future {
  background: var(--accent-light); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius-sm);
  padding: 14px 18px; margin: 20px 0;
  font-size: 0.835rem; color: var(--text-secondary); line-height: 1.55;
  font-style: italic;
}
[data-theme="dark"] .legal-note-future { background: rgba(251,191,36,0.06); border-left-color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .calculator-layout  { grid-template-columns: 1fr; }
  .content-container  { grid-template-columns: 1fr; }
  .content-sidebar    { position: static; }
  .charts-grid        { grid-template-columns: 1fr; }
  .chart-card--wide   { grid-column: auto; }
}
/* Nav con 6 enlaces: reducir padding en pantallas medias */
@media (max-width: 960px) and (min-width: 769px) {
  .site-header nav > a { padding: 0 10px; font-size: 0.82rem; }
  .logo-brand { font-size: 0.85rem; }
}
@media (max-width: 768px) {
  /* ── Layout general ── */
  .section      { padding: 32px 0; }
  .container    { padding-left: 14px; padding-right: 14px; }

  /* ── Calculadora ── */
  .mode-tabs    { gap: 2px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .tab-btn      { min-width: auto; padding: 8px 9px; font-size: 0.77rem; flex-shrink: 0; }
  .tab-btn svg  { display: none; }
  .calculator-layout { gap: 16px; }
  .form-panel,.results-panel { padding: 14px; }
  .result-grid  { grid-template-columns: 1fr; }
  .example-params { grid-template-columns: 1fr; }

  /* ── Gráficos: evitar cortes ── */
  .charts-grid  { gap: 12px; }
  .chart-card   { overflow: hidden; }
  .chart-wrapper { position: relative; width: 100%; max-width: 100%; overflow: hidden; }
  .chart-wrapper canvas { max-width: 100% !important; }
  .chart-wrapper--sm { max-height: 220px; }

  /* ── Header nav: ocultar en escritorio, mostrar con hamburger ── */
  .site-header nav { display: none; }
  .header-sep   { display: none; }

  /* ── Menú móvil: fondo sólido, sin transparencias ── */
  .nav-hamburger { display: flex; }
  /* backdrop-filter crea un stacking context que rompe position:fixed en el menú */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header nav.mobile-open {
    display: flex;
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    height: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    padding: 12px 0 20px;
    flex-direction: column;
    gap: 0;
    z-index: 500;
    box-shadow: 0 16px 40px rgba(10,25,60,0.15);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  [data-theme="dark"] .site-header nav.mobile-open {
    box-shadow: 0 16px 40px rgba(0,0,0,0.7);
  }
  .site-header nav > a {
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 0;
    width: 100%;
    height: auto;
    border-bottom: none;
    border-left: 3px solid transparent;
    color: var(--text-secondary);
  }
  .site-header nav > a:hover,
  .site-header nav > a.active {
    border-bottom: none;
    border-left-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
  }
}
@media (max-width: 480px) {
  .form-actions  { flex-direction: column; }
  .btn           { justify-content: center; }
  .result-value  { font-size: 1.8rem; }
  .export-actions { flex-wrap: wrap; gap: 8px; }
  .result-main   { padding: 20px 16px; }
  .mode-tabs     { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .tab-btn       { flex-shrink: 0; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header,.hero,nav,.mode-tabs,.form-panel,
  .export-actions,.form-actions,.site-footer,
  .saved-section,.advanced-toggle,.theme-toggle,
  .breadcrumb,.faq-section,.disclaimer-section { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .section { padding: 14px 0; break-inside: avoid; }
  .results-panel { box-shadow: none; border: 1px solid #ccc; }
  .result-main { background: var(--primary-dark) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .chart-card { break-inside: avoid; }
  table { font-size: 9pt; }
  .container { max-width: 100%; padding: 0 8px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.09s; }
.reveal-d2 { transition-delay: 0.18s; }
.reveal-d3 { transition-delay: 0.27s; }
.reveal-d4 { transition-delay: 0.36s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   HERO CHART VISUAL
   ============================================================ */
.hero-visual {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 195px; pointer-events: none; z-index: 0; overflow: hidden;
}
.hero-visual svg { width: 100%; height: 100%; }
@media (max-width: 768px) { .hero-visual { height: 130px; opacity: 0.45; } }

/* ============================================================
   NAV HAMBURGER
   ============================================================ */


.nav-hamburger {
  display: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px; color: var(--text-secondary);
  align-items: center; cursor: pointer;
  transition: all var(--transition); flex-shrink: 0; margin-left: auto;
}
.nav-hamburger:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ============================================================
   CALCULATOR SUB-PAGES — shared styles
   ============================================================ */

/* ── Calc hero two-column layout ── */

@media (max-width: 860px) {  }

.calc-section { padding: 52px 0; background: var(--bg); }
.calc-section .section-header { margin-bottom: 30px; }
.calc-layout {
  display: grid; grid-template-columns: 400px 1fr;
  gap: 22px; align-items: start;
}
@media (max-width: 960px) { .calc-layout { grid-template-columns: 1fr; } }

/* ============================================================
   CALC-INFO — sección informativa inferior de sub-páginas
   ============================================================ */
.calc-info {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 0 64px;
}
[data-theme="dark"] .calc-info { background: var(--surface-2); }

.calc-info-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.calc-info h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.calc-info h2:not(:first-child) { margin-top: 36px; }

.calc-info p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.calc-info ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calc-info ul li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.935rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.calc-info ul li::before {
  content: "→";
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

@media (max-width: 768px) {
  .calc-info { padding: 36px 0 44px; }
  .calc-info-container { padding: 0 14px; }
  .calc-info h2 { font-size: 1.1rem; }
  .calc-info p, .calc-info ul li { font-size: 0.9rem; }
}

/* ============================================================
   PREMIUM DESIGN ENHANCEMENTS
   ============================================================ */

/* ── @keyframes ── */
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
@keyframes shimmer-sweep {
  0%   { transform: translateX(-120%) skewX(-20deg); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateX(300%) skewX(-20deg); opacity: 0; }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-14px) scale(1.04); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-result); }
  50%       { box-shadow: var(--shadow-btn-primary-hover), 0 0 60px var(--primary-light); }
}
@keyframes stat-land {
  0%   { transform: scale(1)    translateY(0); opacity: 1; }
  38%  { transform: scale(1.18) translateY(-3px);
         text-shadow: 0 0 18px rgba(147,197,253,0.95), 0 0 36px rgba(110,231,183,0.55); }
  72%  { transform: scale(1.04) translateY(-1px); }
  100% { transform: scale(1)    translateY(0);
         text-shadow: 0 0 0px transparent; }
}
.stat-number.stat-done {
  animation: stat-land 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Section badge — small pill above headings ── */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-primary-soft);
  border-radius: 99px;
  padding: 4px 15px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
[data-theme="dark"] .section-badge {
  border-color: var(--border-primary-soft);
}

/* Gradient underline accent under section headings */
.section-header::after {
  content: '';
  display: block;
  width: 52px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-radius: 99px;
  margin: 12px auto 0;
}

/* ── Calculator section: richer ambient light ── */
.calculator-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 70% at 98%  2%,  var(--primary-light)    0%, transparent 100%),
    radial-gradient(ellipse 45% 55% at 2%  98%,  var(--teal-light)       0%, transparent 100%),
    radial-gradient(ellipse 30% 40% at 50% 50%,  var(--secondary-light)  0%, transparent 100%),
    var(--bg);
}
[data-theme="dark"] .calculator-section {
  background:
    radial-gradient(ellipse 55% 70% at 98%  2%,  var(--primary-light)    0%, transparent 100%),
    radial-gradient(ellipse 45% 55% at 2%  98%,  var(--teal-light)       0%, transparent 100%),
    radial-gradient(ellipse 30% 40% at 50% 50%,  var(--secondary-light)  0%, transparent 100%),
    var(--bg);
}
.calculator-section::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 440px; height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 68%);
  pointer-events: none;
  animation: float-slow 9s ease-in-out infinite;
}
.calculator-section::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-light) 0%, transparent 68%);
  pointer-events: none;
  animation: float-slow 11s ease-in-out infinite reverse;
}

/* ── Mode tabs: gradient active state ── */
.tab-btn.active {
  background: var(--gradient-tab-active);
  box-shadow: var(--shadow-tab);
}
[data-theme="dark"] .tab-btn.active {
  background: var(--gradient-tab-active);
}

/* ── Primary button: gradient + shimmer on hover ── */
.btn-primary {
  background: var(--gradient-btn-primary);
  box-shadow: var(--shadow-btn-primary);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-18deg);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 55%, var(--teal) 100%);
  box-shadow: var(--shadow-btn-primary-hover);
  transform: translateY(-2px);
}
.btn-primary:hover::after {
  animation: shimmer-sweep 0.65s ease forwards;
}
.btn-primary:active { transform: translateY(0); }

/* ── Form & Results panels: hover glow border ── */
.form-panel,
.results-panel {
  transition: box-shadow 0.35s ease, transform 0.25s ease;
}
.form-panel:hover,
.results-panel:hover {
  box-shadow: var(--shadow-lg), var(--glow-panel);
}
[data-theme="dark"] .form-panel:hover,
[data-theme="dark"] .results-panel:hover {
  box-shadow: var(--shadow-lg), var(--glow-panel);
}

/* ── Result main: shimmer diagonal + pulse ── */
.result-main {
  animation: pulse-glow 4s ease-in-out infinite;
}
.result-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0) 20%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0) 80%
  );
  pointer-events: none;
  border-radius: inherit;
}

/* ── Chart cards: accent bar on top + stronger hover ── */
.chart-card {
  position: relative;
}
.chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--teal), transparent);
  border-radius: 0 0 99px 99px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.chart-card:hover::before { opacity: 1; }
.chart-card:hover {
  box-shadow: var(--shadow-lg), var(--glow-chart);
  transform: translateY(-4px);
}

/* ── FAQ items: premium hover ── */
.faq-item:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(37,99,235,0.14);
}

/* ── Saved items: richer hover ── */
.saved-item:hover {
  box-shadow: var(--shadow-colored), 0 0 0 1px rgba(37,99,235,0.18);
  transform: translateY(-2px);
}

/* ── Input focus: stronger glow ring ── */
.input-with-prefix:focus-within,
.input-with-suffix:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.select-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ── Slider thumb: larger + stronger glow ── */
.slider::-webkit-slider-thumb {
  width: 20px; height: 20px;
  box-shadow: 0 2px 10px var(--primary-glow), 0 0 0 2.5px white;
}
[data-theme="dark"] .slider::-webkit-slider-thumb {
  box-shadow: 0 2px 10px var(--primary-glow), 0 0 0 2.5px var(--surface);
}
.slider::-webkit-slider-thumb:hover {
  transform: scale(1.28);
  box-shadow: 0 4px 20px var(--primary-glow), 0 0 0 2.5px white;
}

/* ── Ratio bar: slightly thicker ── */
.ratio-bar { height: 10px; }

/* ── Result card: bigger icon area ── */
.card-icon { width: 36px; height: 36px; border-radius: 10px; }

/* ── Mode desc: gradient tint ── */
.mode-desc {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--teal-light) 100%);
}

/* ── Calc-info h2: gradient text ── */
.calc-info h2 {
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 65%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Footer: always-dark premium ── */
.site-footer {
  background: var(--gradient-footer);
  border-top: 1px solid var(--border-footer);
  padding: 36px 0;
}
[data-theme="dark"] .site-footer {
  background: var(--gradient-footer);
  border-top-color: var(--border-footer);
}
.site-footer .logo-brand { color: rgba(255,255,255,0.88); }
.site-footer .logo-tld   { color: var(--footer-accent); }
.footer-nav a { color: rgba(255,255,255,0.44); }
.footer-nav a:hover {
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.07);
  text-decoration: none;
}
.footer-copy { color: rgba(255,255,255,0.24); }

/* ── Logo: glow pulse on hover ── */
.logo:hover svg {
  box-shadow: 0 0 0 3px var(--primary-glow), 0 4px 16px rgba(0,0,0,0.3);
}

/* ── Header accent line: gradient ── */
.site-header::after {
  opacity: 0.7;
}

/* ── Nav active link: pill bg ── */
.site-header nav > a.active {
  background: var(--primary-light);
  border-radius: var(--radius-xs);
}

/* ── Theme toggle: richer hover ── */
.theme-toggle:hover {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ── Disclaimer box: gradient left border ── */
.disclaimer-box {
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--accent), var(--accent-alt)) 1;
}

/* ── Table rows: richer hover ── */
tbody tr:hover {
  background: var(--primary-light);
  transition: background 0.12s ease;
}

/* ── Microcopy block ── */
.microcopy {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--teal-light) 100%);
}

/* ── Advanced toggle button ── */
.advanced-toggle button:hover {
  box-shadow: var(--glow-toggle);
}

@media (max-width: 768px) {
  .calculator-section::before,
  .calculator-section::after { display: none; }
}

/* More breathing room between microcopy text and the section around it */
.microcopy {
  margin-top: 18px;
}

/* ============================================================
   MOBILE EXCELLENCE — Touch, Motion & Visual Polish
   ============================================================ */

/* ── Respect prefers-reduced-motion for ALL animations ── */
@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero-em { animation: none !important; }


  .stat-number.stat-done { animation: none !important; }
  .hero-mockup-fill, .hero-mockup-bar { animation: none !important; transform: none !important; }
  .calculator-section::before,
  .calculator-section::after { animation: none !important; }
  .result-main { animation: none !important; }
}

/* ── Touch devices: disable hover lifts (prevents tap-triggered jump) ── */
@media (hover: none) {
  .chart-card:hover       { transform: none; box-shadow: var(--shadow); }
  .chart-card:hover::before { opacity: 0; }
  .result-card:hover      { transform: none; box-shadow: none; }
  .form-panel:hover,
  .results-panel:hover    { box-shadow: var(--shadow-md); }
  .btn-primary:hover      { transform: none; }
  .btn-primary:active     { transform: scale(0.97); }
  .btn-secondary:hover    { transform: none; filter: none; }
  .btn-ghost:hover        { transform: none; }
  .saved-item:hover       { transform: none; }
  .faq-item:hover         { box-shadow: var(--shadow-sm); }
  .calculator-section::before,
  .calculator-section::after { display: none; }
}

/* ── Tap highlight color ── */
* { -webkit-tap-highlight-color: var(--tap-highlight); }

/* ── Mobile touch target & visual improvements ── */
@media (max-width: 768px) {
  /* Inputs: 44px minimum touch target */
  .input-with-prefix input,
  .input-with-suffix input { height: 44px; font-size: 1rem; }
  .input-prefix, .input-suffix { height: 44px; }
  .select-input { height: 44px; font-size: 0.9rem; }

  /* Sliders: thicker track */
  .slider { height: 6px; }

  /* Tab buttons: taller touch targets */
  .tab-btn { padding: 10px 10px; min-height: 40px; }

  /* Section header: less bottom margin */
  .section-header { margin-bottom: 22px; }
  .section-header h2 { font-size: clamp(1.2rem, 4.5vw, 1.6rem); }

  /* Hero: stack on mobile */
  .hero { padding: 20px 0 16px; }
  .hero-top { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
  .hero-h1 { font-size: clamp(1.3rem, 5.5vw, 1.7rem); }
  .hero-subtitle { font-size: 0.82rem; }

  /* Calc-hero: more compact on mobile */



  /* Result main: more padding breathing room */
  .result-main { padding: 24px 18px; }

  /* Chart cards: no border-radius clip issue */
  .chart-card { border-radius: var(--radius); }

  /* Form actions: full-width buttons */
  .form-actions .btn { flex: 1; justify-content: center; min-height: 44px; }

  /* FAQ question: bigger touch */
  .faq-question { padding: 16px 16px; }

  /* Mode-desc: smaller padding */
  .mode-desc { padding: 8px 12px; font-size: 0.82rem; }

  /* Hamburger: must be set AFTER the global display:none rule */
  .nav-hamburger { display: flex; }
}

/* ── Small phones (≤400px) ── */
@media (max-width: 400px) {
  .mode-tabs { gap: 1px; }
  .tab-btn   { padding: 9px 7px; font-size: 0.73rem; }
  .result-value { font-size: 1.7rem; }
  .form-panel, .results-panel { padding: 12px; }
  .result-main { padding: 18px 13px; }
  .hero { padding: 16px 0 14px; }
  .hero-h1 { font-size: 1.2rem; }
}

/* ============================================================
   COMPARE MODE PANEL
   ============================================================ */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.compare-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 12px 14px;
  text-align: center;
  background: var(--surface);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), box-shadow var(--transition);
  cursor: pointer;
  user-select: none;
}
.compare-card:hover { transform: translateY(-2px); }
.compare-card--dimmed {
  opacity: 0.28;
  transform: scale(0.97) !important;
  filter: grayscale(0.25);
}
[data-theme="dark"] .compare-card { background: var(--surface-2); }
.compare-card--medio {
  border-color: var(--primary);
  background: linear-gradient(160deg, var(--primary-light) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-colored);
  position: relative;
}
.compare-card--medio::before {
  content: '★ Recomendado';
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: white;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 99px; white-space: nowrap;
}
.compare-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 3px;
}
.compare-card--medio    .compare-label  { color: var(--primary); }
.compare-card--optimista .compare-label { color: var(--secondary); }
.compare-rate {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted); margin-bottom: 10px;
}
.compare-card--medio    .compare-rate   { color: var(--primary); opacity: 0.8; }
.compare-card--optimista .compare-rate  { color: var(--secondary); opacity: 0.8; }
.compare-value {
  font-size: 1.1rem; font-weight: 900; color: var(--text);
  letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 6px;
}
.compare-card--medio    .compare-value  { color: var(--primary); font-size: 1.25rem; }
.compare-card--optimista .compare-value { color: var(--secondary); }
.compare-detail {
  font-size: 0.68rem; color: var(--text-muted); line-height: 1.4;
}
@media (max-width: 540px) {
  .compare-grid { grid-template-columns: 1fr; gap: 14px; }
  .compare-card--medio { margin-top: 10px; }
}

/* ============================================================
   FIXES: buttons, gradient text, mobile hero
   ============================================================ */

/* Form actions: 3 buttons always on same line, equal width */
.form-actions { flex-wrap: nowrap; }
.form-actions .btn { flex: 1; justify-content: center; min-width: 0; }

/* Gradient text on content section headings (index.html) */
.content-main h2 {
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 60%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .content-main h2 {
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 55%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── Contact page ────────────────────────────────────────────── */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
  align-items: start;
  padding-bottom: 56px;
}
@media (max-width: 680px) {
  .contact-container { grid-template-columns: 1fr; }
}
.contact-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.contact-card h2 {
  font-size: 1.08rem; font-weight: 700; color: var(--text);
  margin: 0 0 8px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.contact-card > p { color: var(--text-secondary); font-size: 0.87rem; line-height: 1.65; margin: 10px 0 18px; }
.contact-field { margin-bottom: 13px; }
.contact-field label { display: block; font-size: 0.79rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.contact-field input,
.contact-field textarea {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text); font-size: 0.88rem; font-family: var(--font);
  transition: border-color var(--transition);
}
.contact-field input:focus,
.contact-field textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-glow); }
.contact-field textarea { min-height: 108px; resize: vertical; }
.contact-status {
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 0.86rem; font-weight: 600; margin-top: 12px;
}
.contact-status--ok { background: var(--secondary-light); color: var(--secondary); }
.contact-status--err { background: var(--danger-light); color: var(--danger); }
.contact-card--donate { text-align: center; }
.donate-icon { font-size: 2.6rem; margin: 6px 0 14px; line-height: 1; }
.donate-note { font-size: 0.79rem; color: var(--text-muted); margin-top: 14px; }
.btn-paypal { background: var(--paypal); border-color: var(--paypal); gap: 8px; }
.btn-paypal:hover { background: var(--paypal-hover); border-color: var(--paypal-hover); }

/* ── AFFILIATE BLOCK ── */
.affiliate-block {
  margin-top: 20px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
[data-theme="dark"] .affiliate-block {
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.affiliate-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px 10px 14px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}
.affiliate-eyebrow {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.73rem; font-weight: 700; color: var(--primary);
}
.affiliate-disclaimer {
  font-size: 0.58rem; color: var(--text-muted); white-space: nowrap;
}
.affiliate-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
}
.affiliate-item:last-child { border-bottom: none; }
.affiliate-item:hover { background: var(--primary-light); text-decoration: none; }
.affiliate-badge {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.affiliate-badge img { width: 28px; height: 28px; object-fit: contain; }
.affiliate-info { flex: 1; min-width: 0; }
.affiliate-scenario {
  display: block; font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 2px;
}
.affiliate-name { display: block; font-size: 0.86rem; font-weight: 700; color: var(--text); }
.affiliate-desc {
  display: block; font-size: 0.71rem; color: var(--text-muted); margin-top: 3px; line-height: 1.4;
}
.affiliate-cta-btn {
  flex-shrink: 0; font-size: 0.73rem; font-weight: 700;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary);
  color: var(--primary); background: transparent; white-space: nowrap;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.affiliate-item:hover .affiliate-cta-btn {
  background: var(--primary); color: #fff; transform: translateY(-1px);
}
/* Footer coffee link */
.footer-coffee {
  color: var(--text-muted); font-size: inherit;
  transition: color var(--transition);
  text-decoration: none;
}
.footer-coffee:hover { color: var(--primary); }
@media (max-width: 500px) {
  .affiliate-item { flex-wrap: wrap; }
  .affiliate-cta-btn { width: 100%; text-align: center; margin-top: 6px; }
}

/* ── Hero sponsors strip ── */
.hero-sponsors {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.hero-sponsors-label {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.7;
  margin-right: 2px;
}
.hero-sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0.55;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  overflow: hidden;
}
.hero-sponsor:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.hero-sponsor img { width: 16px; height: 16px; object-fit: contain; }

/* ---------- Guides hub (/guias) ---------- */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.9rem 1.7rem 1.7rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  /* accent vars, overridden per card */
  --gc: var(--primary);
  --gc-bg: var(--primary-light);
  --gc-shadow: rgba(37, 99, 235, 0.22);
  transition: transform .28s cubic-bezier(.34,1.4,.64,1), box-shadow .28s ease, border-color .28s ease;
}
.guide-card--blue  { --gc: var(--primary); --gc-bg: var(--primary-light); --gc-shadow: rgba(37,99,235,0.22); }
.guide-card--teal  { --gc: var(--teal);    --gc-bg: var(--teal-light);    --gc-shadow: rgba(8,145,178,0.22); }
.guide-card--amber { --gc: var(--accent);  --gc-bg: var(--accent-light);  --gc-shadow: rgba(217,119,6,0.22); }
.guide-card-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gc);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.guide-card:hover,
.guide-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px var(--gc-shadow), 0 8px 16px rgba(8,20,55,0.06);
  border-color: transparent;
  outline: none;
}
.guide-card:hover .guide-card-bar,
.guide-card:focus-visible .guide-card-bar { transform: scaleX(1); }
.guide-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  border-radius: 15px;
  background: var(--gc-bg);
  color: var(--gc);
  margin-bottom: 1.15rem;
  transition: transform .28s cubic-bezier(.34,1.4,.64,1);
}
.guide-card-icon svg { width: 27px; height: 27px; }
.guide-card:hover .guide-card-icon { transform: scale(1.08) rotate(-3deg); }
.guide-card-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc);
  margin-bottom: 0.5rem;
}
.guide-card-title {
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
  transition: color .2s ease;
}
.guide-card:hover .guide-card-title { color: var(--gc); }
.guide-card-desc {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.4rem;
}
.guide-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gc);
}
.guide-card-arrow { width: 17px; height: 17px; transition: transform .25s ease; }
.guide-card:hover .guide-card-arrow { transform: translateX(5px); }

/* Closing CTA → calculators */
.guides-cta-section { padding: 1rem 0 4rem; }
.guides-cta {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--primary-light) 100%);
  border: 1px solid var(--border-primary-subtle);
  border-radius: 22px;
  padding: 2.4rem 1.6rem;
}
.guides-cta-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.guides-cta-sub {
  font-size: 0.97rem;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}
.guides-cta-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.guides-cta-chips a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border-primary-soft);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.guides-cta-chips a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* Related guides at the end of each calculator's content */
.related-guides {
  margin-top: 2.4rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--border);
}
.related-guides h2 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.related-guides-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.related-guides-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--border-primary-subtle);
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.related-guides-links a::after {
  content: "→";
  font-weight: 700;
  transition: transform .2s ease;
}
.related-guides-links a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-colored);
}
.related-guides-links a:hover::after { transform: translateX(3px); }

/* ============================================================
   PRO POLISH  (2026-06-03)
   Tasteful refinements layered on top of the existing system.
   Token-level shadow calming lives in :root above; this block adds
   the additive touches. Designed to be easy to review/revert.
   ============================================================ */

/* 1 ─ Tabular figures. Numbers line up in columns — the single most
   recognisable trait of a serious financial tool. */
.result-value, .result-main-value, .card-value, .compare-rate, .compare-value,
.example-result, .example-result-main, .seo-stat-num, .seo-stat-count, .num,
td, th, input[type="number"], output, .formula {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv01" 1, "ss01" 1;
}

/* 2 ─ Typographic finishing. Balance headings (no lonely last word),
   prettify body copy (no orphans, better hyphenation breaks). */
h1, h2, h3, .seo-hero-h1, .seo-hero-h1-sub, .result-label {
  text-wrap: balance;
}
p, li, .seo-hero-sub, .compare-detail, .result-sublabel {
  text-wrap: pretty;
}

/* 3 ─ Drop the gradient text. Solid colour reads as more confident and
   avoids the "AI gradient" tell; keeps the brand blue as the accent. */
.seo-hero-h1 em, .hero-em, .seo-stat-num--text {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

/* 4 ─ Accessible keyboard focus. Visible only for keyboard users, so it
   never interferes with mouse styling. */
a:focus-visible, button:focus-visible, [role="tab"]:focus-visible,
.tab-btn:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* 5 ─ Tactile press feedback. A tiny push on click makes buttons feel
   physical. transform is GPU-friendly and won't reflow. */
.seo-hero-btn, .seo-hero-cta, .tab-btn, .btn, .action-btn, .currency-toggle,
.lang-toggle, .theme-toggle, .icon-btn {
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}
.seo-hero-btn:active, .seo-hero-cta:active, .tab-btn:active, .btn:active,
.action-btn:active, .currency-toggle:active, .lang-toggle:active,
.theme-toggle:active, .icon-btn:active {
  transform: translateY(1px) scale(0.985);
}

/* 6 ─ Whisper of film grain on the hero. Kills the flat-vector sterility
   without reading as "texture". Sits behind the content (z-index 1). */
.seo-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] .seo-hero::after { opacity: 0.07; }

/* ── Crédito NORVEXS (logo negro, se invierte a blanco en modo oscuro) ── */
.norvexs-credit { border-top: 1px solid var(--border); padding: 2.5rem 0; background: var(--surface); }
.norvexs-credit .container { display: flex; align-items: center; justify-content: center; }
.norvexs-credit__link { display: inline-flex; align-items: center; gap: 0.875rem; text-decoration: none; opacity: 0.7; transition: opacity 0.2s ease; }
.norvexs-credit__link:hover { opacity: 1; }
.norvexs-credit__link span { font-size: 0.875rem; color: var(--text-muted); }
.norvexs-credit__link img { height: 1.5rem; width: auto; }
[data-theme="dark"] .norvexs-credit__link img { filter: invert(1); }

/* ============================================================
   PRO POLISH — round 2 (2026-06-03)
   Two targeted refinements where the page reads as a stock SaaS template:
   the hero badge and the active tab. Token-level, easy to revert.
   ============================================================ */

/* 7 ─ Hero badge. Was the generic "FREE TOOL · NO SIGNUP" green pill.
   Reworked as a refined outlined tag with a small signal dot and a
   monospace label — reads as data tool, not a marketing trial banner. */
.seo-hero-badge {
  background: transparent;
  border: 1px solid rgba(5,150,105,0.28);
  border-radius: 8px;
  padding: 5px 11px 5px 9px;
  font-family: ui-monospace, 'SF Mono', Menlo, 'Cascadia Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--secondary-dark);
}
.seo-hero-badge svg { display: none; }
.seo-hero-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--secondary);
  margin-right: 7px;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.16);
}
[data-theme="dark"] .seo-hero-badge {
  border-color: rgba(52,211,153,0.30);
  color: var(--secondary);
}
[data-theme="dark"] .seo-hero-badge::before {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52,211,153,0.20);
}

/* 9 ─ Article meta (byline + last updated). Small editorial line under the
   guide H1/sub, gray, with separator dots. Reinforces E-E-A-T for YMYL. */
.article-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.article-meta strong { color: var(--text-secondary); font-weight: 600; }
.article-meta time { font-variant-numeric: tabular-nums; }
.article-meta .article-sep { opacity: 0.5; }
.article-author-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; transition: color var(--transition), border-color var(--transition); }
.article-author-link:hover { color: var(--primary); border-bottom-color: var(--primary); }
.article-author-link strong { color: inherit; }

/* Container narrow used by /sobre — readable measure for prose. */
.container--narrow { max-width: 720px; }
.calc-info ul li { margin-bottom: 6px; }

/* Author card — appears at the end of each guide; reinforces who wrote it,
   gives one last E-E-A-T signal and an internal link out. */
.author-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 32px;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  text-align: left;
}
.author-card-avatar {
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gradient-result);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  overflow: hidden;            /* clip the photo into a circle */
  box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3px var(--border);
}
.author-card-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* /sobre bio block — portrait next to the bio paragraph. */
.author-bio-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 14px 0 22px;
}
.author-bio-block .author-portrait {
  flex-shrink: 0;
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 4px var(--border), 0 8px 24px -8px rgba(11,28,85,0.18);
}
.author-bio-block p { margin: 0; }
@media (max-width: 600px) {
  .author-bio-block { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
  .author-bio-block .author-portrait { width: 120px; height: 120px; }
}
.author-card-body { flex: 1; min-width: 0; }
.author-card-eyebrow {
  font-size: 0.66rem;
  font-family: ui-monospace, 'SF Mono', Menlo, 'Cascadia Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.author-card-name {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
}
.author-card-name a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: color var(--transition), border-color var(--transition);
}
.author-card-name a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.author-card-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 6px;
  line-height: 1.55;
}
.author-card-links {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.author-card-links a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color var(--transition), border-color var(--transition);
}
.author-card-links a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* Glossary list — definition pairs with a left rule. */
.glossary { margin: 24px 0 36px; }
.glossary dt {
  font-weight: 700;
  color: var(--text);
  margin-top: 22px;
  font-size: 1.02rem;
  line-height: 1.35;
}
.glossary dt dfn { font-style: normal; }
.glossary dt em {
  font-style: normal;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  margin-left: 4px;
}
.glossary dd {
  margin: 6px 0 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}
.glossary dd a { color: var(--primary); border-bottom: 1px dotted var(--primary); text-decoration: none; }
.glossary dd a:hover { color: var(--primary-dark); }

/* HowTo step list — used in the "Tu primer mes" section of the guide.
   Numbered with the inherent <ol> counter, with a tinted left rule. */
.howto-steps {
  list-style: none;
  counter-reset: howto;
  padding: 0;
  margin: 18px 0 28px;
}
.howto-steps > li {
  counter-increment: howto;
  position: relative;
  padding: 14px 16px 14px 56px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
}
.howto-steps > li::before {
  content: counter(howto, decimal-leading-zero);
  position: absolute;
  left: 14px;
  top: 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, 'Cascadia Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.howto-steps > li strong {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  margin-bottom: 4px;
  font-weight: 700;
}
.howto-steps > li p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 8 ─ Active tab. Replace the flat saturated halo with the calibrated
   tab shadow + a thin inner top highlight (glass edge) and a hairline
   bottom indicator. Reads as crafted instead of "default filled pill". */
.tab-btn.active {
  box-shadow:
    var(--shadow-tab),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -2px 0 rgba(11,28,85,0.18);
}

