/* ==========================================================================
   HAVEN PSICOLOGÍA · Estilos compartidos multipágina + Transición de Marca + IA
   ========================================================================== */

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --logo: clamp(9.5rem, 26vmin, 14.25rem);
  --hero-logo-shift: clamp(92px, 13.5vh, 124px);
  --hero-logo-gap: clamp(44px, 5.5vh, 64px);
  color-scheme: light;
  scrollbar-color: #CBD5E1 #F8FAFC;
}

/* Base semántica y superficies del navegador (Craft Floor) */
html, body {
  background-color: #ffffff;
  color: #1E293B;
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  caret-color: #0E294B;
}

::selection {
  background-color: #0E294B;
  color: #ffffff;
}

a {
  text-underline-offset: 0.22em;
}

p {
  text-wrap: pretty;
  max-width: 50ch !important;
}

footer div.mt-4.pt-3,
footer .border-y > p {
  max-width: 50ch !important;
  margin-inline: auto;
}

.text-center > p,
p.text-center {
  margin-inline: auto;
}

p.text-\[11px\],
div.text-\[11px\],
.text-\[11px\] p {
  font-size: 0.75rem !important;
}

input::placeholder,
textarea::placeholder {
  color: #64748B !important;
  opacity: 1;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: #0E294B;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 4.2vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.625rem, 2.8vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 800;
}

h3 {
  font-size: 1.3125rem;
  line-height: 1.3;
  font-weight: 700;
}

h4 {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 700;
}

table, .tabular-nums, .font-mono {
  font-variant-numeric: tabular-nums;
}

/* Fallbacks estructurales sin FOUC antes del runtime JIT */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.bg-brand-navy { background-color: #0E294B; color: #ffffff; }
.bg-brand-deep { background-color: #16325B; color: #ffffff; }
.bg-slate-900 { background-color: #0f172a; color: #ffffff; }
.bg-brand-teal { background-color: #2EC4B6; color: #0E294B; }
.bg-emerald-700 { background-color: #047857; color: #ffffff; }
.bg-brand-navy .bg-white,
.bg-brand-deep .bg-white,
.bg-slate-900 .bg-white {
  background-color: #ffffff;
  color: #0E294B;
}

.text-white { color: #ffffff !important; }
.text-brand-navy { color: #0E294B; }
.text-brand-blue { color: #2B6CB0; }
.text-brand-teal { color: #0F766E !important; }
.bg-brand-navy .text-brand-teal,
.bg-brand-deep .text-brand-teal,
.bg-slate-900 .text-brand-teal,
footer .text-brand-teal {
  color: #2EC4B6 !important;
}
.text-brand-text { color: #1E293B; }
.text-brand-muted { color: #475569 !important; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #475569 !important; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }

footer.bg-brand-navy h1,
footer.bg-brand-navy h2,
footer.bg-brand-navy h3,
footer.bg-brand-navy h4,
#cookie-banner,
#cookie-banner p,
.bg-brand-navy h1,
.bg-brand-navy h2,
.bg-brand-navy h3,
.bg-brand-navy h4 {
  color: #ffffff;
}

#cookie-banner button.bg-white {
  color: #0E294B !important;
}

/* Espaciado interior base para contenedores y tarjetas */
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-7 { padding: 1.75rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Capa fija a pantalla completa para Topographic Flow (detrás de toda la interfaz) */
#topographic-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #ffffff;
}

.haven-layer {
  position: relative;
  z-index: 10;
  padding: 1rem;
}
header.haven-layer,
main.haven-layer {
  padding: 0;
}
footer.haven-layer {
  padding: 4rem 1rem 3rem;
}

.haven-glass {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.25rem;
}

.haven-glass-strong {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem;
}
header.haven-glass-strong {
  padding: 0;
}

.gradient-ig {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  padding: 1rem;
}

.modal-backdrop > div {
  background-color: #ffffff;
  color: #1E293B;
  padding: 1.5rem;
}

/* Enlace accesible para teclado */
.skip-to-content:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background-color: #0E294B;
  color: #FFFFFF;
  border-radius: 0.75rem;
  font-weight: 700;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.12);
  outline: 2px solid #2B6CB0;
}

/* Enlaces de navegación superior */
.nav-link {
  position: relative;
  padding: 0.45rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1E293B;
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.nav-link:hover {
  color: #0E294B;
  background-color: rgba(15, 23, 42, 0.05);
}
.nav-link[aria-current="page"] {
  color: #0E294B;
  font-weight: 700;
  background-color: rgba(46, 196, 182, 0.16);
}

@keyframes fade-only {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   PORTADA CINEMÁTICA (Apple / Tesla Style): Desmontaje y Reconstrucción HAVEN
   ========================================================================== */

.haven-cinema-track {
  position: relative;
  height: 265vh;
  height: 265svh;
}

.cinema-anchor-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.cinema-anchor-bottom {
  position: absolute;
  bottom: 100vh;
  bottom: 100svh;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.haven-cinema-sticky {
  position: sticky;
  top: 5rem;
  height: calc(100vh - 5rem);
  height: calc(100svh - 5rem);
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
}

/* Escenario geométrico central compartido entre Inicio y Títulos */
.cinema-stage {
  --Ro: clamp(4.25rem, 19vmin, 10.5rem);
  --Rx: calc(var(--Ro) * 1.98);
  --Ry: calc(var(--Ro) * 1.62);
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

@media (max-aspect-ratio: 4/5) {
  .cinema-stage {
    --Ro: clamp(3.55rem, 18.5vw, 8.5rem);
    --Rx: calc(var(--Ro) * 1.96);
    --Ry: calc(var(--Ro) * 2.28);
  }
}

@media (max-height: 560px) and (min-aspect-ratio: 5/4) {
  .cinema-stage {
    --Ro: clamp(3rem, 15vh, 5.8rem);
    --Rx: calc(var(--Ro) * 2.85);
    --Ry: calc(var(--Ro) * 1.95);
  }
  :root {
    --logo: clamp(6.75rem, 26vh, 9.25rem);
    --hero-logo-shift: 78px;
    --hero-logo-gap: 28px;
  }
}

/* Planos técnicos / anillos orbitales durante el desmontaje y reconstrucción */
.cinema-blueprint {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--Rx) * 2.18);
  height: calc(var(--Ry) * 2.18);
  max-width: 92vw;
  max-height: 82vh;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  z-index: 1;
}

/* Núcleo de marca HAVEN */
.cinema-brand-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, calc(-50% - var(--hero-logo-shift)));
  will-change: transform;
}

.cinema-logo-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(var(--logo) * 1.08);
  height: calc(var(--logo) * 1.08);
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.cinema-logo-btn:focus-visible {
  outline: 2px solid #2B6CB0;
  outline-offset: 6px;
}

.cinema-logo-medallion {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.94) 62%, rgba(241, 245, 249, 0.85) 100%);
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  box-shadow:
    0 18px 42px -14px rgba(0, 0, 0, 0.12),
    inset 0 2px 6px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  will-change: transform, opacity;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.cinema-brand-core.is-hub-active .cinema-logo-medallion {
  border-color: rgba(46, 196, 182, 0.55);
  box-shadow:
    0 20px 48px -12px rgba(0, 0, 0, 0.16),
    inset 0 2px 8px rgba(255, 255, 255, 0.95);
}

.cinema-stage.is-node-hovered .cinema-logo-medallion {
  border-color: #2EC4B6;
  box-shadow:
    0 22px 52px -10px rgba(0, 0, 0, 0.18),
    inset 0 2px 8px rgba(255, 255, 255, 1);
}

.logo-svg {
  position: relative;
  z-index: 2;
  width: calc(var(--logo) * 0.88);
  height: calc(var(--logo) * 0.88);
  overflow: visible;
}

.logo-piece-g {
  transform-origin: 50px 50px;
  will-change: transform, opacity;
}

.logo-cad-nodes {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out);
}

/* Animación inicial de trazado del logo en carga */
.lg-draw { stroke-dasharray: 1 2; }
.js .lg-ring { animation: lg-draw 1.15s var(--ease-out) 0.1s backwards; }
.js .lg-w1 { animation: lg-draw 0.75s var(--ease-out) 0.85s backwards; }
.js .lg-w2 { animation: lg-draw 0.75s var(--ease-out) 1.08s backwards; }
@keyframes lg-draw { from { stroke-dashoffset: 1.01; } to { stroke-dashoffset: 0; } }

/* Panel 1: Tipografía minimalista del Inicio con aire generoso bajo el logo */
.cinema-hero-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - var(--hero-logo-shift) + var(--logo) * 0.54 + var(--hero-logo-gap));
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1rem;
  text-align: center;
  pointer-events: none;
}

.cinema-hero-tagline {
  margin-top: clamp(1.5rem, 3.2vh, 2.25rem);
}

.cinema-hero-interactive {
  pointer-events: auto;
}

.cinema-hero-panel.is-inactive .cinema-hero-interactive {
  pointer-events: none;
}

.hl-piece {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.hl { display: inline-block; }
.js .hl { animation: hero-letter 0.6s var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
.js .hi { animation: hero-in 0.65s var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
@keyframes hero-letter { from { opacity: 0; transform: translateY(0.24em); } to { opacity: 1; transform: none; } }
@keyframes hero-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Indicador sutil de transición scroll */
.scroll-cue-pill {
  margin-top: clamp(2.25rem, 4.5vh, 3.25rem);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #334155;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.scroll-cue-pill:hover {
  color: #0E294B;
  border-color: #2EC4B6;
  transform: translateY(2px);
}
.scroll-cue-chevron {
  display: inline-block;
  animation: cue-float 2.4s var(--ease-soft) infinite;
}
@keyframes cue-float {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(2.5px); }
}

/* Etiqueta flotante de fase durante el desmontaje/reconstrucción */
.cinema-phase-tag {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translate(-50%, 8px);
  z-index: 11;
  padding: 0.45rem 1.05rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0E294B;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(46, 196, 182, 0.45);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  will-change: transform, opacity;
}

/* Panel 2: Sección de los Títulos alrededor del Logo HAVEN reconstruido */
.cinema-hub-panel {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.cinema-hub-header {
  position: absolute;
  top: clamp(0.75rem, 2.5vh, 1.75rem);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  will-change: transform, opacity;
}

.orbe-link {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: 13rem;
  padding: 0.55rem 1.05rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(203, 213, 225, 0.95);
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.10);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  color: #0E294B;
  font-size: clamp(0.95rem, 1.45vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--x) * var(--Rx)), calc(-50% + var(--y) * var(--Ry))) scale(1);
  transition: color 0.22s var(--ease-out), border-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), background-color 0.22s var(--ease-out);
  will-change: transform, opacity;
}

.cinema-hub-panel.is-inactive .orbe-link {
  pointer-events: none;
}

@media (max-aspect-ratio: 4/5) {
  .orbe-link {
    max-width: clamp(7.2rem, 28vw, 11.5rem);
    font-size: clamp(0.88rem, 2.5vw, 1.15rem);
    padding: 0.45rem 0.78rem;
  }
}

.orbe-link:hover {
  color: #0E294B;
  background: #ffffff;
  border-color: #2EC4B6;
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.14);
}
.orbe-link:focus-visible {
  outline: 2px solid #2B6CB0;
  outline-offset: 4px;
}

[tabindex="-1"]:focus { outline: none; }

/* Modo estático accesible cuando no hay JS o el usuario prefiere reducir movimiento */
html:not(.js) .haven-cinema-track,
.haven-cinema-track.is-static-cinema {
  height: auto;
}
html:not(.js) .haven-cinema-sticky,
.haven-cinema-track.is-static-cinema .haven-cinema-sticky {
  position: relative;
  top: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2.5rem 1rem 4rem;
}
html:not(.js) .cinema-stage,
.haven-cinema-track.is-static-cinema .cinema-stage {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
html:not(.js) .cinema-brand-core,
.haven-cinema-track.is-static-cinema .cinema-brand-core {
  position: relative;
  left: auto;
  top: auto;
  transform: none !important;
}
html:not(.js) .cinema-hero-panel,
.haven-cinema-track.is-static-cinema .cinema-hero-panel {
  position: relative;
  inset: auto;
  padding: 0 1rem;
  pointer-events: auto;
}
html:not(.js) .cinema-hub-panel,
.haven-cinema-track.is-static-cinema .cinema-hub-panel {
  position: relative;
  inset: auto;
  width: calc(var(--Ro) * 2.5);
  height: calc(var(--Ro) * 2.5);
  margin: 1.5rem auto 2rem;
  pointer-events: auto;
}
.haven-cinema-track.is-static-cinema .static-hub-logo {
  display: flex !important;
}

/* ==========================================================================
   ASISTENTE VIRTUAL CON IA (Chatbot Flotante HAVEN)
   ========================================================================== */

.haven-ai-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 41;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.78rem 1.1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0E294B 0%, #16325B 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1.5px solid rgba(46, 196, 182, 0.65);
  box-shadow: 0 14px 28px -8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.haven-ai-fab.has-wa {
  bottom: 5.35rem;
}

.haven-ai-fab:hover {
  transform: translateY(-2px);
  border-color: #2EC4B6;
  box-shadow: 0 18px 34px -8px rgba(0, 0, 0, 0.32);
}

.haven-ai-fab:focus-visible {
  outline: 2px solid #2B6CB0;
  outline-offset: 4px;
}

.haven-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(46, 196, 182, 0.22);
  color: #5EEAD4;
  border: 1px solid rgba(94, 234, 212, 0.4);
}

.haven-ai-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 55;
  width: min(24.5rem, calc(100vw - 1.5rem));
  height: min(35rem, calc(100vh - 7rem));
  height: min(35rem, calc(100svh - 7rem));
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.5rem;
  border: 1px solid rgba(203, 213, 225, 0.95);
  box-shadow: 0 24px 52px -14px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transform-origin: bottom right;
}

.haven-ai-panel.has-wa {
  bottom: 9.1rem;
  height: min(33.5rem, calc(100vh - 10.2rem));
  height: min(33.5rem, calc(100svh - 10.2rem));
}

@media (max-width: 639px) {
  .haven-ai-fab {
    right: 1rem;
    padding: 0.72rem 0.92rem;
  }
  .haven-ai-fab.has-wa {
    bottom: 5.1rem;
  }
  .haven-ai-panel,
  .haven-ai-panel.has-wa {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    height: min(34rem, calc(100svh - 1.5rem));
    border-radius: 1.35rem;
  }
}

.haven-ai-panel.hidden {
  display: none !important;
}

.haven-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.72) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.haven-ai-msg {
  max-width: 88%;
  padding: 0.75rem 1rem;
  border-radius: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.haven-ai-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-bottom-left-radius: 0.3rem;
  box-shadow: 0 3px 10px -4px rgba(0, 0, 0, 0.06);
}

.haven-ai-msg-bot.is-crisis {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #7F1D1D;
}

.haven-ai-msg-user {
  align-self: flex-end;
  background: #0E294B;
  color: #ffffff;
  border-bottom-right-radius: 0.3rem;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.16);
}

.haven-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.haven-ai-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.38rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(46, 196, 182, 0.14);
  color: #0E294B;
  border: 1px solid rgba(46, 196, 182, 0.45);
  transition: background-color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}

.haven-ai-action-link:hover {
  background: #2EC4B6;
  color: #0E294B;
  transform: translateY(-1px);
}

.haven-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.haven-ai-chip {
  text-align: left;
  padding: 0.42rem 0.75rem;
  border-radius: 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ffffff;
  color: #0E294B;
  border: 1px solid #CBD5E1;
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out), background-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.haven-ai-chip:hover {
  border-color: #2EC4B6;
  background: #F0FDFA;
}

.haven-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.95rem;
  font-size: 0.75rem;
  color: #475569;
}

.haven-ai-bar {
  width: 0.9rem;
  height: 0.22rem;
  border-radius: 0.125rem;
  background: #2EC4B6;
  animation: ai-typing-fade 1.4s infinite var(--ease-soft) both;
}
.haven-ai-bar:nth-child(2) { animation-delay: 0.2s; }
.haven-ai-bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-typing-fade {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

/* ---- Entradas al hacer scroll ---- */
.js [data-reveal]:not(.is-in) { opacity: 0; }
.js [data-reveal-list]:not(.is-in) > li { opacity: 0; }
.js [data-split]:not(.is-in) .qw { opacity: 0; }
.qw { display: inline-block; }

/* ---- Tarjetas interactivas ---- */
.lift {
  position: relative;
  isolation: isolate;
  padding: 1.5rem;
  transition: transform 0.3s var(--ease-out);
}
.lift::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 16px 32px -14px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.lift-icon { transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out); }
@media (hover: hover) {
  .lift:hover { transform: translateY(-3px); }
  .lift:hover::after { opacity: 1; }
  .lift:hover .lift-icon { transform: translateY(-2px) scale(1.03); }
}

/* ---- FAQ acordeón ---- */
.faq-item {
  padding: 1.25rem 1.5rem;
}
.js .faq-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--ease-out); }
.js .faq-panel > .faq-panel-inner { overflow: hidden; min-height: 0; opacity: 0; transition: opacity 0.25s var(--ease-out); }
.js .faq-item.is-open .faq-panel { grid-template-rows: 1fr; }
.js .faq-item.is-open .faq-panel > .faq-panel-inner { opacity: 1; transition-delay: 0.06s; }
.js details.faq-item[open]:not(.is-open) .faq-arrow { transform: none; }
.js details.faq-item.is-open .faq-arrow { transform: rotate(180deg); }
.faq-item summary:focus-visible { outline: 2px solid #2B6CB0; outline-offset: 6px; border-radius: 0.75rem; }

/* ---- Formularios ---- */
form .form-field { transition: border-color 0.25s var(--ease-soft), box-shadow 0.25s var(--ease-soft); }
form .form-field:focus { outline: none; border-color: #2B6CB0; box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.18); }
#char-counter { transition: color 0.3s var(--ease-soft); }
#char-counter[data-level="warn"] { color: #B45309; }
#char-counter[data-level="max"] { color: #B91C1C; }
#btn-submit { transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background-color 0.2s var(--ease-out); }
#btn-submit:not(:disabled):hover { transform: translateY(-1px); }
#btn-submit:not(:disabled):active { transform: translateY(0) scale(0.985); transition-duration: 0.1s; }
#btn-submit:disabled { opacity: 1; cursor: progress; }
#btn-check { display: none; }
#btn-submit.is-done #btn-spinner { display: none; }
#btn-submit.is-done #btn-check { display: block; animation: check-in 0.35s var(--ease-out); }
@keyframes check-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

/* ---- Botón flotante de WhatsApp ---- */
.wa-float {
  background-color: #047857;
  color: #ffffff;
  padding: 0.875rem 1.1rem;
}
.wa-float:hover {
  background-color: #065f46;
}
.js .wa-float:not(.is-shown) { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- Botón discreto "Volver al inicio" (páginas interiores) ---- */
.haven-back-home-wrap {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}
.haven-back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: #64748B;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-decoration: none;
  transition: color 0.2s var(--ease-out, ease-out), border-color 0.2s var(--ease-out, ease-out), background-color 0.2s var(--ease-out, ease-out);
}
.haven-back-home-arrow {
  display: inline-block;
  transition: transform 0.2s var(--ease-out, ease-out);
}
.haven-back-home:hover {
  color: #0E294B;
  border-color: rgba(46, 196, 182, 0.6);
  background-color: rgba(255, 255, 255, 0.92);
}
.haven-back-home:hover .haven-back-home-arrow { transform: translateX(-2px); }
.haven-back-home:focus-visible {
  outline: 2px solid #2B6CB0;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .js .lg-ring, .js .lg-w1, .js .lg-w2 { animation: none; }
  .js .hi, .js .hl { animation: fade-only 0.5s ease-out backwards; animation-delay: calc(var(--d, 0ms) * 0.3); }
  .scroll-cue-chevron, .haven-ai-bar { animation: none; }
  .lift, .lift-icon, .haven-ai-fab, .haven-back-home-arrow { transition: none; }
  .haven-back-home:hover .haven-back-home-arrow { transform: none; }
  .lift:hover, .lift:hover .lift-icon, .haven-ai-fab:hover { transform: none !important; }
  .lift::after { transition: opacity 0.2s ease-out; }
  .js .faq-panel, .js .faq-panel > .faq-panel-inner, .faq-arrow { transition: none !important; }
  #btn-submit:not(:disabled):hover, #btn-submit:not(:disabled):active { transform: none; }
  #btn-submit.is-done #btn-check { animation: fade-only 0.3s ease-out; }
}
