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

:root {
  --blue: #1565C0;
  --blue-dark: #0D2A5E;
  --blue-light: #E3F2FD;
  --blue-mid: #90CAF9;
  --white: #ffffff;
  --gray-100: #F5F7FA;
  --gray-200: #ECEFF1;
  --gray-400: #90A4AE;
  --gray-600: #546E7A;
  --gray-800: #263238;
  --green: #2E7D32;
  --green-light: #43A047;
  --green-bg: #E8F5E9;
  --green-border: #A5D6A7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* NAVBAR */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 8px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; font-size: 16px; color: var(--blue-dark);
}
.nav-logo-img {
  height: 44px; width: auto; display: block;
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-link {
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--gray-700); transition: color .2s;
}
.nav-link:hover { color: var(--blue-dark); }
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--blue-dark); border-radius: 2px; transition: all .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 4px 12px rgba(0,0,0,.08); z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link {
    padding: 14px 20px; border-bottom: 1px solid var(--gray-200);
    font-size: 15px;
  }
  .navbar { position: sticky; }
}

/* BUTTONS */
.btn {
  display: inline-block; text-decoration: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; font-family: inherit; transition: opacity 0.15s, transform 0.15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-submit {
  width: 100%; background: var(--blue); color: var(--white);
  padding: 13px; font-size: 15px; border-radius: var(--radius-md); margin-top: 4px;
  transition: background 0.15s, transform 0.15s;
}
.btn-submit:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-white { background: var(--white); color: var(--blue); }
.btn-back {
  background: none; border: none; font-family: inherit;
  font-size: 13px; color: var(--gray-400); cursor: pointer;
  margin-top: 12px; display: block; text-align: center; width: 100%;
  padding: 4px; transition: color 0.15s;
}
.btn-back:hover { color: var(--blue); }

/* HERO */
.hero { background: linear-gradient(135deg, #E3F2FD 0%, #EDE7F6 100%); padding: 64px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: center; }

.badge {
  display: inline-block; background: var(--white);
  color: var(--blue); border: 1px solid var(--blue-mid);
  border-radius: 20px; padding: 5px 14px; font-size: 13px; margin-bottom: 20px;
}
h1 { font-size: 42px; font-weight: 600; color: var(--blue-dark); line-height: 1.2; margin-bottom: 16px; }
h1 em { font-style: normal; color: var(--blue); }
.hero-sub { font-size: 16px; color: var(--gray-600); margin-bottom: 24px; max-width: 460px; }
.trust-list { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; }
.trust-list li { font-size: 13px; color: var(--gray-600); }

/* FORM CARD */
.form-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); padding: 28px;
  box-shadow: var(--shadow-md);
  min-height: 380px;
}
.form-card h2 { font-size: 17px; font-weight: 600; color: var(--blue-dark); margin-bottom: 4px; }
.form-sub { font-size: 13px; color: var(--gray-400); margin-bottom: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.field input, .field select {
  width: 100%; background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; color: var(--gray-800);
  font-family: inherit; transition: border-color 0.15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); background: #fff; }
.form-message { margin-top: 10px; font-size: 13px; min-height: 20px; text-align: center; }
.form-message.success { color: var(--green); }
.form-message.error { color: #C62828; }
.form-disclaimer { font-size: 11px; color: var(--gray-400); margin-top: 10px; text-align: center; line-height: 1.5; }

/* MULTI-STEP FORM */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeSlide 0.3s ease; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-indicator {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 20px;
}
.step-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-400);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.3s;
}
.step-dot.active { background: var(--blue); color: var(--white); }
.step-dot.done { background: var(--green); color: var(--white); font-size: 12px; }
.step-line {
  flex: 1; height: 2px; background: var(--gray-200);
  margin: 0 6px; transition: background 0.3s;
}
.step-line.active { background: var(--blue); }

/* SAVINGS BANNER */
.savings-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  border: 1px solid var(--green-border); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 18px;
}
.savings-icon { font-size: 28px; }
.savings-label { font-size: 11px; color: var(--green); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.savings-amount { font-size: 22px; font-weight: 600; color: var(--green); }

/* STATS */
.stats-bar { border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 24px; text-align: center; border-right: 1px solid var(--gray-200); }
.stat:last-child { border-right: none; }
.stat-num { display: block; font-size: 26px; font-weight: 600; color: var(--blue); }
.stat-label { display: block; font-size: 12px; color: var(--gray-600); margin-top: 2px; }

/* WHATSAPP BAR */
.wa-bar { background: var(--green-bg); border-top: 1px solid var(--green-border); border-bottom: 1px solid var(--green-border); padding: 12px 0; }
.wa-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wa-inner span { font-size: 14px; color: #1B5E20; }
.wa-inner a { font-size: 14px; font-weight: 500; color: var(--green); text-decoration: none; }
.wa-inner a:hover { text-decoration: underline; }

/* SUBHEADER DIAGNÓSTICO */
.subheader {
  background: linear-gradient(90deg, #0D2A5E 0%, #1565C0 100%);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative; z-index: 101;
}
.subheader-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
}
.subheader p {
  font-size: 13.5px; color: rgba(255,255,255,0.88);
  margin: 0; text-align: center;
}
.subheader p strong { color: #fff; }
.subheader-btn {
  display: inline-block; background: #FFC107; color: #0D2A5E;
  font-size: 13px; font-weight: 700; padding: 6px 16px;
  border-radius: 20px; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.subheader-btn:hover { background: #FFD54F; transform: translateY(-1px); }
.subheader-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4CAF50; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(76,175,80,0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,0.7); }
  70%  { box-shadow: 0 0 0 7px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

/* WHATSAPP FLOTANTE */
.wa-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  display: flex; align-items: center; gap: 10px;
  background: #25D366; color: var(--white);
  border-radius: 50px; padding: 14px 20px 14px 16px;
  text-decoration: none; box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: waBounce 2s ease-in-out 3s 3;
}
.wa-float:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 28px rgba(37,211,102,0.5); }
.wa-float svg { width: 22px; height: 22px; flex-shrink: 0; }
.wa-float-label { font-size: 14px; font-weight: 600; }

@keyframes waBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* CALCULADORA */
.calculator-section { background: var(--blue-dark); padding: 64px 0; }
.calculator-section .section-label { color: var(--blue-mid); }
.calculator-section .section-title { color: var(--white); }
.section-desc { font-size: 15px; color: var(--blue-mid); margin-bottom: 36px; max-width: 560px; }

.calc-widget {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg); padding: 32px;
}

.calc-label { display: block; font-size: 11px; font-weight: 600; color: var(--blue-mid); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px; }

.calc-input-wrap {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px;
}
.calc-prefix { padding: 12px 14px; font-size: 18px; font-weight: 600; color: var(--blue-mid); background: rgba(255,255,255,0.05); border-right: 1px solid rgba(255,255,255,0.1); }
.calc-input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 12px 16px; font-size: 22px; font-weight: 600; color: var(--white);
  font-family: inherit;
}
.calc-input::placeholder { color: rgba(255,255,255,0.3); }

.calc-slider-wrap { margin-bottom: 32px; }
.calc-slider {
  width: 100%; appearance: none; height: 4px;
  background: rgba(255,255,255,0.15); border-radius: 4px; outline: none;
  cursor: pointer; margin-bottom: 8px;
}
.calc-slider::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-mid); cursor: pointer; border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: transform 0.15s;
}
.calc-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.calc-slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,0.35); }

.calc-results {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.calc-result-card {
  flex: 1; min-width: 160px;
  border-radius: var(--radius-md); padding: 18px;
}
.calc-obligatorio { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); }
.calc-promedio { background: rgba(255,100,100,0.08); border: 1px solid rgba(255,100,100,0.2); }
.calc-ahorro { background: rgba(67,160,71,0.15); border: 1px solid rgba(67,160,71,0.3); }

.calc-result-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.calc-result-value { font-size: 22px; font-weight: 600; color: var(--white); margin-bottom: 4px; transition: all 0.4s; }
.calc-ahorro .calc-result-value { color: #81C784; }
.calc-result-note { font-size: 11px; color: rgba(255,255,255,0.4); }
.calc-arrow { color: rgba(255,255,255,0.25); font-size: 20px; flex-shrink: 0; }

.calc-cta { display: block; text-align: center; padding: 14px; font-size: 15px; border-radius: var(--radius-md); }

/* SECTIONS */
.section { padding: 60px 0; }
.section-label { font-size: 11px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.section-title { font-size: 28px; font-weight: 600; color: var(--blue-dark); margin-bottom: 32px; }

/* BENEFITS */
.benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.benefit-card {
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.benefit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.benefit-icon { font-size: 24px; margin-bottom: 12px; }
.benefit-card h3 { font-size: 14px; font-weight: 600; color: var(--blue-dark); margin-bottom: 6px; }
.benefit-card p { font-size: 13px; color: var(--gray-600); line-height: 1.55; }

/* TESTIMONIOS */
.testimonios { background: var(--gray-100); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.testimonios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.testimonio-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 14px;
}
.testimonio-stars { color: #F9A825; font-size: 16px; letter-spacing: 2px; }
.testimonio-text { font-size: 14px; color: var(--gray-600); line-height: 1.65; flex: 1; font-style: italic; }
.testimonio-author { display: flex; align-items: center; gap: 12px; }
.testimonio-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.testimonio-name { font-size: 14px; font-weight: 600; color: var(--blue-dark); }
.testimonio-meta { font-size: 12px; color: var(--gray-400); }

/* ISAPRES */
.isapres-section { background: var(--gray-100); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); padding: 32px 0; }
.isapres-label { font-size: 13px; color: var(--gray-600); text-align: center; margin-bottom: 16px; }
.isapres-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.isapre-pill { background: var(--white); border: 1px solid var(--gray-200); border-radius: 20px; padding: 6px 16px; font-size: 13px; color: var(--gray-600); }

/* FAQ */
.faq { border-top: 1px solid var(--gray-200); }
.faq-inner { max-width: 700px; }
.faq-list { display: flex; flex-direction: column; gap: 0; }
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-item summary {
  padding: 16px 0; font-size: 15px; font-weight: 500; color: var(--blue-dark);
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--blue); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 0 16px; font-size: 14px; color: var(--gray-600); line-height: 1.6; }

/* FAQ CTA */
.faq-cta {
  margin-top: 36px; padding: 24px; background: var(--blue-light);
  border-radius: var(--radius-md); border: 1px solid var(--blue-mid);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.faq-cta p { font-size: 15px; color: var(--blue-dark); font-weight: 500; }

/* FOOTER CTA */
.footer-cta { background: var(--blue-dark); padding: 48px 0; }
.footer-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-cta h2 { font-size: 24px; font-weight: 600; color: var(--white); margin-bottom: 6px; }
.footer-cta p { font-size: 14px; color: var(--blue-mid); }

/* FOOTER */
.footer { background: var(--white); border-top: 1px solid var(--gray-200); padding: 20px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-inner span { font-size: 12px; color: var(--gray-400); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--blue); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* EXIT INTENT POPUP */
.popup-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(13,42,94,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.popup-overlay.active { opacity: 1; pointer-events: all; }

.popup-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 32px; max-width: 420px; width: 100%;
  position: relative; box-shadow: var(--shadow-lg);
  transform: scale(0.94) translateY(12px); transition: transform 0.25s;
  text-align: center;
}
.popup-overlay.active .popup-card { transform: scale(1) translateY(0); }

.popup-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 22px; color: var(--gray-400);
  cursor: pointer; line-height: 1; padding: 4px;
  transition: color 0.15s;
}
.popup-close:hover { color: var(--gray-800); }

.popup-icon { font-size: 40px; margin-bottom: 12px; }
.popup-card h3 { font-size: 20px; font-weight: 600; color: var(--blue-dark); margin-bottom: 10px; }
.popup-card p { font-size: 14px; color: var(--gray-600); margin-bottom: 20px; line-height: 1.6; }
.popup-card .field { text-align: left; }

.popup-skip {
  background: none; border: none; font-family: inherit;
  font-size: 12px; color: var(--gray-400); cursor: pointer;
  margin-top: 14px; display: block; width: 100%;
  text-decoration: underline; text-underline-offset: 2px;
}
.popup-skip:hover { color: var(--gray-600); }

/* FOOTER LEGAL BUTTONS */
.footer-legal-btn {
  background: none; border: none; font-family: inherit;
  font-size: 13px; color: var(--blue); cursor: pointer;
  text-decoration: none; padding: 0;
}
.footer-legal-btn:hover { text-decoration: underline; }

/* MODALES LEGALES */
.legal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(13,42,94,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.legal-overlay.active { opacity: 1; pointer-events: all; }

.legal-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 32px; max-width: 620px; width: 100%;
  max-height: 80vh; display: flex; flex-direction: column;
  position: relative; box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(12px); transition: transform 0.25s;
}
.legal-overlay.active .legal-card { transform: scale(1) translateY(0); }

.legal-card h2 { font-size: 20px; font-weight: 600; color: var(--blue-dark); margin-bottom: 20px; flex-shrink: 0; }

.legal-body {
  overflow-y: auto; flex: 1;
  padding-right: 8px;
  scrollbar-width: thin; scrollbar-color: var(--gray-200) transparent;
}
.legal-body h3 { font-size: 14px; font-weight: 600; color: var(--blue-dark); margin: 20px 0 6px; }
.legal-body p { font-size: 13px; color: var(--gray-600); line-height: 1.7; margin-bottom: 10px; }
.legal-body ul { padding-left: 18px; margin-bottom: 10px; }
.legal-body ul li { font-size: 13px; color: var(--gray-600); line-height: 1.7; }

.legal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 22px; color: var(--gray-400);
  cursor: pointer; line-height: 1; padding: 4px;
  transition: color 0.15s;
}
.legal-close:hover { color: var(--gray-800); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(3) { border-bottom: none; }
  .testimonios-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .benefits-grid { grid-template-columns: 1fr 1fr; }
  .footer-cta-inner { flex-direction: column; text-align: center; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .calc-results { flex-direction: column; }
  .calc-arrow { transform: rotate(90deg); }
  .faq-cta { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .benefits-grid { grid-template-columns: 1fr; }
  .trust-list { flex-direction: column; gap: 8px; }
  .wa-inner { flex-direction: column; text-align: center; }
  .wa-float-label { display: none; }
  .wa-float { padding: 14px; border-radius: 50%; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
}
