/* ============================================================
   CONVERSIA · Dark Premium Design System
   ============================================================ */

:root {
  --bg-primary:    #07071a;
  --bg-secondary:  #0d0d2b;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border:        rgba(255,255,255,0.08);
  --border-glow:   rgba(99,102,241,0.4);

  --accent-blue:   #6366f1;
  --accent-violet: #8b5cf6;
  --accent-cyan:   #06b6d4;
  --accent-teal:   #14b8a6;
  --accent-orange: #f97316;
  --accent-green:  #22c55e;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.05) 100%);

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  --shadow-glow: 0 0 40px rgba(99,102,241,0.25);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }

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

/* ── LAYOUT ───────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section { padding: 100px 0; }

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  background: rgba(7,7,26,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}

nav.scrolled {
  padding: 14px 0;
  background: rgba(7,7,26,0.95);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.logo span { font-weight: 400; }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
  background: var(--gradient-hero);
  color: white !important;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  transition: opacity 0.2s, transform 0.2s !important;
}

.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── HERO ─────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(139,92,246,0.1) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 10% 70%, rgba(6,182,212,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #a5b4fc;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.hero-title { margin-bottom: 24px; }

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--gradient-hero);
  color: white;
  box-shadow: 0 4px 24px rgba(99,102,241,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

/* ── VOICE VISUALIZER (Hero) ──────────────────────────────── */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.voice-sphere {
  position: relative;
  width: 320px;
  height: 320px;
}

.sphere-core {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: 140px; height: 140px;
  background: var(--gradient-hero);
  border-radius: 50%;
  box-shadow:
    0 0 60px rgba(99,102,241,0.5),
    0 0 120px rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 4s ease-in-out infinite;
}

.sphere-icon { font-size: 3rem; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }

.sphere-ring {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid;
  animation: ring-expand 3s ease-out infinite;
}

.sphere-ring:nth-child(1) { width: 180px; height: 180px; border-color: rgba(99,102,241,0.5); animation-delay: 0s; }
.sphere-ring:nth-child(2) { width: 240px; height: 240px; border-color: rgba(99,102,241,0.3); animation-delay: 0.8s; }
.sphere-ring:nth-child(3) { width: 300px; height: 300px; border-color: rgba(99,102,241,0.15); animation-delay: 1.6s; }

/* ── STATS BAR ────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 80px;
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}

.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--bg-card-hover); }

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── HOW IT WORKS ─────────────────────────────────────────── */
#como-funciona { background: var(--bg-secondary); }

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.section-title { margin-bottom: 16px; }
.section-subtitle { color: var(--text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto 60px; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 48px;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.step-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  transition: all 0.3s;
}

.step-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.step-number {
  width: 56px; height: 56px;
  background: var(--gradient-hero);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
}

.step-icon { font-size: 1.5rem; margin-bottom: 16px; }
.step-title { font-size: 1.1rem; margin-bottom: 12px; }
.step-desc { font-size: 0.9rem; color: var(--text-secondary); }

/* ── VERTICALES ───────────────────────────────────────────── */
#verticales { padding: 100px 0; }

.verticales-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 60px;
}

.vertical-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.vertical-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.vertical-card:hover { transform: translateY(-6px); }
.vertical-card:hover::before { opacity: 1; }

/* Color themes per vertical */
.vertical-card[data-vertical="reactiva"] { border-top: 3px solid var(--accent-blue); }
.vertical-card[data-vertical="reactiva"]::before { background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, transparent 60%); }
.vertical-card[data-vertical="reactiva"]:hover { box-shadow: 0 20px 60px rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.5); }

.vertical-card[data-vertical="primera_vez"] { border-top: 3px solid var(--accent-teal); }
.vertical-card[data-vertical="primera_vez"]::before { background: linear-gradient(135deg, rgba(20,184,166,0.08) 0%, transparent 60%); }
.vertical-card[data-vertical="primera_vez"]:hover { box-shadow: 0 20px 60px rgba(20,184,166,0.2); border-color: rgba(20,184,166,0.5); }

.vertical-card[data-vertical="vecino_seguro"] { border-top: 3px solid var(--accent-orange); }
.vertical-card[data-vertical="vecino_seguro"]::before { background: linear-gradient(135deg, rgba(249,115,22,0.08) 0%, transparent 60%); }
.vertical-card[data-vertical="vecino_seguro"]:hover { box-shadow: 0 20px 60px rgba(249,115,22,0.2); border-color: rgba(249,115,22,0.5); }

.vertical-card[data-vertical="paciente_activo"] { border-top: 3px solid var(--accent-green); }
.vertical-card[data-vertical="paciente_activo"]::before { background: linear-gradient(135deg, rgba(34,197,94,0.08) 0%, transparent 60%); }
.vertical-card[data-vertical="paciente_activo"]:hover { box-shadow: 0 20px 60px rgba(34,197,94,0.2); border-color: rgba(34,197,94,0.5); }

.vertical-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.vertical-icon-wrap {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.vertical-card[data-vertical="reactiva"] .vertical-icon-wrap { background: rgba(99,102,241,0.15); }
.vertical-card[data-vertical="primera_vez"] .vertical-icon-wrap { background: rgba(20,184,166,0.15); }
.vertical-card[data-vertical="vecino_seguro"] .vertical-icon-wrap { background: rgba(249,115,22,0.15); }
.vertical-card[data-vertical="paciente_activo"] .vertical-icon-wrap { background: rgba(34,197,94,0.15); }

.vertical-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
}

.vertical-card[data-vertical="reactiva"] .vertical-badge { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.vertical-card[data-vertical="primera_vez"] .vertical-badge { background: rgba(20,184,166,0.15); color: #5eead4; }
.vertical-card[data-vertical="vecino_seguro"] .vertical-badge { background: rgba(249,115,22,0.15); color: #fdba74; }
.vertical-card[data-vertical="paciente_activo"] .vertical-badge { background: rgba(34,197,94,0.15); color: #86efac; }

.vertical-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.vertical-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.vertical-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 28px;
  line-height: 1.7;
}

.vertical-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.vstat { text-align: center; flex: 1; }
.vstat-value { font-size: 1.3rem; font-weight: 800; display: block; }
.vstat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.vertical-card[data-vertical="reactiva"] .vstat-value { color: #a5b4fc; }
.vertical-card[data-vertical="primera_vez"] .vstat-value { color: #5eead4; }
.vertical-card[data-vertical="vecino_seguro"] .vstat-value { color: #fdba74; }
.vertical-card[data-vertical="paciente_activo"] .vstat-value { color: #86efac; }

.btn-voice {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.vertical-card[data-vertical="reactiva"] .btn-voice { background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 4px 20px rgba(99,102,241,0.3); }
.vertical-card[data-vertical="primera_vez"] .btn-voice { background: linear-gradient(135deg, #14b8a6, #06b6d4); box-shadow: 0 4px 20px rgba(20,184,166,0.3); }
.vertical-card[data-vertical="vecino_seguro"] .btn-voice { background: linear-gradient(135deg, #f97316, #ef4444); box-shadow: 0 4px 20px rgba(249,115,22,0.3); }
.vertical-card[data-vertical="paciente_activo"] .btn-voice { background: linear-gradient(135deg, #22c55e, #14b8a6); box-shadow: 0 4px 20px rgba(34,197,94,0.3); }

.btn-voice:hover { transform: translateY(-2px); filter: brightness(1.1); }

.mic-icon { font-size: 1.2rem; animation: none; }
.btn-voice:hover .mic-icon { animation: wiggle 0.5s ease; }

/* ── VOICE MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,7,26,0.92);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: #0f0f2e;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), var(--shadow-glow);
  animation: slideUp 0.35s cubic-bezier(0.4,0,0.2,1);
}

.modal-header {
  padding: 28px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-agent-info { display: flex; align-items: center; gap: 16px; }

.modal-agent-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.modal-agent-name { font-weight: 700; font-size: 1.1rem; }
.modal-agent-role { font-size: 0.8rem; color: var(--text-muted); }

.modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.modal-body { padding: 32px; }

/* Voice visualizer in modal */
.modal-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  margin-bottom: 24px;
  position: relative;
}

.modal-sphere {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  transition: transform 0.2s;
}

.modal-sphere.idle {
  background: linear-gradient(135deg, #2a2a5e, #1e1e40);
  box-shadow: 0 0 20px rgba(99,102,241,0.2);
}

.modal-sphere.connecting {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  animation: pulse-sphere 1.5s infinite;
}

.modal-sphere.speaking {
  background: var(--gradient-hero);
  animation: bounce-sphere 0.4s ease infinite alternate;
  box-shadow: 0 0 40px rgba(99,102,241,0.5);
}

.modal-sphere.listening {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  box-shadow: 0 0 40px rgba(34,197,94,0.4);
  animation: pulse-sphere 1s infinite;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  position: absolute;
  bottom: 8px;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent-blue);
  animation: wave-anim 1.2s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal-sphere.speaking ~ .waveform .wave-bar,
.modal-sphere.listening ~ .waveform .wave-bar { opacity: 1; }

.wave-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 36px; animation-delay: 0.1s; }
.wave-bar:nth-child(5) { height: 24px; animation-delay: 0.3s; }
.wave-bar:nth-child(6) { height: 16px; animation-delay: 0.15s; }
.wave-bar:nth-child(7) { height: 28px; animation-delay: 0.25s; }
.wave-bar:nth-child(8) { height: 20px; animation-delay: 0.05s; }

.modal-status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  min-height: 22px;
  transition: color 0.3s;
}

.modal-status.active { color: var(--accent-cyan); }

/* Transcript */
.transcript-box {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 140px;
  overflow-y: auto;
  margin-bottom: 24px;
  font-size: 0.88rem;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.transcript-box::-webkit-scrollbar { width: 4px; }
.transcript-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.transcript-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
  font-style: italic;
}

.transcript-line { margin-bottom: 8px; }
.transcript-line.agent { color: #a5b4fc; }
.transcript-line.user { color: var(--text-primary); }
.transcript-line .speaker { font-weight: 700; margin-right: 6px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Call controls */
.call-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.btn-call-start {
  flex: 1;
  background: var(--gradient-hero);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-call-start:hover { transform: translateY(-2px); filter: brightness(1.1); }

.btn-call-end {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.25s;
  display: none;
}

.btn-call-end.visible { display: block; }
.btn-call-end:hover { background: rgba(239,68,68,0.25); }

/* Vertical PRESENTE — ancho completo */
.vertical-card--full { grid-column: 1 / -1; }

.vertical-card[data-vertical="presente"] { border-top: 3px solid #a855f7; }
.vertical-card[data-vertical="presente"]::before { background: linear-gradient(135deg, rgba(168,85,247,0.08) 0%, transparent 60%); }
.vertical-card[data-vertical="presente"]:hover { box-shadow: 0 20px 60px rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.5); }
.vertical-card[data-vertical="presente"] .vertical-icon-wrap { background: rgba(168,85,247,0.15); }
.vertical-card[data-vertical="presente"] .vertical-badge { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.vertical-card[data-vertical="presente"] .vstat-value { color: #d8b4fe; }
.vertical-card[data-vertical="presente"] .btn-voice { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 4px 20px rgba(168,85,247,0.3); }

/* ── DEMO LIBRE ───────────────────────────────────────────── */
#demo-libre { background: var(--bg-secondary); }

.libre-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  margin-top: 60px;
}

.libre-title {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.libre-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

.voice-selector-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}

.voice-btn {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.voice-btn:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.08);
}

.voice-btn.active {
  border-color: var(--accent-blue);
  background: rgba(99,102,241,0.15);
  box-shadow: 0 0 16px rgba(99,102,241,0.2);
}

.voice-avatar { font-size: 1.4rem; }
.voice-name { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.voice-desc { font-size: 0.7rem; color: var(--text-muted); }

.voice-btn.active .voice-name { color: #a5b4fc; }

.libre-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-libre-start {
  flex: 1;
  justify-content: center;
  min-width: 200px;
}

.btn-libre-end {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-libre-end:hover { background: rgba(239,68,68,0.25); }

/* Right column */
.libre-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.libre-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
}

.libre-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
  transition: color 0.3s;
  min-height: 20px;
}

.libre-status.active { color: var(--accent-cyan); }

.libre-transcript {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 220px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.libre-transcript::-webkit-scrollbar { width: 4px; }
.libre-transcript::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

@media (max-width: 900px) {
  .libre-card { grid-template-columns: 1fr; padding: 28px; }
  .voice-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── TECH SECTION ─────────────────────────────────────────── */
#tecnologia { background: var(--bg-secondary); }

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.tech-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all 0.3s;
}

.tech-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.tech-logo {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.tech-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.tech-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* ── CONTACT ──────────────────────────────────────────────── */
#contacto {
  text-align: center;
  position: relative;
  overflow: hidden;
}

#contacto::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 80px 60px;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.contact-card h2 { margin-bottom: 16px; }
.contact-card p { color: var(--text-secondary); margin-bottom: 40px; font-size: 1.1rem; }

.contact-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text-secondary); }

/* ── PERMISSION BANNER ────────────────────────────────────── */
.permission-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a3e;
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: none;
  align-items: center;
  gap: 16px;
  z-index: 300;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
  max-width: 90vw;
  white-space: nowrap;
}

.permission-banner.show { display: flex; }
.permission-banner span { font-size: 0.9rem; color: var(--text-secondary); }
.permission-banner strong { color: var(--text-primary); }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%       { transform: translate(-50%, -50%) translateY(-12px); }
}

@keyframes ring-expand {
  0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes wave-anim {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(2.5); }
}

@keyframes pulse-sphere {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); transform: scale(1); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.5); transform: scale(1.05); }
}

@keyframes bounce-sphere {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wiggle {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-15deg); }
  75%  { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  section { padding: 64px 0; }
  .container { padding: 0 16px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-subtitle { margin: 0 auto 40px; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: flex; margin: 0 auto 8px; }
  .voice-sphere { width: 200px; height: 200px; }
  .sphere-core  { width: 90px; height: 90px; }
  .sphere-icon  { font-size: 2rem; }
  .hero-bg { overflow: hidden; }
  .verticales-grid { grid-template-columns: 1fr; }
  .vertical-card { padding: 28px 20px; }
  .vertical-stats { flex-wrap: wrap; gap: 12px; }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid::before { display: none; }
  .tech-grid { grid-template-columns: 1fr; gap: 10px; }
  .tech-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-align: left;
  }
  .tech-logo { font-size: 1.8rem; margin-bottom: 0; flex-shrink: 0; }
  .tech-name { font-size: 0.95rem; margin-bottom: 2px; }
  .tech-desc { font-size: 0.8rem; }
  .stats-bar { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .contact-card { padding: 48px 20px; }
  .contact-actions { flex-direction: column; }
  .libre-card { grid-template-columns: 1fr; padding: 24px 16px; }
  .voice-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .btn-libre-start { min-width: unset; }
  .modal { margin: 0 8px; }
  .theme-toggle { display: none; }
}

/* ── HERO CANVAS ──────────────────────────────────────────── */
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#hero .container { position: relative; z-index: 1; }

/* ── CURSOR SPOTLIGHT ─────────────────────────────────────── */
.spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--cx, -9999px) var(--cy, -9999px),
    rgba(99,102,241,0.07) 0%,
    transparent 70%
  );
}
body.light .spotlight {
  background: radial-gradient(
    600px circle at var(--cx, -9999px) var(--cy, -9999px),
    rgba(99,102,241,0.05) 0%,
    transparent 70%
  );
}

/* ── SCROLL REVEAL ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── THEME TOGGLE BUTTON ──────────────────────────────────── */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.theme-toggle:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
  transform: rotate(20deg);
}

/* ── LIGHT THEME ──────────────────────────────────────────── */
body.light {
  --bg-primary:    #f8f9ff;
  --bg-secondary:  #eef0fb;
  --bg-card:       rgba(0,0,0,0.04);
  --bg-card-hover: rgba(0,0,0,0.07);
  --border:        rgba(0,0,0,0.1);
  --border-glow:   rgba(99,102,241,0.4);
  --text-primary:  #0f0f2d;
  --text-secondary:#4b5563;
  --text-muted:    #9ca3af;
  --shadow-card:   0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow:   0 0 40px rgba(99,102,241,0.2);
}

body.light nav {
  background: rgba(248,249,255,0.85);
}
body.light nav.scrolled {
  background: rgba(248,249,255,0.97);
}
body.light .permission-banner {
  background: #eef0fb;
}
body.light .voice-modal-backdrop {
  background: rgba(200,200,220,0.7);
}
body.light .modal {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
}
body.light .transcript-box {
  background: rgba(0,0,0,0.03);
}
body.light .transcript-line.agent { background: rgba(99,102,241,0.08); }
body.light .transcript-line.user  { background: rgba(0,0,0,0.04); }
body.light .libre-card { background: #ffffff; border-color: rgba(0,0,0,0.1); }
body.light .voice-btn  { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); color: var(--text-primary); }
body.light .voice-btn.active { background: rgba(99,102,241,0.15); border-color: var(--accent-blue); }

/* Vertical cards in light mode */
body.light .vertical-card { background: #ffffff; border-color: rgba(0,0,0,0.08); }
body.light .vertical-desc { color: #374151; }
body.light .vertical-subtitle { color: #6b7280; }
body.light .vstat-label { color: #6b7280; }

body.light .vertical-card[data-vertical="reactiva"]      .vstat-value { color: #4f46e5; }
body.light .vertical-card[data-vertical="primera_vez"]   .vstat-value { color: #0d9488; }
body.light .vertical-card[data-vertical="vecino_seguro"] .vstat-value { color: #ea580c; }
body.light .vertical-card[data-vertical="paciente_activo"].vstat-value { color: #16a34a; }
body.light .vertical-card[data-vertical="presente"]      .vstat-value { color: #7c3aed; }

body.light .vertical-card[data-vertical="reactiva"]      .vertical-badge { background: rgba(79,70,229,0.1); color: #4f46e5; }
body.light .vertical-card[data-vertical="primera_vez"]   .vertical-badge { background: rgba(13,148,136,0.1); color: #0d9488; }
body.light .vertical-card[data-vertical="vecino_seguro"] .vertical-badge { background: rgba(234,88,12,0.1);  color: #ea580c; }
body.light .vertical-card[data-vertical="paciente_activo"].vertical-badge { background: rgba(22,163,74,0.1); color: #16a34a; }
body.light .vertical-card[data-vertical="presente"]      .vertical-badge { background: rgba(124,58,237,0.1); color: #7c3aed; }

body.light #verticales { background: var(--bg-secondary); }
body.light #tecnologia { background: #e8eaf6; }
body.light .tech-card  { background: #ffffff; border-color: rgba(0,0,0,0.08); }
body.light .tech-desc  { color: #374151; }
