/* ============================================================
   León de Seguros — Hub de Cotizadores
   Estilos compartidos: tokens de marca, layout, componentes
   ============================================================ */

:root {
  --azul: #1A3A6C;
  --azul-dark: #122755;
  --azul-mid: #2D5FA0;
  --azul-light: #EEF3FB;
  --dorado: #E8A020;
  --dorado-dark: #C4871A;
  --verde: #00843D;
  --rojo: #EF4444;
  --gris-100: #F7F9FC;
  --gris-200: #EAEEF5;
  --gris-400: #B6BFCE;
  --gris-600: #6B7589;
  --gris-800: #2B3344;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(26, 58, 108, 0.08);
  --shadow-lg: 0 12px 36px rgba(26, 58, 108, 0.14);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--gris-800);
  background: var(--gris-100);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--azul-dark);
  margin: 0 0 0.4em;
  line-height: 1.15;
}

a { color: var(--azul-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--dorado);
  outline-offset: 2px;
}

/* ---------------- Layout ---------------- */

.app-header {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-dark) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.app-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--dorado);
  color: var(--azul-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  font-family: var(--font-display);
}

.brand-tagline {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--gris-400);
  letter-spacing: 0.01em;
  margin-top: 1px;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  color: rgba(255,255,255,0.82);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover { background: rgba(255,255,255,0.10); color: #fff; }
.main-nav a.active { background: var(--dorado); color: var(--azul-dark); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-footer {
  background: var(--azul-dark);
  color: var(--gris-400);
  text-align: center;
  padding: 22px 20px;
  font-size: 0.82rem;
}
.app-footer a { color: var(--dorado); }

/* ---------------- Home / hero ---------------- */

.hero {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-mid) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 44px 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(232, 160, 32, 0.18);
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.hero p {
  color: rgba(255,255,255,0.85);
  max-width: 560px;
  font-size: 1.02rem;
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  display: inline-block;
  background: rgba(232,160,32,0.2);
  color: var(--dorado);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.ramo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.ramo-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gris-200);
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ramo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.ramo-card .icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--azul-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.ramo-card h3 { margin-bottom: 2px; font-size: 1.15rem; }
.ramo-card p { color: var(--gris-600); font-size: 0.9rem; margin: 0; flex-grow: 1; }

.ramo-card .btn { align-self: flex-start; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: filter 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--dorado); color: var(--azul-dark); }
.btn-primary:hover { filter: brightness(1.06); }

.btn-secondary { background: var(--azul-light); color: var(--azul-dark); }
.btn-secondary:hover { filter: brightness(0.97); }

.btn-ghost { background: transparent; color: var(--azul-mid); border: 1px solid var(--gris-200); }
.btn-ghost:hover { background: var(--azul-light); }

.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { filter: brightness(1.05); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Forms ---------------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gris-800);
  margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gris-200);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  color: var(--gris-800);
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--azul-mid);
  outline: none;
}
.field-label-block {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gris-800);
  margin-bottom: 8px;
}
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 140px; }

.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-field input { width: auto; }
.checkbox-field label { margin: 0; font-weight: 600; }

.form-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gris-200);
}

.error-msg { color: var(--rojo); font-size: 0.82rem; min-height: 1.2em; margin: 4px 0 10px; }

/* ---------------- Cards (results) ---------------- */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.plan-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gris-200);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.plan-card.recommended {
  border: 2px solid var(--dorado);
}

.plan-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}
.badge-recommended { background: var(--dorado); color: var(--azul-dark); }
.badge-complete { background: var(--azul-light); color: var(--azul-dark); }
.badge-price { background: #E6F7EE; color: var(--verde); }

.plan-card .insurer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.plan-card .insurer-name { font-weight: 800; color: var(--azul-dark); font-size: 1rem; }
.plan-card .plan-name { color: var(--gris-600); font-size: 0.84rem; }

.plan-card .price {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--azul-dark);
}
.plan-card .price small { font-size: 0.85rem; font-weight: 500; color: var(--gris-600); }

.plan-card .price-sub { font-size: 0.78rem; color: var(--gris-600); }

.plan-card .coverage-list {
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0.84rem;
  color: var(--gris-800);
  display: flex; flex-direction: column; gap: 4px;
}
.plan-card .coverage-list li::before {
  content: '✓ '; color: var(--verde); font-weight: 800;
}

.plan-card .actions {
  display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap;
}

/* ---------------- Modal ---------------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(18, 39, 85, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s;
  padding: 16px;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal.modal-lg { max-width: 760px; }

.lead-modal-sub { color: var(--gris-600); font-size: 0.88rem; margin-top: -4px; }
.lead-privacy { font-size: 0.74rem; color: var(--gris-600); margin-top: 8px; }
.lead-submit { width: 100%; margin-top: 6px; }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--gris-100);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--gris-600);
}

/* ---------------- Detail / comparison table ---------------- */

.detail-section { margin-bottom: 18px; }
.detail-section h4 {
  font-size: 0.92rem;
  color: var(--azul-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
  border-bottom: 1px solid var(--gris-200);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.kv-table { width: 100%; font-size: 0.86rem; border-collapse: collapse; }
.kv-table tr:nth-child(even) { background: var(--gris-100); }
.kv-table td { padding: 6px 8px; vertical-align: top; }
.kv-table td:first-child { font-weight: 700; color: var(--azul-dark); width: 42%; }

/* ---------------- Utility ---------------- */

.center { text-align: center; }
.muted { color: var(--gris-600); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.section-title { margin-bottom: 6px; }
.section-sub { color: var(--gris-600); margin-bottom: 20px; }
.pill {
  display: inline-block; background: var(--azul-light); color: var(--azul-dark);
  font-size: 0.74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--gris-600);
  border: 1.5px dashed var(--gris-200); border-radius: var(--radius);
}
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 3px solid var(--gris-200); border-top-color: var(--azul-mid);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toggle-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.toggle-chip {
  border: 1.5px solid var(--gris-200);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gris-600);
}
.toggle-chip.active { border-color: var(--azul-mid); background: var(--azul-light); color: var(--azul-dark); }

table.am-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.am-table th, table.am-table td { padding: 8px; border-bottom: 1px solid var(--gris-200); text-align: left; }
table.am-table th { color: var(--gris-600); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .app-header-inner { flex-direction: column; align-items: flex-start; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .hero { padding: 30px 22px; }
}
/* ── LOPDP checkbox (añadido Cambio 1) ── */
.lead-lopdp-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #F7F9FC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0 10px;
}
.lead-lopdp-wrap input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--azul);
  flex-shrink: 0;
  cursor: pointer;
}
.lead-lopdp-label {
  font-size: 0.78rem;
  color: var(--gris-600);
  line-height: 1.55;
  cursor: pointer;
}
.lead-lopdp-label a  { color: var(--azul-mid); text-decoration: underline; }
.lead-lopdp-label strong { color: var(--gris-800); }
.lead-submit { transition: opacity 0.2s, background 0.18s; }