/* ============================================================
   CHIHUAHUA LOVERS — Landing de captación
   Estilos mobile-first, estética blanca/premium, acento #A8518A
   ============================================================ */

/* ------------------------------------------------------------
   1. FUENTES PROPIAS (Delight)
   Coloca los archivos reales en /fonts:
     /fonts/Delight-Black-Negro.woff2   -> titulares
     /fonts/Delight-Normal.woff2        -> cuerpo / subtextos
   Mientras no existan, el navegador usa el fallback elegante.
------------------------------------------------------------ */
@font-face {
  font-family: 'Delight';
  src: url('/fonts/Delight-Normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Delight';
  /* "Black Negro" = peso máximo, usado en titulares */
  src: url('/fonts/Delight-Black-Negro.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------
   2. TOKENS / VARIABLES
------------------------------------------------------------ */
:root {
  /* Paleta */
  --color-white: #ffffff;
  --color-text: #1f1a1d;
  --color-text-soft: #6f646b;
  --color-accent: #a8518a;
  --color-accent-dark: #8f3f73; /* hover del botón */
  --color-accent-soft: #f8eef5; /* fondo suave */
  --color-border: #ebd7e5; /* borde suave */
  --color-bg-alt: #fcf8fb; /* fondo alternativo muy sutil */
  --color-green: #25b06a; /* punto de comunidad + checks */
  --color-green-soft: #e7f5ec; /* fondo suave de checks verdes */

  /* Tipografía */
  --font-heading: 'Delight', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Delight', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --container-max: 1180px;
  --container-narrow: 760px;
  --gutter: 20px; /* márgenes laterales en mobile */

  /* Radios y sombras */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-soft: 0 10px 30px rgba(31, 26, 29, 0.06);
  --shadow-card: 0 6px 24px rgba(168, 81, 138, 0.07);
  --shadow-focus: 0 0 0 4px rgba(168, 81, 138, 0.18);

  /* Transiciones */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.18s;
  --t-med: 0.32s;
}

/* ------------------------------------------------------------
   3. RESET / BASE
------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.6;
  font-size: 16px;
  /* Evita scroll horizontal en cualquier dispositivo */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* Accesibilidad: ocultar visualmente sin perder semántica */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible coherente en toda la landing */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 8px;
}

/* ------------------------------------------------------------
   4. LAYOUT / CONTENEDORES
------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: clamp(48px, 9vw, 96px);
}

.section__head {
  text-align: center;
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: clamp(28px, 5vw, 48px);
}

.section__title {
  /* El titular llena el ancho de la pantalla y se mantiene en 2 renglones
     (con <br class="brk">) en los anchos comunes (≥360px). El tamaño escala
     con el viewport para que la línea larga ocupe casi todo el ancho. */
  font-size: clamp(1.1rem, 5.45vw, 2.35rem);
  line-height: 1.2;
}

/* El salto de línea controlado de los titulares se respeta en TODOS
   los anchos: los títulos siempre quedan en 2 renglones. */
.brk {
  display: inline;
}

.section__subtitle {
  margin-top: 14px;
  color: var(--color-text-soft);
  font-size: clamp(1rem, 2.5vw, 1.125rem);
}

/* ------------------------------------------------------------
   5. DECORACIÓN DE FONDO (blobs blur rosados sutiles)
------------------------------------------------------------ */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

.blob--1 {
  width: 360px;
  height: 360px;
  top: -120px;
  right: -100px;
  background: var(--color-accent-soft);
}

.blob--2 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: -140px;
  background: #fbeef6;
  opacity: 0.6;
}

.blob--3 {
  width: 280px;
  height: 280px;
  bottom: -120px;
  right: -60px;
  background: var(--color-accent-soft);
  opacity: 0.45;
}

/* ------------------------------------------------------------
   6. HERO
------------------------------------------------------------ */
.hero {
  padding-top: clamp(40px, 8vw, 72px);
  padding-bottom: clamp(40px, 8vw, 80px);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  /* En mobile: texto → libro → formulario (el libro va entre el
     subtítulo y el campo de email). */
  grid-template-areas:
    'text'
    'media'
    'form';
  gap: clamp(36px, 8vw, 50px);
  align-items: center;
}

.hero__text {
  grid-area: text;
}
.hero__form-wrap {
  grid-area: form;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* Punto verde "en vivo" del badge de comunidad */
.eyebrow__dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 0 0 rgba(37, 176, 106, 0.45);
  animation: pulse-dot 2.4s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 176, 106, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(37, 176, 106, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 176, 106, 0);
  }
}

.hero__title {
  font-size: clamp(1.75rem, 7.5vw, 3.25rem);
  margin-bottom: 18px;
}

.hero__subtitle {
  color: var(--color-text-soft);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  max-width: 560px;
  /* El espacio hacia el libro lo da el gap del grid del hero. */
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   7. FORMULARIO
------------------------------------------------------------ */
.lead-form {
  max-width: 520px;
}

.lead-form__row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-form__input {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}

.lead-form__input::placeholder {
  color: #b4a8af;
}

.lead-form__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

/* Estado de error de validación */
.lead-form__input.is-invalid {
  border-color: #d2576f;
  box-shadow: 0 0 0 4px rgba(210, 87, 111, 0.14);
}

.lead-form__microcopy {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

.lead-form__message {
  margin-top: 12px;
  font-size: 0.92rem;
  font-weight: 400;
  min-height: 1.2em;
}

.lead-form__message.is-success {
  color: #2f8f5b;
}

.lead-form__message.is-error {
  color: #c0394f;
}

/* ------------------------------------------------------------
   8. BOTONES
------------------------------------------------------------ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 400;
  border: none;
  border-radius: var(--radius-sm);
  transition: background-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 8px 22px rgba(168, 81, 138, 0.22);
}

.btn--primary:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(168, 81, 138, 0.28);
}

.btn--primary:active {
  transform: translateY(0);
}

/* Estado cargando: oculta el label y muestra spinner */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.92;
}

.btn.is-loading .btn__label {
  visibility: hidden;
}

.btn__spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}

.btn.is-loading .btn__spinner {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

.btn:disabled {
  cursor: not-allowed;
}

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

/* ------------------------------------------------------------
   9. MOCKUP DE LA GUÍA (CSS)
------------------------------------------------------------ */
.hero__media {
  grid-area: media;
  display: flex;
  justify-content: center;
}

.guide-frame {
  position: relative;
  width: 100%;
  /* El PNG ya viene recortado al contorno del libro, así que este ancho
     es casi todo libro (se ve grande). Escala con el viewport en mobile. */
  max-width: min(240px, 88vw);
  display: flex;
  justify-content: center;
}

/* Resplandor rosado suave detrás del mockup del libro */
.guide-frame__glow {
  position: absolute;
  inset: 6% 6% -4% 6%;
  background: radial-gradient(
    ellipse at center,
    rgba(168, 81, 138, 0.2),
    rgba(168, 81, 138, 0) 70%
  );
  filter: blur(26px);
  z-index: 0;
}

.guide-mockup {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  /* La imagen ya es un render 3D con fondo transparente: la sombra
     sigue la silueta del libro para despegarlo del fondo blanco. */
  filter: drop-shadow(0 16px 32px rgba(31, 26, 29, 0.15));
  /* Movimiento muy sutil en flotación */
  animation: floaty 6s ease-in-out infinite;
}

/* Placeholder elegante mientras no exista /assets/guide-mockup.png */
.guide-mockup.is-missing {
  display: grid;
  place-items: center;
  width: 300px;
  height: 380px;
  padding: 28px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-soft);
  background: linear-gradient(160deg, #ffffff, var(--color-accent-soft));
  border: 1.5px dashed var(--color-border);
  filter: none;
  animation: none;
}

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

/* ------------------------------------------------------------
   10. BENEFICIOS (cards)
------------------------------------------------------------ */
/* Todas las secciones comparten el mismo fondo blanco: no hay cambios
   de color ni líneas divisorias entre una sección y la siguiente. La
   estructura visual la dan las tarjetas, paneles y los blobs de fondo. */
.benefits {
  background: transparent;
}

.cards {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  transition: transform var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(168, 81, 138, 0.12);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  margin-bottom: 18px;
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.card__text {
  color: var(--color-text-soft);
  font-size: 0.98rem;
}

/* ------------------------------------------------------------
   11. PARA QUIÉN ES (checklist)
------------------------------------------------------------ */
.audience__panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow-soft);
}

.audience__panel .section__title {
  text-align: center;
  margin-bottom: 28px;
}

.checklist {
  list-style: none;
  display: grid;
  gap: 16px;
}

.checklist__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--color-text);
  font-size: 1.02rem;
}

.checklist__check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-green-soft);
  color: var(--color-green);
  font-weight: 900;
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ------------------------------------------------------------
   12. CONFIANZA / COMUNIDAD
------------------------------------------------------------ */
.community {
  background: transparent;
}

.community__inner {
  text-align: center;
}

.community__inner .section__subtitle {
  margin-inline: auto;
  max-width: 600px;
}

.community__highlight {
  margin-top: 32px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px 28px;
  box-shadow: var(--shadow-card);
  max-width: 520px;
  margin-inline: auto;
}

.community__number {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--color-accent);
  line-height: 1;
}

.community__label {
  color: var(--color-text-soft);
  font-size: 1rem;
}

/* ------------------------------------------------------------
   13. CTA FINAL
------------------------------------------------------------ */
.cta-final__card {
  background: linear-gradient(170deg, var(--color-white), var(--color-accent-soft));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 56px);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.cta-final__card .section__title {
  margin-bottom: 12px;
}

.cta-final__card .section__subtitle {
  margin-inline: auto;
  max-width: 520px;
  margin-bottom: 28px;
}

.cta-final__card .lead-form {
  margin-inline: auto;
}

.cta-final__card .lead-form__microcopy,
.cta-final__card .lead-form__message {
  text-align: center;
}

/* ------------------------------------------------------------
   14. FOOTER
------------------------------------------------------------ */
.footer {
  /* Sin borde superior: el footer se funde con la sección anterior. */
  padding-block: 28px;
  background: transparent;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}

.footer__copy {
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  gap: 22px;
}

.footer__link {
  color: var(--color-text-soft);
  font-size: 0.9rem;
  transition: color var(--t-fast) var(--ease);
}

.footer__link:hover {
  color: var(--color-accent);
}

/* ------------------------------------------------------------
   15. ANIMACIONES DE APARICIÓN (reveal con IntersectionObserver)
------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}

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

/* ------------------------------------------------------------
   16. BREAKPOINTS
------------------------------------------------------------ */

/* Pantallas muy pequeñas (≤360px): apretar titulares sin romper jerarquía */
@media (max-width: 360px) {
  :root {
    --gutter: 18px;
  }
  .hero__title {
    font-size: 1.6rem;
  }
}

/* Tablet: cards en 2 columnas, formulario en línea */
@media (min-width: 640px) {
  .lead-form__row {
    flex-direction: row;
    align-items: stretch;
  }
  .lead-form__input {
    flex: 1;
  }
  .lead-form__row .btn {
    flex-shrink: 0;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop medio: 3 cards en fila */
@media (min-width: 920px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: hero en dos columnas. El texto y el formulario quedan a la
   izquierda (en dos filas) y el libro ocupa la columna derecha completa. */
@media (min-width: 980px) {
  .hero__grid {
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-areas:
      'text  media'
      'form  media';
    column-gap: clamp(40px, 5vw, 64px);
    align-items: center;
  }
  .hero__media {
    justify-content: flex-end;
    align-self: center;
  }
  .guide-frame {
    max-width: 440px;
  }
}

/* ------------------------------------------------------------
   17. PREFERS-REDUCED-MOTION
   Respeta a quien prefiere menos movimiento.
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .guide-mockup {
    animation: none;
  }
}
