/* ========== Design tokens ========== */
:root {
  --bg: #0b1220;
  --primary: #3B599C;
  --primary-light: #5F7BC4;
  --primary-dark: #2A3E70;
  --secondary: #22D3EE;
  --neutral-light: #F8FAFC;
  --neutral: #CBD5E1;
  --neutral-dark: #0F172A;
  --text: var(--neutral-dark);
  --muted: #475569;
  --whatsapp: #25D366;
  --card: #FFFFFF;
  --ring: 0 0 0 3px rgba(59, 89, 156, .25);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .15);
  --container: 1120px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

/* Utilities */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.muted {
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .05s ease, background .2s ease;
}

/* Hacer que los enlaces con clase .btn luzcan como botones reales */
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
  border: 1px solid #e2e8f0;
  color: var(--text);
}

.btn--whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

/* Tamaño del botón Siguiente en el formulario de inicio */
.start-card #btn-comenzar {
  width: 30% !important;
  min-width: 0;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(120%) blur(8px);
  background: rgba(255, 255, 255, .6);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.brand__name strong {
  color: var(--primary);
}

/* Mantener la marca en una sola línea (removido para index limpio) */

.primary-nav {
  display: flex;
  gap: 24px;
}

.primary-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.primary-nav a:hover {
  color: var(--text);
}

/* Evitar quiebres (removido para index limpio) */

/* Menú tamaño (removido para index limpio) */

/* Mega menu (removido para index limpio) */

/* Media mega (removido) */

/* Ajuste de botón header (removido) */

/* HERO */
.hero {
  position: relative;
  padding: 72px 0 32px;
  background: radial-gradient(1200px 400px at 20% -10%, #e2f2ff 0, transparent 60%), radial-gradient(1000px 400px at 100% 10%, #e9feff 0, transparent 60%);
}

.hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(800px 300px at 10% 0%, rgba(34, 211, 238, .25), transparent 60%), radial-gradient(600px 300px at 90% 40%, rgba(37, 99, 235, .25), transparent 60%);
}

.hero__copy h1 {
  font-size: clamp(28px, 5vw, 48px);
  margin: 0 0 8px;
}

.start-card {
  margin-top: 20px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-row input {
  flex: 1;
}

/* Space between label text and input row on start card */
.start-card > .label + .input-row {
  margin-top: 8px;
}

/* CARDS */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f0;
}

.login {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.help {
  color: var(--muted);
  font-size: .9rem;
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .25));
  border: 1px solid rgba(255, 255, 255, .4);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  border-radius: 20px;
}

.stats {
  display: flex;
  gap: 16px;
  padding: 16px;
}

.stat__num {
  font-weight: 800;
  font-size: 24px;
  display: block;
}

.stat__lbl {
  color: var(--muted);
  font-size: 12px;
}

.orbs {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 6px 14px rgba(37, 99, 235, .4)
}

/* COTIZADOR */
.cotizador {
  padding: 32px 0 48px;
}

/* Improve mobile usability for long step labels */
.stepper {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.step {
  flex: 0 0 auto;
}

/* Allow action rows to wrap on narrow screens */
.panel__actions {
  flex-wrap: wrap;
  gap: 8px;
}

.stepper {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.step--active {
  color: var(--primary);
}

.step__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.panel {
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel__title {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field input,
.field select,
input,
select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font: inherit;
  outline: none;
}

/* Normaliza <select> para iOS Safari y otros navegadores */
.field select,
select {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid var(--neutral);
  border-radius: 12px;
  padding: 12px 40px 12px 14px;
  font: inherit;
  font-size: 16px;
  /* evita zoom en iOS */
  line-height: 1.2;
  color: var(--text);
  outline: none;
  background-clip: padding-box;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

/* Flecha custom para reemplazar la nativa */
.field select,
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%233B599C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

/* Enfoque coherente con el ring del sistema */
.field select:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

/* Estado deshabilitado consistente */
.field select:disabled,
select:disabled {
  color: #9aa4b2;
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 1;
}

/* Igualar estilo para campos solo lectura (ej. Código Postal) */
.field input[readonly],
input[readonly],
.field input:read-only,
input:read-only {
  color: #64748b; /* un poco más tenue */
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

/* Oculta el desplegable nativo de IE/Edge antiguos */
select::-ms-expand {
  display: none;
}

/* Ajuste fino específico de iOS */
@supports (-webkit-touch-callout: none) {

  .field select,
  select {
    background-color: #fff;
  }
}

.field input:focus,
.field select:focus,
input:focus,
select:focus {
  box-shadow: var(--ring);
  border-color: var(--primary);
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

/* Make plans behave like a horizontal carousel on small screens */
@media (max-width: 680px) {
  .plans {
    display: block;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }

  .plan {
    display: inline-block;
    width: 99%;
    min-width: 260px;
    margin-right: 12px;
    scroll-snap-align: start;
    margin-bottom: 15px
  }
}

.plan {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

.plan h3 {
  margin: 0 0 8px;
}

.price {
  font-size: 24px;
  font-weight: 800;
}

.badge {
  display: inline-block;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.actions-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.more {
  margin-top: 12px;
}

/* Logo aseguradora en cada plan */
.plan__logo {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 33px;
  width: auto;
  object-fit: contain;
  opacity: .95;
}

/* FEATURES */
.features {
  padding: 56px 0;
  background: #f8fafc;
}

/* Cómo funciona: tarjetas con fondo llamativo (no la sección) */
#como .feature.card {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: 0;
}

#como .feature.card h3 { color: #fff; }
#como .feature.card p { color: rgba(255, 255, 255, .95); }

/* Variantes por tarjeta */
#como .grid-3 .feature.card:nth-child(1) {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
#como .grid-3 .feature.card:nth-child(2) {
  background: linear-gradient(135deg, var(--secondary), #38bdf8);
}
#como .grid-3 .feature.card:nth-child(3) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.feature h3 {
  margin: 0 0 6px;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

/* FOOTER */
.footer {
  border-top: 1px solid #e2e8f0;
  padding: 24px 0 40px;
  background: #fff;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-nav {
  display: flex;
  gap: 16px;
}

.mini-nav a {
  color: var(--muted);
  text-decoration: none;
}

.mini-nav a:hover {
  color: var(--text);
}

/* Payment step */
.pay-secure {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.segmented {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 8px;
}

.segmented__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.segmented__btn.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(2, 6, 23, .08);
}

/* Hide non-card payment options */
#pay-methods .segmented__btn[data-method="paypal"],
#pay-methods .segmented__btn[data-method="openpay"] {
  display: none !important;
}

.pay-accepted {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 16px;
}

/* Cotización number above results */
#ncot {
  margin: 8px 0 14px;
  font-size: 18px;
}

.pay-layout {
  display: grid;
  /* Aumenta ~30% el ancho de la columna del resumen (derecha) */
  grid-template-columns: 2fr 1.5fr;
  gap: 16px;
  align-items: start;
}

.pay-summary {
  position: sticky;
  top: 12px;
}

.pay-actions {
  justify-content: flex-end;
}

/* Pay card grid to place exp next to CVV */
.pay-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pay-card-grid .field--span2 { grid-column: 1 / -1; }

/* Credit card preview */
.ccard {
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #3B599C, #5F7BC4);
  color: #fff;
  min-height: 210px; /* ~30% más alto */
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ccard__brand { font-weight: 800; letter-spacing: 1px; }
.ccard__number { font-size: 20px; letter-spacing: 2px; font-weight: 700; }
.ccard__row { display: flex; justify-content: space-between; gap: 12px; }
.ccard__label { font-size: 11px; opacity: .85; }
.ccard__name, .ccard__exp { font-weight: 700; }

@media (max-width: 980px) {
  .pay-layout {
    grid-template-columns: 1fr;
  }
}

/* Global mobile side paddings and full-width buttons */
@media (max-width: 480px) {
  .container {
    padding: 20px 16px;
  }

  .input-row {
    flex-direction: column;
  }

  .btn {
    width: auto;
    min-width: 100%;
  }

  .nav .btn {
    width: auto;
    min-width: unset;
    padding: 8px 14px;
    font-size: 14px;
  }

  .start-card #btn-comenzar {
    width: 30% !important;
    min-width: 0;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 20px 14px;
  }

  .card,
  .panel {
    padding: 16px;
  }
}

/* Responsive */
@media (max-width: 980px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .plans {
    grid-template-columns: 1fr 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Ocultar la nav SOLO cuando no esté activa en mobile */
  .primary-nav:not(.is-open) { display: none; }

  .hero {
    padding: 40px 0 12px;
  }

  .footer__inner {
    gap: 12px;
    flex-wrap: wrap;
  }
}

@media (max-width:480px) {
  .footer {
    padding: 32px 0 60px;
  }
}

.hero-img {
  max-width: 500px;
}

/* Print styles: imprimir solo el Resumen */
@media print {
  .nav, .footer, .hero, .stepper, .panel__actions, .actions-row { display: none !important; }
  #panel-resumen { display: block !important; box-shadow: none; border: 0; }
  #resumen { box-shadow: none; border: 0; }
  body { background: #fff; }
}

@media (max-width:768px) {
  .hero-img {
    display: none;
  }
}

/* SPLASH */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity .4s ease, visibility .4s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.splash__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.splash__brand {
  font-weight: 800;
  color: var(--primary);
}

.splash__spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Show splash only when requested */
.show-splash #splash {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Sticky CTA for mobile */
.sticky-cta {
  display: none;
}
@media (max-width: 680px) {
  .sticky-cta {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 10px 16px 14px;
    background: rgba(255,255,255,.95);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -6px 18px rgba(2,6,23,.06);
    display: block;
    z-index: 20;
  }
}

/* SUMMARY (Resumen) */
.summary {
  display: grid;
  gap: 16px;
}

.summary__section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.summary__title {
  font-weight: 800;
  margin: 0 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.summary .field .muted {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 680px) {
  .summary__grid {
    grid-template-columns: 1fr;
  }
}

.summary__edit {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

/* ===== Mobile Menu Enhancements (removidos) ===== */

/* Radios de cobertura: asegurar cursor interactivo */
input[type="radio"][name="cobertura"] {
  cursor: pointer;
}

/* ===== Local env (192.168) header highlight for pages using .nav ===== */
.env-local .nav {
  background: rgba(255, 0, 0, 0.9) !important;
  border-bottom-color: transparent !important;
  backdrop-filter: saturate(120%) blur(6px);
}
.env-local .nav .brand,
.env-local .nav .brand__name,
.env-local .nav .primary-nav a { color: #fff !important; }
.env-local .nav .primary-nav a:hover { color: #fff; opacity: .9; }
.env-local .nav .btn.btn--ghost {
  color: #fff;
  border-color: rgba(255,255,255,.6);
}

/* PRODUCTS */
.products {
  padding: 36px 0 56px;
  background: #fff;
}

.products__header {
  text-align: center;
  margin-bottom: 18px;
}

.products__header h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.5vw, 32px);
}

.products__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.product-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.product-card__icon {
  width: 48px; height: 48px;
  border-radius: 999px;
  background: #eef2ff;
  display: grid; place-items: center;
  font-size: 24px;
}

.product-card__icon img {
  width: 26px; height: 26px;
  object-fit: contain;
  display: block;
}

.product-card h3 {
  margin: 0;
}

.product-card__actions { margin-top: 4px; }

@media (max-width: 980px) {
  .products__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .products__grid {
    grid-template-columns: 1fr;
  }
}
