/* ============================================================
   Amortiza — styles.css
   Arquetipo: Glassmorphism Modern (finanzas con cara amable)
   ============================================================ */

:root {
  --bg:        #f5f2ec;
  --glass:     rgba(255, 255, 255, 0.55);
  --glass-2:   rgba(255, 255, 255, 0.30);
  --ink:       #1f2937;
  --ink-soft:  #4b5563;
  --ink-mute:  #8a8f98;
  --accent:    #6366f1;   /* índigo suave */
  --accent-2:  #ff7a59;   /* coral */
  --ok:        #16a34a;
  --warn:      #d97706;
  --bad:       #dc2626;
  --line:      rgba(31, 41, 55, 0.12);
  --radius:    24px;
  --shadow:    0 24px 60px -24px rgba(31, 41, 55, 0.25);
  --font-d:    "Plus Jakarta Sans", system-ui, sans-serif;
  --font-b:    "Inter", system-ui, sans-serif;
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-b);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Fondo mesh animado ---------- */
.mesh {
  position: fixed; inset: -20%;
  z-index: -1;
  background:
    radial-gradient(at 18% 25%, rgba(189, 178, 255, 0.55) 0%, transparent 50%),
    radial-gradient(at 82% 20%, rgba(255, 214, 165, 0.5) 0%, transparent 50%),
    radial-gradient(at 55% 85%, rgba(174, 226, 255, 0.55) 0%, transparent 55%);
  filter: blur(70px) saturate(140%);
  animation: meshDrift 32s ease-in-out infinite;
  pointer-events: none;
}
@keyframes meshDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.18) rotate(8deg); }
}

/* ---------- Glass base ---------- */
.glass {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@supports (backdrop-filter: blur(20px)) {
  .glass {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
  z-index: 50;
  border-radius: 999px;
}
.nav-brand {
  font-family: var(--font-d); font-weight: 800; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.nav-logo { display: inline-block; flex-shrink: 0; }
.nav-links { position: relative; display: flex; gap: 4px; }
.nav-links a {
  position: relative; z-index: 1;
  color: var(--ink-soft); text-decoration: none;
  font-size: 0.92rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
  transition: color 0.25s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-underline {
  position: absolute; bottom: 4px; height: 2px;
  background: var(--accent); border-radius: 2px;
  opacity: 0; transition: all 0.3s var(--ease-out);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-d); font-weight: 700; font-size: 1rem;
  padding: 14px 28px; border-radius: 999px; border: none; cursor: pointer;
  text-decoration: none; transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s;
  will-change: transform;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(99, 102, 241, 0.7); }
.btn-ghost {
  background: rgba(255,255,255,0.6);
  color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { background: #fff; transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* ---------- Layout ---------- */
.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto; padding: 96px 0 32px;
}
.kicker {
  font-family: var(--font-d); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em; line-height: 1.15;
  margin-bottom: 12px;
}
.section-sub { color: var(--ink-soft); max-width: 60ch; margin-bottom: 40px; }
.card { padding: 32px; }

/* ---------- Hero ---------- */
.hero {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100svh;
  display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 48px;
  padding-top: 96px;
}
.hero-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 20px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--ink-soft); font-size: 1.12rem; max-width: 52ch; margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.hero-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-chips li {
  font-size: 0.85rem; font-weight: 500; color: var(--ink-soft);
  background: rgba(255,255,255,0.55); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
}
.hero-card {
  padding: 36px; text-align: center;
  animation: floatY 6s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
.hero-card-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-card-value {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(2.4rem, 4vw, 3.2rem); letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 8px 0;
}
.hero-card-foot { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Simulador ---------- */
.sim-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: start; }

.field { margin-bottom: 26px; }
.field:last-child { margin-bottom: 0; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.field-head label { font-weight: 600; font-size: 0.95rem; }
.field-head label .opt { font-weight: 400; color: var(--ink-mute); font-size: 0.82rem; }
.field-head output {
  font-family: var(--font-d); font-weight: 800; font-size: 1.05rem; color: var(--accent);
  white-space: nowrap;
}
.field-value-input {
  font-family: var(--font-d); font-weight: 800; font-size: 1.05rem; color: var(--accent);
  white-space: nowrap; text-align: right;
  border: 1px solid transparent; background: transparent; outline: none;
  width: 9ch; padding: 2px 6px; border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}
.field-value-input::placeholder { color: var(--ink-mute); font-weight: 600; }
.field-value-input:hover { background: rgba(99,102,241,0.06); }
.field-value-input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.field-scale, .field-note { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-mute); margin-top: 6px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 50%), rgba(31,41,55,0.12) var(--fill, 50%));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
  transition: transform 0.2s var(--ease-out);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: rgba(31,41,55,0.06); padding: 6px; border-radius: 16px; }
.toggle-btn {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font-d); font-weight: 600; font-size: 0.95rem; color: var(--ink-soft);
  padding: 12px; border-radius: 12px;
  transition: all 0.25s var(--ease-out);
}
.toggle-btn.is-active { background: #fff; color: var(--ink); box-shadow: 0 6px 16px -6px rgba(31,41,55,0.25); }

.variable-box {
  display: flex; align-items: flex-end; gap: 12px; margin-top: 14px;
  padding: 14px; background: rgba(255,255,255,0.5); border: 1px dashed var(--line); border-radius: 16px;
}
.variable-box[hidden] { display: none; }
.mini-field { flex: 1; }
.mini-field label { font-size: 0.78rem; font-weight: 600; color: var(--ink-mute); display: block; margin-bottom: 4px; }
.mini-input { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.mini-input input { border: none; outline: none; width: 100%; font: inherit; font-weight: 700; color: var(--ink); background: transparent; }
.mini-input span { color: var(--ink-mute); font-weight: 600; }
.plus { font-family: var(--font-d); font-weight: 800; font-size: 1.3rem; color: var(--ink-mute); padding-bottom: 10px; }

/* Resultados */
.results { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 96px; }
.result-main { text-align: center; padding: 36px 28px; }
.result-label { font-size: 0.82rem; font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.result-value {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem); letter-spacing: -0.02em; line-height: 1.1;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.result-value.sm { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.result-foot { font-size: 0.9rem; color: var(--ink-soft); }
.result-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-pair .card { padding: 22px; text-align: center; }
.result-actions { display: flex; flex-direction: column; gap: 12px; }

/* Esfuerzo */
.esfuerzo { padding: 22px 28px; }
.hint { cursor: help; color: var(--ink-mute); font-size: 0.85rem; }
.gauge { position: relative; height: 12px; border-radius: 999px; background: rgba(31,41,55,0.1); margin: 14px 0 8px; overflow: visible; }
.gauge-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--ok), var(--warn) 70%, var(--bad));
  transition: width 0.5s var(--ease-out);
  max-width: 100%;
}
.gauge-mark { position: absolute; top: -4px; width: 2px; height: 20px; background: var(--ink-soft); border-radius: 2px; }
.gauge-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; }
.gauge-row span:first-child { font-family: var(--font-d); font-weight: 800; font-size: 1.2rem; }
.gauge-row span:last-child { color: var(--ink-soft); }

/* Paneles */
.panel { margin-top: 24px; padding: 28px 32px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h3 { font-family: var(--font-d); font-weight: 800; font-size: 1.25rem; }
.panel-sub { font-weight: 500; font-size: 0.85rem; color: var(--ink-mute); }
.panel-close {
  border: none; background: rgba(31,41,55,0.06); width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; font-size: 0.95rem; color: var(--ink-soft); transition: background 0.2s;
}
.panel-close:hover { background: rgba(31,41,55,0.12); }
.legend { display: flex; gap: 20px; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-capital { background: var(--accent); }
.dot-interes { background: var(--accent-2); }
#chart { width: 100%; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-family: var(--font-d); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); }
tbody tr:hover { background: rgba(255,255,255,0.6); }
tbody tr:last-child td { border-bottom: none; font-weight: 700; }

/* ---------- Comparativa ---------- */
.comp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.comp-card { padding: 26px 22px; text-align: center; position: relative; transition: transform 0.3s var(--ease-out); }
.comp-card:hover { transform: translateY(-6px); }
.comp-card.is-best { border: 2px solid var(--accent); }
.comp-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-family: var(--font-d); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.08em;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.comp-years { font-family: var(--font-d); font-weight: 700; font-size: 1rem; color: var(--ink-soft); margin-bottom: 8px; }
.comp-cuota { font-family: var(--font-d); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.comp-label { font-size: 0.78rem; color: var(--ink-mute); margin-bottom: 14px; }
.comp-int { font-size: 0.85rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 12px; }
.comp-int strong { display: block; font-variant-numeric: tabular-nums; color: var(--ink); }
.tip { padding: 20px 26px; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer;
  font-family: var(--font-d); font-weight: 700; font-size: 1.05rem;
  padding: 22px 28px; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--accent); transition: transform 0.3s var(--ease-out);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 28px 24px; color: var(--ink-soft); }

/* ---------- Email CTA ---------- */
.cta-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; padding: 48px; align-items: center; }
.cta-card .section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.cta-list { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-soft); }
.lead-form { display: flex; flex-direction: column; gap: 8px; }
.lead-form label { font-size: 0.82rem; font-weight: 600; color: var(--ink-mute); }
.lead-form input {
  font: inherit; padding: 13px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; outline: none; margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lead-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.form-note { font-size: 0.78rem; color: var(--ink-mute); text-align: center; margin-top: 8px; }
.info-box {
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
  border-radius: 14px; padding: 12px 16px; margin-top: 10px;
  font-size: 0.85rem; color: var(--ink-soft); line-height: 1.5; text-align: left;
}
.info-box strong { color: var(--ink); }
.form-msg { font-size: 0.88rem; font-weight: 600; text-align: center; min-height: 1.4em; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--bad); }

/* ---------- Premium ---------- */
.premium-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.premium-list { list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 1.02rem; }
.premium-side { text-align: center; }
.premium-sim { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 22px; }
.premium-sim div { background: rgba(255,255,255,0.55); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.premium-sim dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); font-weight: 600; }
.premium-sim dd { font-family: var(--font-d); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------- Confianza ---------- */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trust { padding: 28px 24px; text-align: center; transition: transform 0.3s var(--ease-out); }
.trust:hover { transform: translateY(-6px); }
.trust span { font-size: 2rem; display: block; margin-bottom: 12px; }
.trust h3 { font-family: var(--font-d); font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.trust p { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Anuncios (AdSense) ---------- */
.ad-slot {
  width: min(1120px, calc(100% - 32px));
  margin: 40px auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 90px;
}
.ad-slot[hidden] { display: none; }
.ad-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute);
}
.ad-slot .adsbygoogle { width: 100%; min-height: 90px; }

/* ---------- Banner de consentimiento ---------- */
.consent {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  z-index: 100;
  padding: 22px 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.consent[hidden] { display: none; }
.consent-text { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55; }
.consent-text a { color: var(--accent); font-weight: 600; }
.consent-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .consent { bottom: 10px; padding: 18px 20px; }
  .consent-actions { justify-content: stretch; }
  .consent-actions .btn { flex: 1; }
}

/* ---------- Páginas legales ---------- */
.legal-page { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 140px 0 80px; }
.legal-page h1 { font-family: var(--font-d); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 8px; }
.legal-page .updated { color: var(--ink-mute); font-size: 0.85rem; margin-bottom: 32px; }
.legal-page h2 { font-family: var(--font-d); font-weight: 700; font-size: 1.2rem; margin: 32px 0 12px; }
.legal-page p, .legal-page li { color: var(--ink-soft); margin-bottom: 12px; }
.legal-page ul { padding-left: 20px; }
.legal-page a { color: var(--accent); font-weight: 600; }
.legal-back { display: inline-block; margin-bottom: 24px; color: var(--accent); font-weight: 600; text-decoration: none; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 80px 24px 48px; color: var(--ink-soft); }
.footer-brand { font-family: var(--font-d); font-weight: 800; font-size: 1.1rem; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.footer-legal { font-size: 0.78rem; color: var(--ink-mute); max-width: 68ch; margin: 12px auto 0; }
.footer-links { font-size: 0.82rem; margin-top: 16px; }
.footer-links a { color: var(--ink-soft); text-decoration: underline; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Reveal (con red de seguridad CSS) ---------- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.is-visible, .no-js .reveal { opacity: 1; transform: none; }
/* Red de seguridad: si el JS falla, todo se muestra a los 5s */
@keyframes revealSafety { to { opacity: 1; transform: none; } }
.reveal { animation: revealSafety 0s 5s forwards; }

/* ---------- Solo gate de animaciones intrusivas ---------- */
@media (prefers-reduced-motion: reduce) {
  .mesh { animation: none; }
  .hero-card { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 120px; min-height: auto; padding-bottom: 40px; }
  .hero-card { max-width: 420px; }
  .sim-grid, .premium-grid, .cta-card { grid-template-columns: 1fr; }
  .results { position: static; }
  .comp-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .section { padding-top: 72px; }
}
@media (max-width: 520px) {
  .comp-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .card, .cta-card, .panel { padding: 24px 20px; }
  .result-pair { grid-template-columns: 1fr; }
}
