/* ============================================================================
   Calpul — Sistema compartido del sitio público (Fluently High-Fidelity v3.5)
   Dynamic Morphing Island (Metamorfosis Elástica Cápsula <-> Chat),
   Smart Header, Dark/Light Mode y Footer.
   ============================================================================ */

/* ── Tokens Base (Calm Warmth & Organic Modern — Calpul Design System) ── */
:root {
  --arcilla: #BF6146;
  --arcilla-light: #E8A78F;
  --arcilla-hover: #D47256;
  --arcilla-dark: #A84B32;
  --arcilla-grad: linear-gradient(135deg, #D47256 0%, #BF6146 60%, #A84B32 100%);
  
  --salvia: #2E543D;
  --salvia-light: #4A6B56;
  --salvia-hover: #3B664C;
  --salvia-dark: #23422F;
  --salvia-grad: linear-gradient(135deg, #4A6B56 0%, #2E543D 60%, #23422F 100%);
  --salvia-bg: #EDF3EE;
  --salvia-border: #D5E3D8;
  
  --carbon: #2B2523;
  --carbon-dark: #1E1917;
  --carbon-soft: #26211E;
  --piedra: #7A716B;
  --piedra-light: #A39A93;
  --borde: #E8E2DA;
  --borde-dark: #38322E;
  --lino: #FBF9F6;
  --lino-crema: #F4EFEA;
  --arena: #EDE8E1;
  --blanco: #FFFFFF;
  
  /* Variables de Color Tema Dinámico */
  --bg-page: var(--lino);
  --text-main: var(--carbon);
  --text-muted: #57504B;
  --bg-card: var(--blanco);
  --border-card: var(--borde);
  --header-text: var(--carbon);
  
  --sombra-glass: 0 8px 32px rgba(30, 25, 23, 0.12);
  --sombra-suave: 0 4px 24px rgba(43, 37, 35, 0.06);
  --sombra-elevada: 0 28px 72px -12px rgba(30, 25, 23, 0.38);
  --sombra-btn: 0 4px 20px rgba(191, 97, 70, 0.32), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  --sombra-btn-salvia: 0 4px 20px rgba(46, 84, 61, 0.32), 0 1px 0 rgba(255, 255, 255, 0.25) inset;

  --max: 1240px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: var(--sans);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  
  --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --morph-curve: cubic-bezier(0.34, 1.32, 0.64, 1);
}


/* ── Normalización y Resets Base ── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--sans);
  color: var(--text-main);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: pan-x pan-y;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  transition: background 0.3s ease, color 0.3s ease;
}

button, a, input, select, textarea {
  touch-action: manipulation;
}

/* Prevenir auto-zoom de iOS Safari al hacer focus en inputs */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

section {
  padding: 104px 0;
  position: relative;
}

@media (max-width: 768px) {
  .wrap {
    padding: 0 22px;
  }
  section {
    padding: 80px 0;
  }
}

@media (max-width: 420px) {
  .wrap {
    padding: 0 18px;
  }
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p, blockquote, li {
  text-wrap: pretty;
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

h2 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
}

p {
  color: var(--text-muted);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--arcilla-dark);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.45;
}

.eyebrow.salvia {
  color: var(--salvia);
}

[data-nav-theme="dark"] .eyebrow {
  color: #F3B5A2;
}

[data-nav-theme="dark"] .punto-vivo {
  background: #92CBC0;
}

.lead {
  font-size: 1.2rem;
  line-height: 1.65;
  max-width: 62ch;
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(2.15rem, 7.8vw, 3rem);
    line-height: 1.15;
  }
  h2 {
    font-size: clamp(1.72rem, 6.2vw, 2.35rem);
    line-height: 1.18;
    margin-bottom: 14px;
  }
  .lead {
    font-size: 1.05rem;
    line-height: 1.66;
  }
  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
  }
}

/* ── Revelado al Scroll ── */
[data-reveal] {
  --p: 0;
  opacity: var(--p);
  transform: translateY(calc((1 - var(--p)) * 26px)) scale(calc(0.975 + var(--p) * 0.025));
  transition: opacity 0.25s linear, transform 0.3s var(--spring-smooth);
  will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    --p: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Punto vivo ── */
.punto-vivo {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--salvia);
  flex: none;
}

@media (prefers-reduced-motion: no-preference) {
  .punto-vivo {
    animation: pulso-vivo 3.5s ease-in-out infinite;
  }
}

@keyframes pulso-vivo {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(146, 203, 192, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(146, 203, 192, 0);
  }
}

/* ── Header Flotante & Adaptativo de Alta Precisión ── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  pointer-events: auto;
  transition: 
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease,
    -webkit-backdrop-filter 0.3s ease,
    color 0.3s ease;
}

@media (max-width: 900px) {
  header {
    padding: 0 20px;
    height: 72px;
  }
}

/* Marca / Logo */
.marca {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 550;
  letter-spacing: -0.015em;
  font-size: 1.18rem;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.3s ease;
  flex: none;
}

.marca:hover {
  opacity: 0.85;
}

.marca-icono {
  width: 28px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marca-icono svg {
  width: 100%;
  height: 100%;
  display: block;
}

.marca-texto {
  font-family: var(--sans);
  font-weight: 550;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  transition: color 0.25s ease;
}

nav.principal {
  display: flex;
  gap: 22px;
  align-items: center;
  flex: none;
  transition: opacity 0.3s ease, transform 0.35s var(--spring-smooth);
}

nav.principal a:not(.btn):not(.btn-login) {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding: 6px 2px;
  transition: color 0.2s ease;
}

nav.principal a:not(.btn):not(.btn-login)[aria-current="page"] {
  font-weight: 700;
}

nav.principal a:not(.btn):not(.btn-login)[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
}

nav.principal a.btn-login,
.btn-login {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.25;
}

.menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-inline-size: 44px;
  min-block-size: 44px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

@media (max-width: 900px) {
  nav.principal {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
}

/* 🌙 1. TEMA OSCURO (Sobre fondos oscuros: Hero, Scrollytelling, Confianza, Footer) */
header.header-theme-dark,
header:not(.header-theme-light):not(.header-theme-dark) {
  color: #FFFFFF;
}
header.header-theme-dark:not(.header-scrolled),
header:not(.header-theme-light):not(.header-theme-dark):not(.header-scrolled) {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
header.header-theme-dark .marca-texto,
header:not(.header-theme-light):not(.header-theme-dark) .marca-texto {
  color: #FFFFFF !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}
header.header-theme-dark .marca-icono svg path,
header:not(.header-theme-light):not(.header-theme-dark) .marca-icono svg path {
  fill: #FFFFFF !important;
}
header.header-theme-dark .marca-icono svg circle,
header:not(.header-theme-light):not(.header-theme-dark) .marca-icono svg circle {
  fill: #92CBC0 !important;
}
header.header-theme-dark nav.principal a:not(.btn),
header:not(.header-theme-light):not(.header-theme-dark) nav.principal a:not(.btn) {
  color: #F5F2EE;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.42);
}
header.header-theme-dark.header-scrolled .marca-texto,
header.header-theme-dark.header-scrolled nav.principal a:not(.btn) {
  text-shadow: none;
}
header.header-theme-dark nav.principal a:not(.btn)[aria-current="page"],
header:not(.header-theme-light):not(.header-theme-dark) nav.principal a:not(.btn)[aria-current="page"] {
  color: #FFFFFF;
}
header.header-theme-dark nav.principal a:not(.btn)[aria-current="page"]::after,
header:not(.header-theme-light):not(.header-theme-dark) nav.principal a:not(.btn)[aria-current="page"]::after {
  background: #F3B5A2;
}
header.header-theme-dark nav.principal a:not(.btn):hover,
header:not(.header-theme-light):not(.header-theme-dark) nav.principal a:not(.btn):hover {
  color: #FFFFFF;
}
header.header-theme-dark .btn-login,
header:not(.header-theme-light):not(.header-theme-dark) .btn-login {
  color: #FFFFFF !important;
  background: rgba(20, 19, 18, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.32);
  text-shadow: none;
}
header.header-theme-dark .btn-login:hover,
header:not(.header-theme-light):not(.header-theme-dark) .btn-login:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}
header.header-theme-dark .menu-btn,
header:not(.header-theme-light):not(.header-theme-dark) .menu-btn {
  color: #FFFFFF;
}
header.header-theme-dark.header-scrolled {
  background: rgba(20, 19, 18, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28) !important;
}

/* ☀️ 2. TEMA CLARO (Sobre fondos claros: Manifiesto, Pulso, Precios, Producto, etc.) */
header.header-theme-light {
  color: #141312;
}
header.header-theme-light:not(.header-scrolled) {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
header.header-theme-light .marca-texto {
  color: #141312 !important;
  text-shadow: none;
}
header.header-theme-light .marca-icono svg path {
  fill: #141312 !important;
}
header.header-theme-light .marca-icono svg circle {
  fill: #2E543D !important;
}
header.header-theme-light nav.principal a:not(.btn) {
  color: #3D3734;
  text-shadow: none;
}
header.header-theme-light nav.principal a:not(.btn)[aria-current="page"] {
  color: #141312;
}
header.header-theme-light nav.principal a:not(.btn)[aria-current="page"]::after {
  background: var(--arcilla);
}
header.header-theme-light nav.principal a:not(.btn):hover {
  color: #141312;
}
header.header-theme-light .btn-login {
  color: #141312 !important;
  background: rgba(20, 19, 18, 0.06);
  border: 1px solid rgba(20, 19, 18, 0.18);
}
header.header-theme-light .btn-login:hover {
  background: rgba(20, 19, 18, 0.12);
  border-color: rgba(20, 19, 18, 0.34);
}
header.header-theme-light .menu-btn {
  color: #141312;
}
header.header-theme-light.header-scrolled {
  background: rgba(251, 249, 246, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

/* ── 3. Header Transparente al Inicio ── */
header.header-transparent-always:not(.header-scrolled) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--arcilla-grad);
  color: var(--blanco) !important;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--arcilla-dark);
  cursor: pointer;
  box-shadow: var(--sombra-btn);
  transition: transform 0.25s var(--spring-bounce), box-shadow 0.25s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 26px rgba(191, 97, 70, 0.45), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.ghost {
  background: rgba(43, 37, 35, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--carbon) !important;
  border: 1px solid rgba(43, 37, 35, 0.2);
  box-shadow: 0 2px 8px rgba(43, 37, 35, 0.06);
}

.btn.ghost:hover {
  background: rgba(43, 37, 35, 0.1);
  border-color: rgba(43, 37, 35, 0.38);
  transform: translateY(-2px);
}

.hero-cinematic-100vh .btn.ghost,
[data-nav-theme="dark"] .btn.ghost,
.bento-card.dark .btn.ghost,
.dark-section .btn.ghost,
header.header-theme-dark .btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--blanco) !important;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.hero-cinematic-100vh .btn.ghost:hover,
[data-nav-theme="dark"] .btn.ghost:hover,
.bento-card.dark .btn.ghost:hover,
.dark-section .btn.ghost:hover,
header.header-theme-dark .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.42);
}

.btn.salvia {
  background: var(--salvia-grad);
  box-shadow: var(--sombra-btn-salvia);
}

.btn.salvia:hover {
  box-shadow: 0 8px 26px rgba(107, 142, 133, 0.45), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.acciones {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 560px) {
  .acciones {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .acciones .btn {
    width: 100%;
    min-block-size: 48px;
    padding: 13px 20px;
  }
}

/* Menú móvil */
.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  min-inline-size: 44px;
  min-block-size: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
  /* Sin color fijo — hereda currentColor del .menu-btn,
     que cambia según header-theme-dark / header-theme-light */
}

.panel-movil {
  position: fixed;
  inset: 0;
  /* Mayor que el header (1000) para cubrirlo completamente */
  z-index: 1100;
  background: rgba(20, 19, 18, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateY(-100%);
  transition: transform 0.4s var(--spring-smooth);
  overflow-y: auto;
  padding: max(84px, calc(64px + env(safe-area-inset-top))) 24px max(48px, calc(28px + env(safe-area-inset-bottom)));
}

.panel-movil.abierto {
  transform: translateY(0);
}

.panel-movil-close {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: 20px;
  background: var(--carbon-soft);
  border: 1px solid var(--borde-dark);
  min-inline-size: 44px;
  min-block-size: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--blanco);
  cursor: pointer;
}

.panel-movil a:not(.btn) {
  display: flex;
  align-items: center;
  padding: 16px 4px;
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--blanco);
  text-decoration: none;
  border-bottom: 1px solid var(--borde-dark);
  min-block-size: 52px;
}

.panel-movil a:not(.btn)[aria-current="page"] {
  color: #F3B5A2;
  font-weight: 700;
}

.panel-movil .btn {
  display: flex;
  margin-top: 24px;
  width: 100%;
}

@media (max-width: 860px) {
  .toggle-audiencia-container,
  nav.principal {
    display: none;
  }
  .menu-btn {
    display: flex;
  }
}

@media (min-width: 861px) {
  .panel-movil {
    display: none !important;
  }
}

/* ── Hero Cinemático Full-Bleed 100vh ── */
.hero-cinematic-100vh {
  min-height: 100vh;
  padding: 128px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: #141312;
  color: var(--blanco);
}

@media (max-width: 768px) {
  .hero-cinematic-100vh {
    min-height: auto;
    padding: 108px 0 56px;
  }
}

.hero-cinematic-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(180deg, rgba(20, 19, 18, 0.45) 0%, rgba(20, 19, 18, 0.65) 55%, #141312 100%),
    radial-gradient(circle at 50% 30%, rgba(194, 109, 83, 0.22) 0%, transparent 60%),
    url('img/hero-bg.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  filter: saturate(105%);
}

.hero-cinematic-halo {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(194, 109, 83, 0.32) 0%, rgba(107, 142, 133, 0.18) 45%, transparent 75%);
  filter: blur(64px);
  z-index: 1;
  pointer-events: none;
}

.hero-cinematic-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
}

.hero-cinematic-content h1 {
  color: var(--blanco);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.6);
}

.hero-cinematic-content .lead {
  color: #E8E5E1;
  margin: 18px auto 0;
  max-width: 62ch;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.hero-mockup-center {
  position: relative;
  z-index: 2;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-scroll-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #C9C5C0;
  margin-top: 18px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.hero-scroll-indicator:hover {
  color: #FFFFFF;
  transform: translateY(2px);
}

/* ============================================================================
   Dynamic Morphing Island (Metamorfosis Elástica Cápsula <-> Chat)
   ============================================================================ */

/* ============================================================================
   Comando Calpul · Enterprise Command Palette (Omnibar ⌘K)
   ============================================================================ */

.floating-agent-island {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  cursor: pointer;
  user-select: none;
  transform-origin: center;
  transition: 
    width 0.44s var(--morph-curve),
    max-width 0.44s var(--morph-curve),
    height 0.44s var(--morph-curve),
    border-radius 0.44s var(--morph-curve),
    background 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

/* ── Estado Colapsado: Botón redondo minimalista con ícono de asistente ── */
.floating-agent-island:not(.expandido) {
  width: 54px;
  height: 54px;
  min-width: 54px;
  left: auto;
  right: 24px;
  bottom: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #141312;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  animation: island-respirar 4.5s ease-in-out infinite;
}

.floating-agent-island:not(.expandido) .island-chat-view {
  display: none;
}

.floating-agent-island:hover:not(.expandido) {
  background: #23201E;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px) scale(1.04);
  animation-play-state: paused;
}

/* ── Vista Compacta (Botón redondo sin leyenda) ── */
.island-trigger-view {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  opacity: 1;
  transition: opacity 0.22s ease, transform 0.25s ease;
}

.floating-agent-island.expandido .island-trigger-view {
  display: none;
}

/* Ícono de asistente centrado */
.floating-agent-avatar {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.floating-agent-avatar svg {
  width: 22px;
  height: 22px;
  color: #FFFFFF;
}

.floating-agent-info,
.floating-agent-name {
  display: none !important;
}

/* Respiración del contenedor (sin glow) */
@keyframes island-respirar {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

/* ── Estado Expandido (La Isla Metamórfica se Convierte en el Chat) ── */
.floating-agent-island.expandido {
  display: flex !important;
  flex-direction: column !important;
  width: min(92vw, 420px) !important;
  max-width: 420px !important;
  height: min(78vh, 570px) !important;
  border-radius: 26px !important;
  background: rgba(20, 19, 18, 0.95) !important;
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.15) inset !important;
  cursor: default;
  overflow: hidden !important;
  padding: 0 !important;
  animation: none !important;
  transform: none !important;
}

.island-chat-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.floating-agent-island.expandido .island-chat-view {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 1;
  pointer-events: auto;
}

.agent-chat-header {
  padding: 16px 20px;
  background: rgba(34, 32, 30, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.chat-modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
}

.agent-chat-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #EDEAE6;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.agent-chat-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.agent-chat-body {
  padding: 18px 20px;
  flex: 1;
  overflow-y: auto;
  /* Scrollbar oculto en todos los navegadores */
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE / Edge legacy */
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-chat-body::-webkit-scrollbar {
  display: none;               /* Chrome / Safari / Opera */
}

.agent-bubble {
  background: rgba(42, 40, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px 18px 18px 4px;
  padding: 13px 16px;
  font-size: 0.88rem;
  color: #EDEAE6;
  line-height: 1.55;
  backdrop-filter: blur(10px);
}

/* ── Temas Destacados (Chips dentro del Chat) — Estilo Editorial, no burbujas ── */
.chat-context-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.chat-chips-label {
  font-size: 0.70rem;
  font-family: var(--mono);
  font-weight: 500;
  color: rgba(146, 203, 192, 0.7);
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.chat-chip-btn {
  /* Sin fondo sólido — solo borde salvia tenue para distinguirlos de los mensajes */
  background: transparent;
  border: 1px solid rgba(146, 203, 192, 0.22);
  color: rgba(237, 234, 230, 0.75);
  font-family: var(--sans);
  font-size: 0.80rem;
  font-weight: 400;
  font-style: italic;
  padding: 7px 12px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
  border-left: 2px solid rgba(146, 203, 192, 0.45);
  border-radius: 0 8px 8px 0;
}

.chat-chip-btn:hover {
  background: rgba(146, 203, 192, 0.10);
  border-color: rgba(146, 203, 192, 0.5);
  border-left-color: rgba(146, 203, 192, 0.9);
  color: #EDEAE6;
  font-style: normal;
  transform: translateX(2px);
}

.chat-chip-btn span.chip-arrow {
  font-family: var(--mono);
  color: rgba(146, 203, 192, 0.6);
  font-size: 0.85rem;
  flex-shrink: 0;
  font-style: normal;
}

/* ── Aislamiento Móvil Estricto (< 600px): Botón Verde Circular Grande con Logo ── */
@media (max-width: 600px) {
  .floating-agent-island:not(.expandido) {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    bottom: 20px !important;
    right: 20px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #5C877D 0%, #466C63 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.25) inset !important;
    animation: island-respirar 4.5s ease-in-out infinite !important;
    transform-origin: center !important;
  }

  .floating-agent-island:not(.expandido):hover {
    transform: none !important;
  }

  .floating-agent-island:not(.expandido) .island-trigger-view {
    width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    background: transparent !important;
  }

  .floating-agent-island:not(.expandido) .floating-agent-avatar {
    width: 50px !important;
    height: 50px !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    animation: none !important;
  }

  .floating-agent-island:not(.expandido) .floating-agent-avatar svg {
    width: 26px !important;
    height: 26px !important;
  }

  .floating-agent-island:not(.expandido) .floating-agent-info {
    display: none !important;
  }

  /* El chat expandido en móvil siempre usa el mismo oscuro que escritorio */
  .floating-agent-island.expandido {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    height: calc(100vh - 44px) !important;
    bottom: 16px !important;
    right: 16px !important;
    border-radius: 20px !important;
    background: rgba(20, 19, 18, 0.97) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    overflow: hidden !important;
  }

  .floating-agent-island.expandido .floating-agent-name {
    color: #FFFFFF !important;
  }
  .floating-agent-island.expandido .floating-agent-action {
    color: #92CBC0 !important;
  }
}

.user-bubble {
  background: var(--arcilla-grad);
  color: #FFFFFF;
  border-radius: 18px 18px 4px 18px;
  padding: 11px 15px;
  font-size: 0.88rem;
  align-self: flex-end;
  max-width: 85%;
  box-shadow: 0 4px 14px rgba(194, 109, 83, 0.35);
}

.typing-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--arcilla);
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 1px;
  animation: parpadeoCursor 0.7s infinite alternate ease-in-out;
}

@keyframes parpadeoCursor {
  0% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0.1; transform: scaleY(0.85); }
}

.agent-chat-footer {
  padding: 14px 16px;
  background: rgba(24, 23, 22, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.agent-chat-footer form {
  display: flex;
  gap: 8px;
}

.agent-chat-footer input {
  flex: 1;
  background: rgba(12, 11, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.86rem;
  color: #FFFFFF;
  outline: none;
  transition: border-color 0.2s ease;
}

.agent-chat-footer input:focus {
  border-color: var(--salvia-light);
}

.agent-chat-footer button {
  background: var(--salvia-grad);
  border: none;
  color: #FFFFFF;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.agent-chat-footer button:hover {
  transform: scale(1.03);
  filter: brightness(1.08);
}

/* ── Skip to Content (Accesibilidad WCAG) ── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2000;
  background: var(--carbon-dark);
  color: var(--blanco);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--sombra-elevada);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 14px;
  outline: 2px solid var(--arcilla);
}

/* ── Selector de Jurisdicción LATAM & Marco Legal ── */
.trust-pillars-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  align-items: stretch;
}
.trust-pillars-row .fiduciary-chip {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 14px;
  line-height: 1.4;
  white-space: normal;
}
.jurisdiction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--lino-crema);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 22px 0 0;
}
.jurisdiction-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.jurisdiction-pill {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 8px 12px;
  min-block-size: 38px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--carbon);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.jurisdiction-pill:hover {
  border-color: var(--salvia);
}
.jurisdiction-pill.activo {
  background: var(--salvia-bg);
  border-color: var(--salvia-border);
  color: var(--salvia);
  font-weight: 700;
}
.country-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(20, 19, 18, 0.06);
  color: var(--carbon);
  line-height: 1.2;
}
.jurisdiction-pill.activo .country-code {
  background: var(--salvia);
  color: #FFFFFF;
}
.jurisdiction-summary {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 680px) {
  .jurisdiction-bar {
    padding: 16px;
    gap: 14px;
  }
  .jurisdiction-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }
  .jurisdiction-pill {
    width: 100%;
    min-block-size: 44px;
    font-size: 0.78rem;
    padding: 8px 10px;
  }
}
.fiduciary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--salvia-bg);
  border: 1px solid var(--salvia-border);
  color: var(--salvia);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
}
.fiduciary-chip.terracota {
  background: #FCF2EE;
  border-color: #F2D0C4;
  color: var(--arcilla-dark);
}

/* ── Interactive 4-Role Product Preview Switcher ── */
.role-switcher-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  background: rgba(30, 25, 23, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 24px;
}
.role-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #EAE5DF;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 15px;
  min-block-size: 40px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
@media (max-width: 600px) {
  .role-switcher-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 360px;
    gap: 8px;
    padding: 8px;
  }
  .role-tab-btn {
    width: 100%;
    min-block-size: 44px;
    padding: 10px 8px;
    font-size: 0.81rem;
  }
}
.role-tab-btn:hover {
  color: var(--blanco);
  background: rgba(255, 255, 255, 0.08);
}
.role-tab-btn.activo {
  background: var(--arcilla);
  border-color: var(--arcilla-dark);
  color: var(--blanco);
  box-shadow: 0 2px 10px rgba(191, 97, 70, 0.35);
}
.role-panel-view {
  display: none;
}
.role-panel-view.activo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeRoleView 0.25s ease;
}
@keyframes fadeRoleView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Slider Custom Range (/precios) ── */
input[type="range"].custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--borde);
  border-radius: 10px;
  outline: none;
}
input[type="range"].custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--arcilla);
  border: 2px solid var(--blanco);
  box-shadow: 0 2px 8px rgba(191, 97, 70, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease;
}
input[type="range"].custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}
input[type="range"].custom-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--arcilla);
  border: 2px solid var(--blanco);
  box-shadow: 0 2px 8px rgba(191, 97, 70, 0.45);
  cursor: pointer;
}

/* ── Foundations Timeline (F-01..F-07) & Advisory Cards ── */
.foundations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.foundation-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--sombra-suave);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.foundation-card:hover {
  transform: translateY(-3px);
  border-color: var(--salvia-border);
}
.foundation-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--salvia);
  background: var(--salvia-bg);
  border: 1px solid var(--salvia-border);
  border-radius: 6px;
  padding: 3px 8px;
  width: fit-content;
}
.advisory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.advisory-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--sombra-suave);
}

/* ── Franja Editorial para Administradoras (Discreta e Integrada) ── */
.seccion-admin-strip {
  background: var(--arena);
  border-top: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  padding: 56px 0;
}
.admin-strip-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}
.admin-strip-text {
  max-width: 680px;
}
.badge-admin-mini {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--salvia);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.admin-strip-text h3 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  font-weight: 700;
  color: var(--carbon);
  margin-bottom: 8px;
  line-height: 1.25;
}
.admin-strip-text p {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}
.link-admin-editorial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 650;
  color: var(--carbon);
  text-decoration: none;
  padding: 12px 24px;
  min-block-size: 46px;
  background: rgba(20, 19, 18, 0.05);
  border: 1px solid rgba(20, 19, 18, 0.16);
  border-radius: 10px;
  transition: all 0.25s var(--spring-smooth);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .seccion-admin-strip {
    padding: 48px 0;
  }
  .admin-strip-content {
    gap: 22px;
  }
  .link-admin-editorial {
    width: 100%;
  }
}
.link-admin-editorial:hover {
  background: var(--carbon);
  color: var(--blanco);
  border-color: var(--carbon);
  transform: translateX(4px);
}
.link-admin-editorial svg {
  transition: transform 0.25s ease;
}
.link-admin-editorial:hover svg {
  transform: translateX(3px);
}

/* ── Bookend Cinemático de Cierre con Máximo Protagonismo ── */
.cierre-bookend {
  text-align: center;
  background: radial-gradient(circle at 50% 100%, rgba(194, 109, 83, 0.14) 0%, rgba(80, 122, 112, 0.08) 38%, #FAF8F5 72%);
  padding: 124px 0 116px;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--borde);
}
.cierre-bookend .wrap {
  max-width: 860px;
  position: relative;
  z-index: 2;
}
.cierre-bookend h2 {
  font-family: var(--display);
  font-size: clamp(2.25rem, 5.5vw, 4.2rem);
  font-weight: 750;
  line-height: 1.14;
  color: var(--carbon);
  letter-spacing: -0.025em;
  margin-top: 12px;
}
.cierre-bookend .lead {
  font-size: clamp(1.05rem, 2.2vw, 1.26rem);
  color: var(--text-muted);
  line-height: 1.66;
  max-width: 720px;
  margin: 20px auto 36px;
}
.cierre-acciones-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.btn-cierre-primary {
  padding: 15px 34px;
  min-block-size: 50px;
  font-size: 1.02rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(194, 109, 83, 0.32);
}
.btn-cierre-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--blanco);
  color: var(--carbon) !important;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  padding: 15px 28px;
  min-block-size: 50px;
  border-radius: 10px;
  border: 1.5px solid rgba(20, 19, 18, 0.2);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(20, 19, 18, 0.05);
  transition: all 0.25s var(--spring-smooth);
}
.btn-cierre-secondary:hover {
  border-color: var(--carbon);
  background: var(--carbon);
  color: var(--blanco) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20, 19, 18, 0.15);
}
.btn-cierre-secondary .arrow {
  transition: transform 0.25s ease;
}
.btn-cierre-secondary:hover .arrow {
  transform: translateX(4px);
}
.cierre-garantias {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-top: 10px;
}
@media (max-width: 768px) {
  .cierre-bookend {
    padding: 84px 0 88px;
  }
  .cierre-acciones-grid {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .btn-cierre-primary,
  .btn-cierre-secondary {
    width: 100%;
    padding: 14px 22px;
  }
  .cierre-garantias {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
}

/* ── Botones Disparadores de Comandos en Contenido (Deep Linking) ── */
.btn-ghost-cmd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(167, 215, 197, 0.12);
  border: 1px solid rgba(167, 215, 197, 0.34);
  color: #C2E5D8;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  min-block-size: 38px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 14px;
  text-align: left;
  transition: all 0.2s ease;
}

.btn-ghost-cmd-trigger:hover {
  background: rgba(167, 215, 197, 0.24);
  border-color: rgba(167, 215, 197, 0.6);
  transform: translateX(3px);
  color: #FFFFFF;
}

/* ── Tarjeta QR de la App en el Bento Grid ── */
.app-qr-card {
  background: #1C1B1A;
  border: 1px solid #383533;
  border-radius: 20px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 520px) {
  .app-qr-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    gap: 14px;
  }
}

.app-qr-box {
  width: 72px;
  height: 72px;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 6px;
  display: grid;
  place-items: center;
  flex: none;
}

.app-qr-box svg {
  width: 100%;
  height: 100%;
}

.app-qr-info {
  display: flex;
  flex-direction: column;
}

.app-qr-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #FFFFFF;
}

.app-qr-desc {
  font-size: 0.84rem;
  color: #C4BEB7;
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Mockup Smartphone Vectorial ── */
.phone-mockup {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  background: #141312;
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 28px 72px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  position: relative;
  transition: transform 0.35s var(--spring-smooth);
}

.phone-screen {
  background: var(--blanco);
  border-radius: 34px;
  overflow: hidden;
  height: 496px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

@media (max-width: 480px) {
  .phone-mockup {
    max-width: 308px;
    border-radius: 38px;
    padding: 10px;
  }
  .phone-screen {
    border-radius: 30px;
    height: 458px;
  }
}

.phone-notch {
  width: 110px;
  height: 22px;
  background: #141312;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.phone-notch-camera {
  width: 7px;
  height: 7px;
  background: #252422;
  border-radius: 50%;
}

.phone-notch-speaker {
  width: 32px;
  height: 3px;
  background: #252422;
  border-radius: 2px;
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 18px 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #141312;
  font-family: var(--sans);
  z-index: 20;
}

.phone-app-header {
  padding: 10px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--borde);
  background: var(--blanco);
  z-index: 10;
}

.phone-app-title {
  font-size: 0.88rem;
  font-weight: 750;
  color: #141312;
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-app-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--lino-crema);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-app-body::-webkit-scrollbar {
  display: none;
}

.phone-nav-bar {
  height: 48px;
  background: var(--blanco);
  border-top: 1px solid var(--borde);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
}

.phone-nav-item {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
}

.phone-nav-item.activo {
  color: var(--arcilla-dark);
}

.mockup-alerta {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 12px 13px;
}

.mockup-alerta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mockup-alerta-tag {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--salvia);
  font-weight: 600;
  background: var(--salvia-bg);
  border: 1px solid var(--salvia-border);
  padding: 3px 7px;
  border-radius: 6px;
}

.mockup-item-cuota {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mockup-tag {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.mockup-tag.pagado {
  background: var(--salvia-bg);
  color: var(--salvia);
  border-color: var(--salvia-border);
}

.mockup-tag.vencido {
  background: #FCF2EE;
  color: var(--arcilla-dark);
  border-color: #F2D0C4;
}

.mockup-tag.parcial {
  background: #FEF6E7;
  color: #9A5B13;
  border-color: #F4DDA8;
}

.mockup-sello {
  background: var(--carbon);
  color: var(--blanco);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
}

.mockup-sello b {
  color: #F3B5A2;
}

/* ── Bento Grid ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sombra-suave);
  transition: transform 0.25s var(--spring-smooth), box-shadow 0.25s ease;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-elevada);
}

.bento-col-8 { grid-column: span 8; }
.bento-col-7 { grid-column: span 7; }
.bento-col-6 { grid-column: span 6; }
.bento-col-5 { grid-column: span 5; }
.bento-col-4 { grid-column: span 4; }
.bento-col-12 { grid-column: span 12; }

.bento-card.dark {
  background: var(--carbon);
  border-color: var(--borde-dark);
  color: var(--blanco);
}

.bento-card.dark h3,
.bento-card.dark h2,
.bento-card.dark .bento-title {
  color: var(--blanco);
}

.bento-card.dark p {
  color: #C9C5C0;
}

.bento-card.arcilla-card {
  background: linear-gradient(145deg, #AD5036 0%, #98422A 100%);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--blanco);
}

.bento-card.arcilla-card h3,
.bento-card.arcilla-card h2,
.bento-card.arcilla-card .bento-title {
  color: var(--blanco);
}

.bento-card.arcilla-card p {
  color: #FCF5F2;
}

.bento-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--lino-crema);
  border: 1px solid var(--borde);
  color: var(--carbon);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 14px;
  width: fit-content;
}

.bento-card.dark .bento-badge {
  background: var(--carbon-soft);
  border-color: var(--borde-dark);
  color: #F3B5A2;
}

.bento-card.arcilla-card .bento-badge {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--blanco);
}

.bento-title {
  font-size: 1.35rem;
  font-weight: 750;
  margin-bottom: 10px;
  line-height: 1.25;
  color: var(--text-main);
}

.bento-preview {
  margin-top: 24px;
  background: rgba(250, 248, 245, 0.85);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 16px;
}


.bento-card.dark .bento-preview {
  background: #232120;
  border-color: #403D3B;
}

@media (max-width: 960px) {
  .bento-col-8,
  .bento-col-7,
  .bento-col-6,
  .bento-col-5,
  .bento-col-4 {
    grid-column: span 12;
  }
}

@media (max-width: 680px) {
  .bento-grid {
    gap: 18px;
    margin-top: 32px;
  }
  .bento-card {
    padding: 26px 22px;
    border-radius: 20px;
  }
  .bento-title {
    font-size: 1.22rem;
  }
}

/* ── Modal de Demo ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 18, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.abierto {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: 24px;
  max-width: 540px;
  width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 36px 34px;
  box-shadow: var(--sombra-elevada);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s var(--spring-smooth);
  position: relative;
  border: 1px solid var(--border-card);
}

@media (max-width: 580px) {
  .modal-dialog {
    padding: 28px 20px 24px;
    border-radius: 20px;
  }
}

.modal-backdrop.abierto .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-page);
  border: 1px solid var(--border-card);
  min-inline-size: 40px;
  min-block-size: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.modal-close:hover {
  background: var(--border-card);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-group {
  margin-top: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  min-block-size: 46px;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  font-family: var(--sans);
  font-size: 0.94rem;
  color: var(--text-main);
  background: var(--bg-page);
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid var(--arcilla);
  outline-offset: 1px;
}

/* ── Footer Cutting Edge ── */
.footer-cutting-edge {
  background: #141312;
  color: #D6D0CA;
  border-top: 1px solid #33302E;
  padding: 88px 0 110px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 680px) {
  .footer-cutting-edge {
    padding: 64px 0 104px;
  }
}

.footer-watermark {
  position: absolute;
  bottom: -40px;
  right: -20px;
  font-family: var(--display);
  font-size: clamp(8rem, 16vw, 15rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.02);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
  position: relative;
  z-index: 2;
}

.footer-brand h4 {
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-brand p {
  color: #B8B2AC;
  font-size: 0.92rem;
  line-height: 1.62;
  max-width: 36ch;
}

.footer-column h5 {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #F3B5A2;
  margin-bottom: 18px;
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-column a {
  color: #D6D0CA;
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-block;
}

.footer-column a:hover {
  color: #FFFFFF;
  transform: translateX(3px);
}

.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: #B2ACA5;
  position: relative;
  z-index: 2;
}

.footer-bottom-bar a {
  color: #D6D0CA !important;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-bottom-bar a:hover {
  color: #FFFFFF !important;
}

.footer-region-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #201E1D;
  border: 1px solid #3D3936;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: #D6D0CA;
  line-height: 1.4;
}

/* ── Aviso Discreto de Entorno Stage ── */
.calpul-stage-banner {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 88;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(30, 25, 23, 0.92);
  color: #FBF9F6;
  border: 1px solid rgba(191, 97, 70, 0.65);
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

@media (max-width: 600px) {
  .calpul-stage-banner {
    bottom: 14px;
    left: 12px;
    max-width: calc(100vw - 86px);
    padding: 5px 9px;
    font-size: 10px;
    gap: 6px;
  }
}

/* ── Adaptación Táctil (WCAG 2.5.5 / 2.5.8) ── */
@media (pointer: coarse) {
  .btn,
  .btn-login,
  .role-tab-btn,
  .jurisdiction-pill,
  .modal-close,
  .menu-btn,
  .panel-movil-close {
    min-block-size: 44px;
  }
  .modal-close,
  .menu-btn,
  .panel-movil-close {
    min-inline-size: 44px;
  }
}

@media (max-width: 900px) {
  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

@media (max-width: 560px) {
  .footer-top-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Chatbot Móvil: Modal Fullscreen que nace desde el botón inferior derecho ── */
@media (max-width: 680px) {
  .floating-agent-island {
    bottom: 20px;
    right: 20px;
    transform-origin: calc(100% - 24px) calc(100% - 24px);
    transition: 
      width 0.4s var(--morph-curve),
      height 0.4s var(--morph-curve),
      max-width 0.4s var(--morph-curve),
      max-height 0.4s var(--morph-curve),
      border-radius 0.35s var(--morph-curve),
      bottom 0.4s var(--morph-curve),
      right 0.4s var(--morph-curve),
      background 0.3s ease,
      box-shadow 0.3s ease;
  }

  .floating-agent-island.expandido {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 999999 !important;
    transform-origin: calc(100vw - 36px) calc(100dvh - 36px) !important;
    box-shadow: none !important;
    background: #141312 !important;
    animation: expandirDesdeBoton 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes expandirDesdeBoton {
    0% {
      clip-path: circle(24px at calc(100vw - 36px) calc(100dvh - 36px));
      opacity: 0.8;
    }
    100% {
      clip-path: circle(160vmax at calc(100vw - 36px) calc(100dvh - 36px));
      opacity: 1;
    }
  }

  .floating-agent-island.expandido .island-chat-view {
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .floating-agent-island.expandido .agent-chat-header {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: 20px;
    padding-right: 20px;
    background: #1C1B1A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .floating-agent-island.expandido .agent-chat-close {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 50% !important;
    color: #FFFFFF !important;
  }

  .floating-agent-island.expandido .agent-chat-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
  }

  .floating-agent-island.expandido .agent-chat-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) 16px !important;
    background: #181716 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .floating-agent-island.expandido .agent-chat-footer input {
    font-size: 16px !important;
    padding: 12px 18px !important;
  }
}
