:root {
  --ink: #00213c;
  --ink-soft: #4c6981;
  --ink-dark: #00101e;
  --blue: #1976d2;
  --blue-dark: #145ea8;
  --blue-light: #e8f1fa;
  --gold: #bb9111;
  --gold-soft: #f3ead0;
  --paper: #ffffff;
  --surface: #f7f9fc;
  --surface-strong: #eef3f8;
  --line: #dbe3eb;
  --muted: #607286;
  --shadow: 0 18px 42px rgba(0, 33, 60, 0.12);
  --radius: 8px;
  --container: 1180px;
  /* Curva de salida suave: arranca rápido y frena con calma */
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-slide: cubic-bezier(0.32, 0.72, 0, 1);
  --t-fast: 200ms;
  --t-base: 320ms;
  --t-slow: 620ms;
}

* {
  box-sizing: border-box;
}

/* El atributo `hidden` debe ganar siempre. Sin esto, cualquier regla con
   display: flex/grid lo anula y el elemento se ve aunque este marcado como
   oculto (le pasaba al aviso verde de fin de conversacion). */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  line-height: 1.6;
}

body::selection {
  background: var(--gold-soft);
  color: var(--ink-dark);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-150%);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(219, 227, 235, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 148px;
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-note,
.phone-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  transition:
    transform var(--t-base) var(--ease-soft),
    box-shadow var(--t-base) var(--ease-soft),
    background var(--t-base) var(--ease-soft),
    color var(--t-base) var(--ease-soft),
    border-color var(--t-base) var(--ease-soft);
}

/* El icono acompaña al botón en el hover, no salta */
.button svg {
  transition: transform var(--t-base) var(--ease-soft);
}

.button:hover svg {
  transform: translateX(3px);
}

a,
summary,
.step-card,
.benefit-card,
.testimonial-card,
.image-panel > img,
.lead-form input,
.trust-logos img,
.footer-links a {
  transition:
    transform var(--t-base) var(--ease-soft),
    box-shadow var(--t-base) var(--ease-soft),
    border-color var(--t-base) var(--ease-soft),
    background var(--t-base) var(--ease-soft),
    color var(--t-base) var(--ease-soft),
    opacity var(--t-base) var(--ease-soft);
}

.step-card:hover,
.benefit-card:hover,
.testimonial-card:hover {
  transform: translateY(-4px);
  border-color: rgba(25, 118, 210, 0.32);
  box-shadow: 0 16px 34px rgba(0, 33, 60, 0.1);
}

/* Aparición al entrar en pantalla. La clase la añade script.js, así que
   sin JS el contenido se ve siempre. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--t-slow) var(--ease-soft),
    transform var(--t-slow) var(--ease-soft);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Accesibilidad: quien pide menos movimiento no ve nada de esto */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .logo-track {
    animation: none;
  }
}

.header-note,
.phone-link {
  color: var(--ink);
  padding: 0 10px;
}

.header-note {
  font-weight: 700;
}

.header-note svg,
.phone-link svg,
.button svg,
.eyebrow svg,
.hero-points svg,
.benefit-card svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0 22px;
  cursor: pointer;
}

.button:hover,
.phone-link:hover {
  transform: translateY(-1px);
}

.button:hover {
  background: var(--ink-dark);
}

.button-small {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 0.92rem;
}

.button-full {
  width: 100%;
  min-height: 50px;
}

.button-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--surface);
}

.hero {
  background:
    linear-gradient(90deg, rgba(232, 241, 250, 0.96), rgba(255, 255, 255, 0.95)),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.72fr);
  align-items: center;
  gap: 56px;
  padding: 34px 0 42px;
}

.hero-content {
  max-width: 690px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--ink);
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 22px;
  color: var(--ink-dark);
  font-size: 3.75rem;
  line-height: 1.05;
  font-weight: 800;
}

.h1-highlight {
  color: var(--blue-dark);
}

h2 {
  margin-bottom: 18px;
  color: var(--ink-dark);
  font-size: 2.6rem;
  line-height: 1.12;
  font-weight: 800;
}

h3 {
  margin-bottom: 10px;
  color: var(--ink-dark);
  font-size: 1.12rem;
  line-height: 1.25;
}

.hero-lead {
  max-width: 640px;
  margin-bottom: 28px;
  color: var(--ink-soft);
  font-size: 1.14rem;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin-bottom: 26px;
}

.hero-points span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  color: var(--ink);
  font-weight: 700;
}

.hero-points svg {
  color: var(--gold);
}

.lead-card {
  background: var(--paper);
  border: 1px solid rgba(219, 227, 235, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lead-form {
  padding: 22px;
}

.form-heading {
  margin-bottom: 16px;
}

.form-heading p {
  margin-bottom: 6px;
  color: var(--blue-dark);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-heading h2 {
  margin-bottom: 0;
  font-size: 1.42rem;
  line-height: 1.22;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.lead-form label {
  display: grid;
  gap: 7px;
}

.lead-form label span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.lead-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
}

/* Teléfono con prefijo fijo: deja claro que solo se aceptan números de España */
.tel-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.tel-prefijo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-strong);
  color: var(--ink-soft);
  padding: 0 11px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lead-form .tel-group input {
  border-radius: 0 var(--radius) var(--radius) 0;
  min-width: 0;
}

.campo-ayuda {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.lead-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.lead-form input::placeholder {
  color: #8796a5;
}

/* Selector de franja horaria: cuatro botones en vez de un campo de hora */
.time-pref {
  min-width: 0;
  margin: 15px 0 0;
  padding: 0;
  border: 0;
}

.time-pref legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.time-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lead-form .time-chip {
  display: block;
  gap: 0;
  cursor: pointer;
}

.lead-form .time-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.lead-form .time-chip > span {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-height: 82px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 4px;
  text-align: center;
  transition:
    background var(--t-base) var(--ease-soft),
    border-color var(--t-base) var(--ease-soft),
    color var(--t-base) var(--ease-soft),
    box-shadow var(--t-base) var(--ease-soft),
    transform var(--t-base) var(--ease-soft);
}

.time-chip svg {
  width: 21px;
  height: 21px;
  margin-bottom: 5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--blue-dark);
  transition: color var(--t-base) var(--ease-soft);
}

.time-chip strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.time-chip small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.2;
}

.lead-form .time-chip:hover > span {
  border-color: var(--blue);
  background: var(--paper);
  transform: translateY(-2px);
}

.lead-form .time-chip input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 33, 60, 0.2);
}

.time-chip input:checked + span svg,
.time-chip input:checked + span strong {
  color: var(--paper);
}

.time-chip input:checked + span small {
  color: rgba(255, 255, 255, 0.72);
}

.lead-form .time-chip input:focus-visible + span {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.28);
}

.checkbox {
  grid-template-columns: 18px 1fr;
  align-items: start;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.checkbox input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--ink);
}

.checkbox a {
  color: var(--blue-dark);
  font-weight: 700;
}

.lead-form .button {
  margin-top: 16px;
}

/* Alternativa al formulario: chat con el asistente */
.form-alt {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.form-alt-sep {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-alt-sep::before,
.form-alt-sep::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.chat-cta {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.chat-cta svg {
  color: var(--blue);
}

.chat-cta:hover {
  background: var(--blue-light);
  border-color: var(--blue-dark);
}

.lead-form .chat-cta {
  margin-top: 0;
}

.privacy-note,
.form-success {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.42;
}

.form-success {
  color: #0b6b48;
  font-weight: 700;
}

.section {
  padding: 92px 0;
}

/* Franja completa en azul con el carrusel encima, sin tarjetas por logo */
.logo-carousel-section {
  --logo-gap: 72px;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  padding: 62px 0 66px;
}

.logo-carousel-title {
  margin: 0 0 40px;
  color: var(--paper);
  font-size: 1.34rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.logo-carousel {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.logo-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: var(--logo-gap);
  animation: logo-scroll 34s linear infinite;
}

.logo-carousel:hover .logo-track {
  animation-play-state: paused;
}

/* Los logos vienen en lienzos cuadrados de 1000x1000 con el logotipo en una
   banda centrada. Recortamos el lienzo sobrante con overflow y damos a cada
   uno el ancho que iguala su altura óptica (~40 px). */
.logo-slide {
  display: flex;
  flex: 0 0 auto;
  padding: 0;
}

/* `cover` recorta el lienzo transparente sobrante por arriba y por abajo y
   deja centrada la banda del logotipo. Con `contain` o con overflow el logo
   se salía de la caja: un contenedor con overflow deja de centrar y alinea
   arriba. */
.logo-slide img {
  --logo-w: 164px;
  width: var(--logo-w);
  height: 56px;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  opacity: 0.92;
}

/* Ancho calculado para que el logotipo de cada marca mida ~40 px de alto.
   Se enlaza por data-logo y no por la ruta del archivo: así sigue valiendo
   si el logo se renombra o se sirve desde otro origen. */
.logo-slide img[data-logo="asisa"] {
  --logo-w: 204px;
}

.logo-slide img[data-logo="adeslas"] {
  --logo-w: 156px;
}

.logo-slide img[data-logo="sanitas"] {
  --logo-w: 110px;
}

.logo-slide img[data-logo="acunsa"] {
  --logo-w: 136px;
}

.logo-slide img[data-logo="dkv"] {
  --logo-w: 164px;
}

@keyframes logo-scroll {
  from {
    transform: translateX(0);
  }

  to {
    /* Media pista + medio hueco = un ciclo exacto, sin salto visible */
    transform: translateX(calc(-50% - var(--logo-gap) / 2));
  }
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1fr);
  align-items: center;
  gap: 58px;
}

.section-copy {
  max-width: 560px;
}

.section-copy p,
.section-heading p,
.trust-grid p,
.faq-copy p,
.final-cta p {
  color: var(--ink-soft);
}

.image-panel {
  position: relative;
  margin: 0;
}

.image-panel > img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.image-panel figcaption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 2px;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 227, 235, 0.92);
  border-radius: var(--radius);
  color: var(--ink-soft);
  padding: 16px;
}

.image-panel figcaption strong {
  color: var(--ink-dark);
  font-size: 1.16rem;
}

.steps-section,
.faq-section {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 36px;
}

.section-heading.narrow {
  max-width: 740px;
  margin-inline: auto;
  text-align: center;
}

.steps-grid,
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.step-card,
.benefit-card,
.testimonial-card,
details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step-card {
  position: relative;
  min-height: 286px;
  padding: 26px 22px 22px;
}

.step-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 24px;
}

.step-number {
  position: absolute;
  right: 18px;
  top: 18px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-weight: 800;
}

.step-card p,
.benefit-card p,
.testimonial-card blockquote {
  color: var(--muted);
}

.benefit-grid {
  margin-top: 38px;
}

.benefit-card {
  min-height: 250px;
  padding: 26px 22px;
}

.benefit-card svg {
  width: 38px;
  height: 38px;
  margin-bottom: 22px;
  color: var(--gold);
}

.trust-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  gap: 58px;
  align-items: start;
}

.trust-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.trust-logos img {
  height: 54px;
  width: 126px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.testimonial-grid {
  display: grid;
  gap: 14px;
}

.testimonial-card {
  margin: 0;
  padding: 22px;
}

.testimonial-card blockquote {
  margin: 0 0 14px;
}

.testimonial-card figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-dark);
  font-weight: 800;
}

/* Avatar genérico: son reseñas reales pero sin foto del cliente */
.testimonial-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
}

.testimonial-avatar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.testimonial-person {
  display: grid;
  min-width: 0;
}

.testimonial-person strong {
  color: var(--ink-dark);
  font-weight: 800;
  line-height: 1.3;
}

.testimonial-person span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(420px, 1fr);
  gap: 58px;
  align-items: start;
}

.faq-copy {
  position: sticky;
  top: 112px;
}

.faq-copy .button {
  margin-top: 12px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

details {
  padding: 0;
}

summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 20px 52px 20px 22px;
  color: var(--ink-dark);
  font-weight: 800;
}

summary::-webkit-details-marker {
  display: none;
}

summary:hover {
  color: var(--blue-dark);
}

/* Chevron dibujado en CSS: gira suave al abrir en vez de saltar de + a - */
summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--blue-dark);
  border-bottom: 2px solid var(--blue-dark);
  translate: 0 -60%;
  rotate: 45deg;
  transition: rotate var(--t-base) var(--ease-slide);
}

details[open] summary::after {
  rotate: 225deg;
}

.faq-list details {
  overflow: hidden;
}

/* script.js anima la altura de este contenedor al abrir y cerrar */
.faq-answer {
  overflow: hidden;
}

details p {
  margin: 0;
  padding: 0 22px 22px;
  color: var(--muted);
}

.final-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0;
}

.final-cta-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
}

.final-cta .section-kicker,
.final-cta h2,
.final-cta p {
  color: var(--paper);
}

.final-cta h2 {
  max-width: 720px;
  margin-bottom: 12px;
}

.final-cta p {
  max-width: 620px;
  margin-bottom: 0;
  opacity: 0.82;
}

.final-cta .button {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  white-space: nowrap;
}

.site-footer {
  padding: 46px 0;
  background: var(--ink-dark);
  color: rgba(255, 255, 255, 0.76);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(420px, 1fr);
  gap: 44px;
}

.footer-logo {
  width: 140px;
  margin-bottom: 18px;
}

.site-footer p {
  max-width: 460px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 22px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--paper);
  text-decoration: underline;
}

.thanks-page {
  min-height: 100vh;
  background: var(--surface);
}

.thanks-hero {
  min-height: calc(100vh - 78px);
  display: grid;
  align-items: center;
  padding: 64px 0;
}

.thanks-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
  gap: 44px;
  align-items: center;
}

.thanks-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 42px;
}

.thanks-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
}

.thanks-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thanks-card h1 {
  margin-bottom: 18px;
  font-size: 3.1rem;
}

.thanks-card > p {
  max-width: 660px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.thanks-next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}

.thanks-next article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.thanks-next span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.thanks-next h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.thanks-next p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.thanks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.thanks-image {
  margin: 0;
}

.thanks-image img {
  width: 100%;
  aspect-ratio: 1.08;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 1040px) {
  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .hero-grid,
  .split-section,
  .trust-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    gap: 36px;
    padding: 48px 0 56px;
  }

  .hero-content,
  .section-copy {
    max-width: none;
  }

  .lead-card {
    max-width: 620px;
  }

  .steps-grid,
  .benefit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faq-copy {
    position: static;
  }

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

  .footer-links {
    justify-content: flex-start;
  }

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

  .thanks-card h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .header-inner {
    min-height: 70px;
  }

  .brand img {
    width: 126px;
  }

  .header-note span,
  .phone-link span {
    display: none;
  }

  .button-small {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 0.84rem;
  }

  .hero-grid {
    padding: 38px 0 48px;
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero-lead {
    font-size: 1.02rem;
  }

  .hero-points,
  .steps-grid,
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .lead-form {
    padding: 22px;
  }

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

  .form-grid label:nth-child(3) {
    grid-column: auto;
  }

  .section {
    padding: 68px 0;
  }

  .logo-carousel-section {
    --logo-gap: 44px;
    padding: 46px 0 48px;
  }

  .logo-carousel-title {
    margin-bottom: 28px;
    font-size: 1.1rem;
  }

  .logo-track {
    animation-duration: 26s;
  }

  .logo-slide img {
    width: calc(var(--logo-w) * 0.8);
    height: 46px;
  }

  .image-panel figcaption {
    position: static;
    max-width: none;
    margin-top: 12px;
  }

  .step-card,
  .benefit-card {
    min-height: auto;
  }

  .section-heading.narrow {
    text-align: left;
  }

  .final-cta-inner {
    grid-template-columns: 1fr;
  }

  .final-cta .button {
    width: 100%;
  }

  .thanks-hero {
    padding: 42px 0;
  }

  .thanks-card {
    padding: 26px;
  }

  .thanks-card h1 {
    font-size: 2.1rem;
  }

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

  .thanks-actions .button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .header-actions {
    gap: 6px;
  }

  .button-small span {
    max-width: 112px;
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 2.18rem;
  }

  h2 {
    font-size: 1.78rem;
  }

  .lead-form {
    padding: 18px;
  }

  .checkbox {
    font-size: 0.8rem;
  }
}

/* ==================================================================
   Chat con el asistente (chat.html). Reutiliza los mismos tokens de
   color, tipografia y radios que la landing.
   ================================================================== */

.chat-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--surface);
}

.chat-main {
  flex: 1;
  display: flex;
  padding: 38px 0 48px;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(400px, 1fr);
  align-items: stretch;
  gap: 48px;
  width: min(100% - 40px, var(--container));
}

.chat-intro {
  align-self: center;
  max-width: 480px;
}

.chat-intro h1 {
  margin-bottom: 16px;
  font-size: 2.9rem;
}

.chat-intro > p {
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.chat-facts {
  display: grid;
  gap: 12px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.chat-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
}

.chat-facts svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--gold);
}

/* Volver a la landing, en la cabecera del propio chat */
.chat-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--t-base) var(--ease-soft),
    border-color var(--t-base) var(--ease-soft);
}

.chat-back:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
}

.chat-back svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-base) var(--ease-soft);
}

/* La flecha apunta a la izquierda: se mueve al reves que la de los botones */
.chat-back:hover svg {
  transform: translateX(-3px);
}

/* En pantallas estrechas el icono basta */
@media (max-width: 460px) {
  .chat-back span {
    display: none;
  }

  .chat-back {
    padding: 7px 9px;
  }
}

/* ---------- Panel de conversacion ---------- */

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: min(74vh, 680px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 18px;
}

.chat-panel-head strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.chat-avatar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
}

.chat-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fbf7f;
}

/* ---------- Mensajes ---------- */

.chat-log {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px;
  overscroll-behavior: contain;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-who {
  margin: 0 4px 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chat-bubble {
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: chat-entra 300ms var(--ease-soft) both;
}

.chat-msg-user .chat-bubble {
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 2px;
}

.chat-msg-assistant .chat-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 2px;
}

@keyframes chat-entra {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Tres puntos mientras el asistente redacta */
.chat-typing .chat-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 15px 14px;
}

.chat-typing .chat-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: chat-punto 1.25s var(--ease-soft) infinite;
}

.chat-typing .chat-bubble span:nth-child(2) {
  animation-delay: 0.16s;
}

.chat-typing .chat-bubble span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes chat-punto {
  0%, 60%, 100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* ---------- Cierre y composicion ---------- */

.chat-done {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  background: #e8f6ef;
  border-top: 1px solid #bfe3d2;
  color: #0b6b48;
  padding: 11px 18px;
  font-size: 0.86rem;
  font-weight: 700;
}

.chat-done svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 14px;
}

.chat-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 132px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 13px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  outline: none;
  transition:
    border-color var(--t-base) var(--ease-soft),
    box-shadow var(--t-base) var(--ease-soft);
}

.chat-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.chat-form textarea::placeholder {
  color: #8796a5;
}

.chat-send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition:
    background var(--t-base) var(--ease-soft),
    transform var(--t-base) var(--ease-soft),
    opacity var(--t-base) var(--ease-soft);
}

.chat-send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-send:hover:not(:disabled) {
  background: var(--ink-dark);
  transform: translateY(-1px);
}

.chat-send:disabled,
.chat-form textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-legal {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.chat-legal a {
  color: var(--blue-dark);
  font-weight: 700;
}

@media (max-width: 1040px) {
  .chat-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .chat-intro {
    max-width: none;
  }

  .chat-intro h1 {
    font-size: 2.3rem;
  }

  .chat-panel {
    height: min(70vh, 620px);
  }
}

@media (max-width: 720px) {
  .chat-main {
    padding: 24px 0 32px;
  }

  .chat-layout {
    width: min(100% - 28px, var(--container));
  }

  .chat-intro h1 {
    font-size: 1.95rem;
  }

  .chat-facts {
    margin-bottom: 20px;
  }

  .chat-panel {
    height: 68vh;
  }

  .chat-msg {
    max-width: 90%;
  }
}
