/* ==========================================================================
   SISTEMA VISUAL — CLEAR ONBOARDING ("Las 10 reglas de oro")
   Tokens y especificaciones exactas del README.md y prototipos v2.dc
   ========================================================================== */

:root {
  --navy: #012B8B;
  --navy-deep: #011E63;
  --blue-mid: #0A3AA6;
  --cyan: #009ED7;
  --cyan-hover: #0089BC;
  --sky-bg: #E3F8FE;
  --sky-soft: #EEF9FD;
  --white: #FFFFFF;
  --text-dark: #1B2440;
  --text-secondary: #5A6785;
  --text-hero-sub: #3E4C6E;
  --border-input: #C9D6E8;
  --border-soft: #E3EAF4;
  --err-border: #D93B3B;
  --err-bg: #FFF7F7;
  --err-text: #C62828;
  --err-alert-bg: #FFF1F1;
  --err-alert-text: #9E1F1F;
  --label-dark-bg: #8FDCF7;
  --note-dark-bg: #A9DFF4;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  font-family: 'Poppins', Arial, sans-serif;
  color: var(--text-dark);
}

a {
  color: var(--navy);
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

a:hover {
  color: var(--cyan);
}

input, select, button, textarea {
  font-family: inherit;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--white);
}

/* --------------------------------------------------------------------------
   Efectos: Cristal líquido (Glass claro y oscuro) + Grano SVG
   -------------------------------------------------------------------------- */
.glass-light {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.30));
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -10px 24px rgba(255, 255, 255, 0.20),
    0 24px 48px -24px rgba(1, 43, 139, 0.35);
}

.glass-light::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 15% 0%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-light {
    background: rgba(255, 255, 255, 0.88);
  }
}

.glass-dark {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.07));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 20px 40px -20px rgba(0, 0, 0, 0.45);
}

.grain-light,
.grain-dark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grain-light {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

.grain-hero {
  opacity: 0.07;
  mix-blend-mode: multiply;
}

.grain-dark {
  opacity: 0.14;
  mix-blend-mode: overlay;
}

.grain-card {
  opacity: 0.12;
  mix-blend-mode: overlay;
}

/* --------------------------------------------------------------------------
   4.1 Menú flotante (sticky)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 10px;
  z-index: 50;
  margin: 10px clamp(10px, 3vw, 24px) -76px;
}

.header-pill {
  max-width: 1160px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  min-height: 60px;
  padding: 8px 8px 8px clamp(16px, 3vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo {
  position: relative;
  height: clamp(26px, 3.4vw, 34px);
  width: auto;
  display: block;
}

.header-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--blue-mid);
  color: var(--white);
}

.header-cta:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Botones principales
   -------------------------------------------------------------------------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 16px;
  background: linear-gradient(180deg, #14B0E8, #009ED7 55%, #008FC4);
  color: var(--white);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 14px 28px -10px rgba(0, 158, 215, 0.8);
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-1px);
  color: var(--white);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 18px 34px -10px rgba(0, 158, 215, 0.9);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4.2 Hero
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  overflow: hidden;
  background: var(--sky-bg);
}

.hero-container {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(86px, 10vw, 150px) clamp(20px, 5vw, 48px) clamp(36px, 6vw, 96px);
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 4vw, 56px);
}

.hero-book-col {
  flex: 1 1 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: clamp(220px, 36vw, 500px);
}

.hero-number-bg {
  position: absolute;
  font-weight: 800;
  font-size: clamp(210px, 32vw, 450px);
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(1, 43, 139, 0.13);
  user-select: none;
  pointer-events: none;
}

.book-stage {
  position: relative;
  perspective: 1400px;
}

.book-3d {
  position: relative;
  width: clamp(130px, 21vw, 280px);
  aspect-ratio: 0.773;
  transform: rotateY(26deg) rotateX(4deg) rotateZ(-2deg);
  transform-style: preserve-3d;
}

.book-3d--thanks {
  width: clamp(118px, 18vw, 230px);
}

.book-spine {
  position: absolute;
  left: -18px;
  top: 0;
  width: 18px;
  height: 100%;
  transform-origin: right center;
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #011E63, #012B8B 60%, #0A3AA6);
  border-radius: 3px 0 0 3px;
}

.book-cover {
  position: absolute;
  inset: 0;
  border-radius: 2px 8px 8px 2px;
  overflow: hidden;
  background: var(--white);
  box-shadow:
    0 30px 50px -18px rgba(1, 43, 139, 0.55),
    0 8px 18px rgba(1, 43, 139, 0.18);
}

.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-hinge-shadow {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.book-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 32%);
}

.book-floor-shadow {
  position: absolute;
  left: 8%;
  right: -6%;
  bottom: -22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(1, 43, 139, 0.30);
  filter: blur(12px);
}

.floating-badge {
  position: absolute;
  z-index: 4;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px 7px 7px;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.floating-badge--top {
  top: 8%;
  left: 0;
}

.floating-badge--bottom {
  bottom: 6%;
  right: 0;
}

.badge-check {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-copy-col {
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 1.6vw, 18px);
}

.tag-pill {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 14px;
}

.hero-h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--navy);
  text-wrap: balance;
}

.marker-highlight {
  background: linear-gradient(transparent 62%, rgba(0, 158, 215, 0.38) 62%);
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--text-hero-sub);
  max-width: 520px;
  text-wrap: pretty;
}

/* Ajuste mobile-first estricto para que el Hero se vea COMPLETO sin scroll en 390x844 */
@media (max-width: 759px) {
  .hero-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 20px 18px;
    gap: 10px;
  }
  .hero-book-col {
    flex: none;
    width: 100%;
    min-height: 184px;
  }
  .book-3d {
    width: 126px;
  }
  .hero-number-bg {
    font-size: 185px;
  }
  .floating-badge--top {
    top: 4%;
    left: 0;
  }
  .floating-badge--bottom {
    bottom: 2%;
    right: 0;
  }
  .hero-copy-col {
    flex: none;
    width: 100%;
    gap: 8px;
  }
  .hero-h1 {
    font-size: clamp(26px, 7vw, 33px);
  }
  .hero-subtitle {
    font-size: 14.5px;
    line-height: 1.42;
  }
  .hero-copy-col .btn-primary {
    width: 100%;
    min-height: 52px;
  }
}

/* --------------------------------------------------------------------------
   Sección 8: Píldora de Video en Hero + Bloque TikTok 9:16 + Modal
   -------------------------------------------------------------------------- */
.hero-video-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 14px 5px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.hero-video-pill:hover {
  transform: translateY(-1px);
  color: var(--navy);
}

.hero-video-pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.tiktok-part-tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tiktok-part-tab:hover {
  background: rgba(255, 255, 255, 0.20);
}

.tiktok-part-tab.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(0, 158, 215, 0.75);
}

.video-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(1, 18, 58, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.video-modal-backdrop.open {
  display: flex;
}

/* --------------------------------------------------------------------------
   4.3 Dolor (¿Te suena familiar?)
   -------------------------------------------------------------------------- */
.pain-carousel-outer {
  margin: 0 calc(clamp(20px, 5vw, 48px) * -1);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pain-carousel-outer::-webkit-scrollbar {
  display: none;
}

.pain-carousel-track {
  display: flex;
  gap: 16px;
  width: max-content;
  margin: 0 auto;
  padding: 4px clamp(20px, 5vw, 48px) 12px;
}

@media (min-width: 1024px) {
  .pain-carousel-track {
    width: 100%;
    justify-content: center;
  }
  .pain-card {
    flex: 1 1 320px !important;
    max-width: 352px;
  }
}

/* --------------------------------------------------------------------------
   4.6 Formulario — Estados de foco, error y controles interactivos
   -------------------------------------------------------------------------- */
.form-input,
.form-select {
  height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--border-input);
  background-color: var(--white);
  padding: 0 16px;
  font-size: 16px;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  width: 100%;
}

.form-select {
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23012B8B' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 158, 215, 0.15);
}

.form-input.has-error,
.form-select.has-error {
  border-color: var(--err-border);
  background-color: var(--err-bg);
}

.field-error {
  display: none;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--err-text);
  font-weight: 500;
}

.field-error.visible {
  display: flex;
}

.team-btn {
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--border-input);
  background: var(--white);
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-btn:hover {
  border-color: var(--cyan);
}

.team-btn:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.team-btn[aria-checked="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.concern-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-soft);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s ease;
}

.concern-row:hover {
  border-color: var(--border-input);
}

.concern-row.selected {
  background: #F0FAFE;
  border-color: var(--cyan);
}

.custom-checkbox-box {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #9AABC4;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.custom-checkbox-box.checked {
  background: var(--cyan);
  border-color: var(--cyan);
}

.custom-checkbox-box.has-error {
  border-color: var(--err-border);
}

.custom-checkbox-box svg {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.custom-checkbox-box.checked svg {
  opacity: 1;
}

.sr-only-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.sr-only-input:focus-visible + .custom-checkbox-box {
  box-shadow: 0 0 0 4px rgba(0, 158, 215, 0.25);
  border-color: var(--cyan);
}

.submit-btn {
  min-height: 56px;
  border: none;
  border-radius: 14px;
  background: var(--cyan);
  color: var(--white);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(0, 158, 215, 0.7);
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.submit-btn:hover:not(:disabled) {
  background: var(--cyan-hover);
}

.submit-btn:disabled {
  background: #5FBFE3;
  cursor: wait;
}

/* --------------------------------------------------------------------------
   4.9 Barra fija inferior (solo celular, < 760px)
   -------------------------------------------------------------------------- */
.mobile-sticky-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  overflow: hidden;
  border-radius: 22px;
  padding: 8px;
  transform: translateY(130%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.mobile-sticky-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 760px) {
  .mobile-sticky-bar {
    display: none !important;
  }
}

/* Footer */
.footer-link {
  color: var(--white);
  text-decoration: none;
}

.footer-link:hover {
  color: #9FE3FA;
}

/* Ocultar badge publicitario inyectado por Netlify en planes gratuitos */
iframe[src*="netlify"],
iframe[title*="Netlify" i],
iframe[id*="netlify" i],
[id*="netlify-badge" i],
[class*="netlify-badge" i],
[data-netlify-badge],
netlify-badge,
div[style*="z-index: 2147483647"],
div[style*="z-index:2147483647"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  max-height: 0 !important;
  max-width: 0 !important;
  position: absolute !important;
  left: -99999px !important;
  bottom: -99999px !important;
  overflow: hidden !important;
}

