/* Asuseguro — landing original (paleta verde/teal, distinta a cualquier aseguradora real) */
:root {
  --brand: #0e8f73;
  --brand-dark: #0a6e58;
  --brand-light: #e6f5f1;
  --ink: #0f2b27;
  --ink-soft: #46615b;
  --line: #e3ece9;
  --bg: #ffffff;
  --bg-soft: #f4f9f7;
  --accent: #ffb020;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(14, 143, 115, .12);
  --shadow-sm: 0 4px 14px rgba(14, 43, 39, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}
.container--narrow { max-width: 760px; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); }
.brand__mark { display: inline-flex; }
.brand__text { font-size: 22px; font-weight: 500; letter-spacing: -.3px; color: var(--ink); }
.brand__text strong { color: var(--brand); font-weight: 800; }

.nav { display: flex; gap: 26px; }
.nav a { color: var(--ink-soft); font-weight: 500; font-size: 15px; transition: color .15s; }
.nav a:hover { color: var(--brand); }

.topbar__phone {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-light); color: var(--brand-dark);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.topbar__phone:hover { background: #d7eee8; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 13px 26px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--lg { padding: 16px 34px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--white { background: #fff; color: var(--brand-dark); }
.btn--white:hover { background: #f1faf7; }

/* Hero */
.hero {
  background: linear-gradient(160deg, #f4f9f7 0%, #eafaf4 50%, #ffffff 100%);
  padding: 56px 0 70px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}
.badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600; font-size: 13px;
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; letter-spacing: -1px; }
.hero h1 .hl { color: var(--brand); }
.hero__lead { margin-top: 18px; font-size: 18px; color: var(--ink-soft); max-width: 520px; }
.hero__points { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; }
.hero__points li {
  position: relative; padding-left: 30px; color: var(--ink); font-weight: 500;
}
.hero__points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.hero__note { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }

/* Card / form */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.form-card__title { font-size: 22px; font-weight: 700; }
.form-card__sub { color: var(--ink-soft); font-size: 15px; margin-top: 4px; margin-bottom: 18px; }

.field { margin-bottom: 14px; display: flex; flex-direction: column; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.opt { font-weight: 400; color: var(--ink-soft); }
input, select {
  font-family: inherit; font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #9bb0aa; }
input:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 143, 115, .15);
}
input.invalid, select.invalid { border-color: #e0413c; }
.error { color: #e0413c; font-size: 12.5px; min-height: 0; margin-top: 4px; }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--ink-soft); font-weight: 400;
  margin: 6px 0 4px;
}
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.check a { color: var(--brand-dark); text-decoration: underline; }

.form-card__legal { font-size: 12px; color: var(--ink-soft); margin-top: 14px; }

.success { text-align: center; padding: 20px 6px; }
.success__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 32px; display: grid; place-items: center; margin: 0 auto 16px;
}
.success h3 { font-size: 20px; }
.success p { color: var(--ink-soft); margin-top: 8px; }

/* Sections */
.section { padding: 72px 0; }
.section--alt { background: var(--bg-soft); }
.section__title { font-size: clamp(26px, 4vw, 34px); font-weight: 800; text-align: center; letter-spacing: -.5px; }
.section__sub { text-align: center; color: var(--ink-soft); margin-top: 10px; font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow-sm);
}
.step__num {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand-light); color: var(--brand-dark);
  font-weight: 800; font-size: 18px; margin-bottom: 16px;
}
.step h3 { font-size: 18px; }
.step p { color: var(--ink-soft); margin-top: 8px; font-size: 15px; }

.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; }
.benefit {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.benefit__ico { font-size: 34px; margin-bottom: 12px; }
.benefit h3 { font-size: 17px; }
.benefit p { color: var(--ink-soft); margin-top: 8px; font-size: 14px; }

/* FAQ */
.faq {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 4px 20px; margin-top: 14px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 22px; font-weight: 400; }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--ink-soft); padding: 0 0 18px; font-size: 15px; }

/* CTA */
.cta { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; padding: 64px 0; }
.cta__inner { text-align: center; }
.cta h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
.cta p { margin: 12px 0 28px; font-size: 18px; opacity: .92; }

/* Footer */
.footer { background: #0c211d; color: #c3d6d0; padding: 56px 0 30px; }
.footer__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
.brand--footer .brand__text { color: #fff; }
.footer__about { margin-top: 14px; font-size: 14px; max-width: 360px; }
.footer__legal h4 { color: #fff; font-size: 15px; margin-bottom: 10px; }
.footer__legal p { font-size: 13px; margin-bottom: 10px; }
.footer__copy { color: #8aa49d; margin-top: 18px; }

/* ===== Chatbot / asistente ===== */
.chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(14, 143, 115, .45);
  transition: transform .15s, background .15s;
}
.chat-launcher { animation: chat-attention 4.5s ease-in-out infinite; }
.chat-launcher.is-open { animation: none; }
@keyframes chat-attention {
  0%, 65%, 100% { transform: translateY(0) rotate(0); }
  70% { transform: translateY(-7px) rotate(-9deg); }
  75% { transform: translateY(0) rotate(9deg); }
  80% { transform: translateY(-5px) rotate(-7deg); }
  85% { transform: translateY(0) rotate(7deg); }
  90% { transform: translateY(-2px) rotate(0); }
}
.chat-launcher:hover { background: var(--brand-dark); transform: translateY(-2px); }
.chat-launcher__open, .chat-launcher__close { grid-area: 1 / 1; transition: opacity .15s, transform .2s; }
.chat-launcher__close { opacity: 0; transform: rotate(-90deg); }
.chat-launcher.is-open .chat-launcher__open { opacity: 0; transform: rotate(90deg); }
.chat-launcher.is-open .chat-launcher__close { opacity: 1; transform: rotate(0); }
.chat-launcher::before {
  content: "";
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(14, 143, 115, .5);
  animation: chat-pulse 2.2s ease-out infinite;
}
.chat-launcher.is-open::before { animation: none; }
@keyframes chat-pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 143, 115, .5); }
  70% { box-shadow: 0 0 0 16px rgba(14, 143, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 143, 115, 0); }
}
.chat-launcher__badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent); color: #3a2400;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid #fff;
}
.chat-launcher.is-open .chat-launcher__badge { display: none; }
@media (prefers-reduced-motion: reduce) { .chat-launcher::before { animation: none; } }

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 100;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(14, 43, 39, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chat-in .22s ease;
}
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; padding: 14px 16px;
}
.chat-head__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none;
}
.chat-head__meta { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.chat-head__meta strong { font-size: 15px; }
.chat-head__status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.chat-head__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6dffb0; box-shadow: 0 0 0 3px rgba(109,255,176,.3); }
.chat-head__close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; opacity: .85; padding: 4px; }
.chat-head__close:hover { opacity: 1; }

.chat-body {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  background: var(--bg-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; }
.msg--bot { background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: var(--shadow-sm); }
.msg--user { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg--typing { display: inline-flex; gap: 4px; align-self: flex-start; }
.msg--typing span { width: 7px; height: 7px; border-radius: 50%; background: #b7c9c3; animation: typing 1.2s infinite; }
.msg--typing span:nth-child(2) { animation-delay: .2s; }
.msg--typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chat-foot { padding: 12px; border-top: 1px solid var(--line); background: #fff; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--brand-light); color: var(--brand-dark);
  border: 1.5px solid transparent; border-radius: 999px;
  padding: 9px 15px; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.chip:hover { background: #d7eee8; border-color: var(--brand); }
.chip--wa { background: #25d366; color: #fff; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; font-size: 15px; }
.chip--wa:hover { background: #1ebe5b; }
.chat-textrow { display: flex; gap: 8px; width: 100%; }
.chat-textrow input { flex: 1; }
.chat-textrow button { flex: none; padding: 0 16px; }

@media (prefers-reduced-motion: reduce) { .chat-panel { animation: none; } .msg--typing span { animation: none; } }

/* IMPORTANTE: el atributo hidden debe ganarle a display:flex para poder cerrar el chat */
.chat-panel[hidden] { display: none !important; }

/* Globo de atención del chat */
.chat-tip {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 99;
  max-width: 220px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  padding: 12px 30px 12px 14px;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 12px 30px rgba(14, 43, 39, .22);
  cursor: pointer;
  animation: tip-in .3s ease;
}
.chat-tip[hidden] { display: none !important; }
.chat-tip::after {
  content: "";
  position: absolute;
  right: 16px; bottom: -6px;
  width: 14px; height: 14px;
  background: #fff;
  transform: rotate(45deg);
}
@keyframes tip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chat-tip__close {
  position: absolute; top: 5px; right: 7px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--ink-soft); line-height: 1; padding: 2px;
}
.chat-tip__close:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .chat-launcher { animation: none; }
  .chat-tip { animation: none; }
}

/* Modal de confirmación del lead (antes de ir a WhatsApp) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 33, 29, .55);
  backdrop-filter: blur(2px);
  animation: modal-fade .18s ease;
}
.modal[hidden] { display: none !important; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal__box {
  background: #fff;
  border-radius: 18px;
  max-width: 380px;
  width: 100%;
  padding: 30px 26px 26px;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 60px rgba(14, 43, 39, .35);
  animation: modal-pop .2s ease;
}
@keyframes modal-pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal__close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--ink-soft); line-height: 1; padding: 4px;
}
.modal__close:hover { color: var(--ink); }
.modal__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 32px; display: grid; place-items: center; margin: 0 auto 14px;
}
.modal__box h3 { font-size: 21px; font-weight: 800; }
.modal__sub { color: var(--ink-soft); font-size: 14.5px; margin-top: 6px; }
.modal__summary {
  text-align: left; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin: 18px 0; font-size: 14.5px;
  color: var(--ink); white-space: pre-line; line-height: 1.6;
}
.modal__wa {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: #25d366; color: #fff; font-weight: 700;
  padding: 14px; border-radius: 999px; font-size: 16px;
  transition: background .15s, transform .12s;
}
.modal__wa:hover { background: #1ebe5b; transform: translateY(-1px); }
.modal__note { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 920px) {
  .hero { padding: 40px 0 52px; }
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__lead { max-width: none; }
  .nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  .benefits { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 56px 0; }
}

/* Móvil grande */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .topbar__inner { height: 60px; gap: 10px; }
  .brand__text { font-size: 20px; }
  .hero { padding: 30px 0 42px; }
  .badge { margin-bottom: 14px; }
  .hero h1 { font-size: 30px; letter-spacing: -.5px; }
  .hero__lead { font-size: 16px; margin-top: 14px; }
  .hero__points { margin: 18px 0 22px; }
  .card, .form-card { padding: 22px 18px; border-radius: 16px; }
  .form-card__title { font-size: 20px; }
  .section { padding: 46px 0; }
  .section__title { font-size: 24px; }
  .section__sub { font-size: 15px; }
  .cta { padding: 46px 0; }
  .cta h2 { font-size: 24px; }
  .cta p { font-size: 16px; }
  .btn--lg { padding: 14px 26px; font-size: 16px; }
  .step, .benefit, .faq { box-shadow: var(--shadow-sm); }
}

/* Móvil pequeño */
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
  .benefits { grid-template-columns: 1fr; }
  .topbar__phone span { display: none; }
  .topbar__phone { padding: 9px 12px; }
  /* Botones principales a ancho completo para mejor toque */
  .hero__copy .btn--lg { display: block; width: 100%; text-align: center; }
  .cta .btn--lg { display: inline-block; width: 100%; max-width: 320px; }
  .hero h1 { font-size: 27px; }
  /* Chat a pantalla completa */
  .chat-launcher { right: 16px; bottom: 16px; }
  .chat-tip { right: 16px; bottom: 86px; max-width: 200px; }
  .chat-panel {
    right: 0; left: 0; top: 0; bottom: 0;
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    border-radius: 0;
  }
  /* Modal cómodo en pantallas chicas */
  .modal { padding: 14px; }
  .modal__box { padding: 26px 20px 22px; }
}
