/* =========================================================
   ChatRAG by jsadsAI — Hoja de estilos comercial (Fase 1)
   Estética: Enterprise · Tecnológica · Premium
   ========================================================= */

/* ---------- Tokens de marca ---------- */
:root {
  /* Paleta jsadsAI */
  --blue:        #2296F3;   /* Azul tecnológico principal */
  --blue-bright: #1E90FF;
  --ink:         #050B16;   /* Azul casi negro */
  --white:       #FFFFFF;
  --gray-50:     #F8FAFC;   /* Secciones secundarias */
  --gray-text:   #64748B;   /* Descripciones */
  --cyan:        #06B6D4;   /* Acento sutil */

  /* Derivados */
  --ink-soft:    #0A1424;
  --ink-line:    rgba(255, 255, 255, 0.08);
  --border:      #E2E8F0;
  --heading:     #0F1B2D;

  --grad: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);

  --shadow-sm: 0 1px 2px rgba(5, 11, 22, .06);
  --shadow-md: 0 12px 30px rgba(5, 11, 22, .08);
  --shadow-lg: 0 24px 60px rgba(5, 11, 22, .12);
  --shadow-blue: 0 16px 40px rgba(34, 150, 243, .28);

  --radius:    14px;
  --radius-lg: 22px;
  --maxw:      1180px;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--heading);
  background: var(--white);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; color: var(--heading); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 820px; }

.section { padding: 100px 0; }
.section-alt { background: var(--gray-50); }
.section-dark { background: var(--ink); }

.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 800;
  margin-top: 14px;
}
.section-title-light { color: var(--white); }
.section-lead {
  margin-top: 18px;
  color: var(--gray-text);
  font-size: 1.08rem;
}
.section-dark .section-lead { color: #9FB0C6; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow-dark { color: var(--blue); }

.text-gradient {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--blue);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: .98rem;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--blue); color: var(--white); box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: var(--blue-bright); transform: translateY(-2px); }

.btn-ghost {
  background: rgba(255, 255, 255, .06);
  color: var(--white);
  border-color: rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }

.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 11, 22, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-line);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled { background: rgba(5, 11, 22, .94); box-shadow: 0 6px 24px rgba(0,0,0,.28); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; }
.brand-text { display: none; font-weight: 800; font-size: 1.15rem; color: var(--white); letter-spacing: -.02em; }
.brand-accent { color: var(--blue); }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: #C7D2E1; font-size: .96rem; font-weight: 500; transition: color .2s var(--ease); }
.main-nav a:hover { color: var(--white); }
.nav-cta { color: var(--white) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(34,150,243,.20), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(6,182,212,.12), transparent 55%),
    var(--ink);
  color: var(--white);
  padding: 120px 0 110px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: auto 0 -40% 0;
  height: 60%;
  background: radial-gradient(600px 300px at 50% 50%, rgba(34,150,243,.18), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 920px; }
.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-top: 20px;
  letter-spacing: -.03em;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 400;
  color: #B8C6DA;
  margin-top: 24px;
  max-width: 760px;
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero-claim {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
  color: #8DA0BA;
  font-size: .98rem;
  font-weight: 500;
}

/* ---------- Problema / Solución ---------- */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}
.problem-text p { font-size: 1.15rem; color: var(--gray-text); line-height: 1.7; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare-card {
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--white);
}
.compare-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.compare-bad { background: #FEF2F2; border-color: #FECACA; }
.compare-bad .compare-tag { color: #DC2626; }
.compare-good { background: #EFF8FF; border-color: #BAE0FF; }
.compare-good .compare-tag { color: var(--blue); }
.compare-card ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: .95rem;
  color: #334155;
}
.compare-card ul li::before {
  position: absolute; left: 0; top: 0;
  font-weight: 700;
}
.compare-bad ul li::before { content: "✕"; color: #DC2626; }
.compare-good ul li::before { content: "✓"; color: var(--blue); }

/* ---------- Agentes ---------- */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.agent-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.agent-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #C9DEF6;
}
.agent-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: #EFF8FF;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.agent-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.agent-card p { color: var(--gray-text); font-size: .98rem; }
.agent-card-highlight {
  background: var(--ink);
  border-color: transparent;
}
.agent-card-highlight h3 { color: var(--white); }
.agent-card-highlight p { color: #9FB0C6; }
.agent-card-highlight .agent-icon { background: rgba(34,150,243,.18); }

/* ---------- Seguridad ---------- */
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.security-card {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.security-card:hover { transform: translateY(-4px); border-color: rgba(34,150,243,.5); }
.security-num {
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--cyan);
  margin-bottom: 14px;
}
.security-card h3 { color: var(--white); font-size: 1.12rem; font-weight: 700; margin-bottom: 10px; }
.security-card p { color: #9FB0C6; font-size: .96rem; }

/* ---------- Historia ---------- */
.story { max-width: 820px; margin: 0 auto; text-align: center; }
.story .section-title { margin-top: 14px; }
.story-text {
  margin-top: 24px;
  font-size: 1.18rem;
  line-height: 1.75;
  color: var(--gray-text);
}

/* ---------- Planes ---------- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
.plan-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.plan-card-featured {
  border: 2px solid var(--blue);
  box-shadow: var(--shadow-blue);
}
.plan-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: var(--grad);
  color: var(--white);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}
.plan-name { font-size: 1.3rem; font-weight: 800; }
.plan-desc { color: var(--gray-text); margin-top: 8px; font-size: .98rem; }
.plan-features { margin: 22px 0 24px; flex-grow: 1; }
.plan-features li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  color: #334155;
  font-size: .96rem;
}
.plan-features li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--blue);
  font-weight: 700;
}
.plan-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 20px;
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.faq-item.open { border-color: #BAE0FF; box-shadow: var(--shadow-sm); }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 22px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  font-family: inherit;
}
.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 20px; height: 20px;
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  background: var(--blue);
  border-radius: 2px;
  transition: transform .3s var(--ease);
}
.faq-icon::before { width: 14px; height: 2px; transform: translate(-50%, -50%); }
.faq-icon::after  { width: 2px; height: 14px; transform: translate(-50%, -50%); }
.faq-item.open .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.faq-answer p {
  padding: 0 24px 22px;
  color: var(--gray-text);
  font-size: 1rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(34,150,243,.22), transparent 65%),
    var(--ink);
  padding: 90px 0;
  text-align: center;
}
.cta-inner { max-width: 720px; margin: 0 auto; }
.cta-title { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
.cta-sub { color: #B8C6DA; margin: 16px 0 32px; font-size: 1.1rem; }

/* ---------- Formulario de demo (Fase 2) ---------- */
.demo-form { max-width: 660px; margin: 34px auto 0; text-align: left; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; margin-bottom: 16px; }
.form-field label {
  color: #C7D2E1;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 7px;
}
.demo-form input,
.demo-form textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--white);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  padding: 13px 15px;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.demo-form input::placeholder,
.demo-form textarea::placeholder { color: #6B7C95; }
.demo-form input:focus,
.demo-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: rgba(255, 255, 255, .10);
  box-shadow: 0 0 0 3px rgba(34, 150, 243, .20);
}
.demo-form textarea { resize: vertical; min-height: 110px; }
.demo-form .btn { margin-top: 6px; }
.demo-form .btn[disabled] { opacity: .65; cursor: progress; transform: none; }

/* Honeypot: fuera de pantalla, invisible para humanos */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Mensaje de estado (éxito / error) */
.form-status {
  margin-top: 16px;
  font-size: .98rem;
  font-weight: 600;
  border-radius: 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.form-status.is-visible {
  max-height: 200px;
  opacity: 1;
  padding: 13px 16px;
}
.form-status--success {
  background: rgba(16, 185, 129, .14);
  border: 1px solid rgba(16, 185, 129, .45);
  color: #6EE7B7;
}
.form-status--error {
  background: rgba(239, 68, 68, .14);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #FCA5A5;
}
@media (max-width: 620px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer { background: #03070F; color: #8DA0BA; padding: 60px 0 30px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer-logo { height: 34px; width: auto; margin-bottom: 16px; }
.footer-tagline { color: var(--white); font-weight: 600; font-size: 1.02rem; }
.footer-nav, .footer-legal { display: flex; flex-direction: column; gap: 12px; }
.footer-nav a, .footer-legal a { color: #8DA0BA; font-size: .95rem; transition: color .2s var(--ease); }
.footer-nav a:hover, .footer-legal a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-line);
  font-size: .88rem;
  color: #5E708A;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .agents-grid, .security-grid, .plans-grid { grid-template-columns: repeat(2, 1fr); }
  .problem-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .section { padding: 72px 0; }
  .brand-text { display: inline; }

  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--ink-line);
    padding: 8px 24px 22px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--ink-line); }
  .nav-cta { margin-top: 14px; border-bottom: none !important; }

  .agents-grid, .security-grid, .plans-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .hero { padding: 86px 0 78px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   MOTOR DE ANIMACIONES NATIVAS (Fase 3)
   Imita la fluidez de Framer Motion con CSS + IntersectionObserver,
   sin dependencias. El estado inicial oculto solo se aplica cuando
   hay JS (clase .js en <html>), para no esconder contenido sin JS.
   ========================================================= */
.js .animate-on-scroll {
  opacity: 0;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.js .animate-on-scroll.fade-in-up   { transform: translateY(28px); }
.js .animate-on-scroll.fade-in      { transform: none; }
.js .animate-on-scroll.fade-in-left { transform: translateX(-30px); }

.animate-on-scroll.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Retardos en cascada (stagger) — el delay solo aplica en la transición de entrada */
.stagger-delay-1 { transition-delay: .08s; }
.stagger-delay-2 { transition-delay: .16s; }
.stagger-delay-3 { transition-delay: .24s; }
.stagger-delay-4 { transition-delay: .32s; }
.stagger-delay-5 { transition-delay: .40s; }
.stagger-delay-6 { transition-delay: .48s; }

/* Panel glassmorphism reutilizable */
.glass-panel {
  background: rgba(5, 11, 22, .72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(6, 182, 212, .22);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 70px rgba(6, 182, 212, .14),
    0 10px 30px rgba(5, 11, 22, .45);
}

/* Entrada del hero (independiente del scroll: se reproduce al cargar) */
@media (prefers-reduced-motion: no-preference) {
  .hero-title,
  .hero-subtitle,
  .hero-actions,
  .hero-claim { animation: heroRise .85s var(--ease) both; }
  .hero-subtitle { animation-delay: .12s; }
  .hero-actions  { animation-delay: .26s; }
  .hero-claim    { animation-delay: .4s; }
}
@keyframes heroRise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   SIMULADOR INTERACTIVO ChatRAG (Fase 3)
   Ventana de chat con glassmorphism y acentos de marca.
   ========================================================= */
.simulator-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 82% -10%, rgba(34, 150, 243, .12), transparent 60%),
    radial-gradient(700px 420px at 6% 115%, rgba(6, 182, 212, .10), transparent 60%),
    var(--gray-50);
}

.chat-sim {
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
}

/* Barra superior tipo ventana */
.chat-sim__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.chat-sim__dot { width: 11px; height: 11px; border-radius: 50%; }
.chat-sim__dot:nth-child(1) { background: #ff5f57; }
.chat-sim__dot:nth-child(2) { background: #febc2e; }
.chat-sim__dot:nth-child(3) { background: #28c840; }
.chat-sim__title {
  margin-left: 10px;
  color: #7E90A8;
  font-size: .82rem;
  font-weight: 600;
}

/* Cuerpo del chat (fondo #050B16 de marca) */
.chat-sim__body {
  min-height: 290px;
  max-height: 430px;
  overflow-y: auto;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--ink);
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, .4) transparent;
}
.chat-sim__body::-webkit-scrollbar { width: 8px; }
.chat-sim__body::-webkit-scrollbar-thumb { background: rgba(6, 182, 212, .35); border-radius: 8px; }
.chat-sim__placeholder {
  margin: auto;
  text-align: center;
  color: #5E708A;
  font-size: .96rem;
  max-width: 360px;
  line-height: 1.5;
}

/* Burbujas de mensaje */
.msg {
  max-width: 86%;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: .96rem;
  line-height: 1.55;
  animation: msgIn .35s var(--ease) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.msg--user {
  align-self: flex-end;
  background: var(--blue-bright);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--gray-50);
  border-bottom-left-radius: 4px;
}
.msg--assistant .agent-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}

/* Estado "buscando en ChromaDB local" */
.chat-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #8DA0BA;
  font-size: .9rem;
  font-style: italic;
  animation: msgIn .3s var(--ease) both;
}
.chat-status .dots { display: inline-flex; gap: 4px; }
.chat-status .dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: chatBlink 1s infinite ease-in-out;
}
.chat-status .dots span:nth-child(2) { animation-delay: .2s; }
.chat-status .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes chatBlink {
  0%, 80%, 100% { opacity: .25; transform: scale(.8); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* Cursor del typing effect */
.caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--blue);
  margin-left: 2px;
  vertical-align: -2px;
  animation: caretBlink .9s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* Sello de control de calidad */
.qa-seal {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(6, 182, 212, .12);
  border: 1px solid rgba(6, 182, 212, .45);
  color: #67E8F9;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  animation: sealPop .45s var(--ease) both;
}
@keyframes sealPop {
  0%   { opacity: 0; transform: scale(.9); }
  60%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

/* Botones de acción del simulador */
.chat-sim__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, .03);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.chat-btn {
  flex: 1 1 200px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: #C7D2E1;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.chat-btn:hover {
  color: var(--white);
  border-color: var(--blue);
  background: rgba(34, 150, 243, .14);
  transform: translateY(-1px);
}
.chat-btn.active { border-color: var(--cyan); color: var(--white); }

@media (max-width: 760px) {
  .chat-sim__body { max-height: 360px; }
  .msg { max-width: 92%; }
}

/* =========================================================
   DIAGRAMA DE ARQUITECTURA LOCAL-FIRST (Fase 5)
   Flujo de 4 nodos conectados, con un "pulso de datos" cyan
   que viaja del Nodo 1 al Nodo 4 en loop continuo. 100% CSS.
   ========================================================= */
.arch-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(820px 440px at 12% -10%, rgba(6, 182, 212, .08), transparent 60%),
    radial-gradient(720px 420px at 92% 110%, rgba(34, 150, 243, .08), transparent 60%),
    var(--gray-50);
}

.arch {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 38px 30px;
}

/* Nodos */
.arch__node {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 24px 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
}
.arch__node--secure {
  border-color: rgba(6, 182, 212, .42);
  background: rgba(6, 182, 212, .07);
  box-shadow: 0 0 24px rgba(6, 182, 212, .12) inset;
}
.arch__node-icon { font-size: 1.7rem; line-height: 1; }
.arch__node-title { color: var(--white); font-weight: 700; font-size: .98rem; }
.arch__node-sub { color: #7E90A8; font-size: .78rem; line-height: 1.3; }

/* Conectores con pulso de datos */
.arch__link {
  position: relative;
  flex: 0 0 46px;
  align-self: center;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 150, 243, .55), rgba(6, 182, 212, .55));
}
.arch__pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px 3px rgba(6, 182, 212, .85);
  transform: translate(-50%, -50%);
  animation: archPulse 2.4s var(--ease) infinite;
}
/* Stagger: los nodos son hijos 1,3,5,7 y los conectores 2,4,6 → flujo encadenado */
#archFlow > div:nth-child(4) .arch__pulse { animation-delay: .8s; }
#archFlow > div:nth-child(6) .arch__pulse { animation-delay: 1.6s; }

@keyframes archPulse {
  0%   { left: 0;    opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes archPulseV {
  0%   { top: 0;     opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 100%;  opacity: 0; }
}

.arch__badge {
  text-align: center;
  margin-top: 22px;
  color: #8DA0BA;
  font-size: .92rem;
  font-weight: 500;
}

/* Diagrama en vertical (móvil): los conectores giran y el pulso baja */
@media (max-width: 760px) {
  .arch { flex-direction: column; align-items: stretch; }
  .arch__node { width: 100%; }
  .arch__link {
    flex-basis: 34px;
    width: 2px;
    height: 34px;
    align-self: center;
    background: linear-gradient(180deg, rgba(34, 150, 243, .55), rgba(6, 182, 212, .55));
  }
  .arch__pulse { left: 50%; animation-name: archPulseV; }
}

/* =========================================================
   CALCULADORA DE ROI EMPRESARIAL (Fase 4)
   Dos columnas (escritorio) → una columna (móvil).
   ========================================================= */
.roi-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(800px 420px at 90% 0%, rgba(34, 150, 243, .07), transparent 60%),
    var(--white);
}

.roi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  padding: 42px;
  align-items: center;
}

/* ----- Entradas ----- */
.roi__inputs { display: flex; flex-direction: column; gap: 30px; }
.roi__field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}
.roi__label { color: #CBD5E1; font-size: .95rem; font-weight: 500; line-height: 1.3; }
.roi__value {
  flex-shrink: 0;
  color: var(--blue-bright);
  font-weight: 800;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

/* Slider estilizado (elimina el aspecto gris por defecto del navegador) */
.roi__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  /* El relleno azul se controla con la variable --roi-fill desde JS */
  background: linear-gradient(
    to right,
    var(--blue-bright) var(--roi-fill, 0%),
    rgba(255, 255, 255, .14) var(--roi-fill, 0%)
  );
  outline: none;
  cursor: pointer;
}
.roi__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--blue-bright);
  box-shadow: 0 2px 10px rgba(34, 150, 243, .5);
  transition: transform .15s var(--ease);
}
.roi__slider::-webkit-slider-thumb:hover { transform: scale(1.14); }
.roi__slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--blue-bright);
  box-shadow: 0 2px 10px rgba(34, 150, 243, .5);
  cursor: pointer;
}
.roi__slider::-moz-range-track { height: 6px; border-radius: 999px; background: transparent; }
.roi__slider:focus-visible { box-shadow: 0 0 0 4px rgba(34, 150, 243, .28); }

/* ----- Resultados ----- */
.roi__results { display: flex; flex-direction: column; gap: 16px; }
.roi__card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-align: center;
}
.roi__card--money {
  border-color: rgba(6, 182, 212, .35);
  background: rgba(6, 182, 212, .06);
}
.roi__card-label {
  display: block;
  color: #CBD5E1;
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.roi__card-figure {
  display: block;
  margin: 10px 0 3px;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--blue-bright);
  font-variant-numeric: tabular-nums;
}
.roi__card--money .roi__card-figure { color: #22D3EE; }
.roi__card-unit { display: block; color: #7E90A8; font-size: .85rem; }

/* Indicador gráfico de nivel de ahorro (100% CSS) */
.roi__meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.roi__meter-fill {
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: var(--grad);
  transition: width .35s var(--ease);
}
.roi__cta { margin-top: 6px; }

@media (max-width: 860px) {
  .roi { grid-template-columns: 1fr; gap: 32px; padding: 30px 24px; }
}

/* =========================================================
   Accesibilidad: reduce motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .js .animate-on-scroll { opacity: 1 !important; transform: none !important; }
  .caret { animation: none; }
  .arch__pulse { animation: none; opacity: .7; }
}
