/* =============================================
   CEMILABS — Design System v2.0
   Dark-first · Mobile-optimized · Modern
   ============================================= */

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===== DESIGN TOKENS (Monochrome Minimalist) ===== */
:root {
  --bg:          #ffffff;
  --bg-2:        #fcfcfc;
  --surface:     #ffffff;
  --surface-2:   #f8f8f8;
  --border:      #eaeaea;
  --border-hover:#cccccc;

  --primary:     #000000;
  --primary-dk:  #222222;
  --primary-glow:rgba(0, 0, 0, 0.04);
  --cyan:        #666666;
  --green:       #000000;

  --text:        #111111;
  --text-2:      #555555;
  --text-3:      #a0a0a0;

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --max:         1180px;
  --header-h:    68px;

  --shadow:      0 12px 32px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);
  --glow-blue:   0 0 0 transparent;
}

[data-theme="dark"] {
  --bg:          #0a0a0a;
  --bg-2:        #111111;
  --surface:     #0a0a0a;
  --surface-2:   #1a1a1a;
  --border:      #333333;
  --border-hover:#555555;

  --primary:     #ffffff;
  --primary-dk:  #dddddd;
  --primary-glow:rgba(255, 255, 255, 0.04);
  --cyan:        #aaaaaa;
  --green:       #ffffff;

  --text:        #ffffff;
  --text-2:      #a0a0a0;
  --text-3:      #666666;

  --shadow:      0 12px 32px rgba(255, 255, 255, 0.04);
  --shadow-card: 0 4px 16px rgba(255, 255, 255, 0.04);
}

.brand-icon {
  width: 26px;
  height: auto;
  object-fit: contain;
  transition: filter 0.3s ease;
}

[data-theme="dark"] .brand-icon {
  filter: invert(1);
}

.hero-brand-icon {
  display: block;
  margin: 0 auto 24px auto;
  width: 44px;
  height: auto;
  object-fit: contain;
  transition: filter 0.3s ease;
  animation: float-logo 6s ease-in-out infinite;
}

[data-theme="dark"] .hero-brand-icon {
  filter: invert(1);
}

@keyframes float-logo {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ===== LAYOUT ===== */
.wrap {
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-inline: 20px;
}

section { padding: 80px 0; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 50%, var(--primary-dk) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine-text 5s linear infinite;
}

@keyframes shine-text {
  to { background-position: 200% center; }
}

/* ===== SECTION HEADERS ===== */
.section-head { margin-bottom: 48px; }

.section-head.centered {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.22);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

[data-theme="light"] .kicker {
  border-color: rgba(29, 78, 216, 0.22);
}

.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 54ch;
  line-height: 1.75;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--primary-dk);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 15px;
  border-radius: var(--radius);
}

.btn-full { width: 100%; }

/* ===== HEADER ===== */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s, background 0.3s;
}

header.scrolled {
  box-shadow: var(--shadow);
  background: var(--surface);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  font-size: 16px;
}
.theme-toggle:hover {
  transform: scale(1.05);
  background: var(--border);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Brand */
.brand { display: flex; align-items: center; flex-shrink: 0; }

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Desktop nav links */
.main-nav {
  display: none;
  gap: 4px;
  align-items: center;
  flex: 1;
}

.main-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  padding: 7px 13px;
  border-radius: 8px;
  transition: color 0.18s, background 0.18s;
}

.main-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .main-nav a:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Hide CTA button in nav on mobile (use bottom bar instead) */
.nav-right .btn-primary { display: none; }

/* Theme toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.18s, border-color 0.18s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

[data-theme="light"] .theme-toggle { background: rgba(15, 23, 42, 0.04); }
[data-theme="light"] .theme-toggle:hover { background: rgba(15, 23, 42, 0.09); }

/* Hamburger button */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 9px 8px;
  transition: border-color 0.18s, background 0.18s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.menu-toggle span {
  width: 100%;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  display: block;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile dropdown nav */
.mobile-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(20px);
}

.mobile-nav.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-link {
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 12px;
  transition: color 0.18s, background 0.18s;
  display: block;
}

.mobile-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .mobile-nav-link:hover {
  background: rgba(15, 23, 42, 0.05);
}

.mobile-nav .btn {
  margin-top: 10px;
  text-align: center;
  justify-content: center;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--header-h);
}

/* ===== HERO MINIMALISTA ===== */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--header-h);
  background: var(--bg);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
}

.hero.loaded .hero-canvas {
  opacity: 1;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 80px 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero.loaded .hero-badge {
  opacity: 1;
  transform: translateY(0);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-bottom: 40px;
  color: var(--text);
  min-height: 2em; /* Evita saltos mientras se escribe */
}

.cursor {
  display: inline-block;
  font-weight: 400;
  color: var(--border-hover);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Hero buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hero.loaded .hero-actions {
  opacity: 1;
  transform: translateY(0);
}

/* ===== STATS SECTION ===== */
.stats-section {
  padding: 64px 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.04) 50%,
    transparent 100%
  );
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 20px;
}

.stat-item { text-align: center; }

.stat-value-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.stat-number {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-suffix {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 8px;
}

/* ===== SERVICIOS ===== */
#servicios { background: var(--bg); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  position: relative;
  overflow: hidden;
}

/* Hover glow top-left */
.service-card::before {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.service-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-card), var(--glow-blue);
}

.service-card:hover::before { opacity: 1; }

.service-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.service-card p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.service-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  letter-spacing: 0.02em;
}

[data-theme="light"] .service-tag {
  border-color: rgba(29, 78, 216, 0.15);
}

/* ===== TECNOLOGÍAS (STATIC FLOAT) ===== */
.tech-wave-section {
  padding: 80px 0;
  overflow: hidden;
  background: var(--bg);
}

.wave-container {
  position: relative;
  width: 100%;
  padding: 60px 0 20px;
  display: flex;
  justify-content: center;
}

.wave-track {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  max-width: 900px;
  justify-content: center;
  align-items: center;
}

.wave-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  animation: wave-bob 4s ease-in-out infinite alternate;
  transition: transform 0.2s, box-shadow 0.2s;
}

.wave-icon svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 32px;
  height: 32px;
}

.wave-icon:hover {
  border-color: var(--border-hover);
  color: var(--text-2);
  box-shadow: var(--shadow);
  z-index: 10;
}

.wave-icon:hover svg {
  transform: scale(1.25);
}

@keyframes wave-bob {
  from { transform: translateY(-12px); }
  to { transform: translateY(12px); }
}

/* ===== PROCESO ===== */
#proceso { background: var(--bg-2); }

.proceso-grid {
  display: grid;
  gap: 52px;
  align-items: start;
}

/* Steps list */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.step-item:hover {
  border-color: var(--border-hover);
  transform: translateX(5px);
  box-shadow: var(--shadow-card);
}

.step-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 5px 9px;
  flex-shrink: 0;
  margin-top: 2px;
}

[data-theme="light"] .step-num { border-color: rgba(29, 78, 216, 0.2); }

.step-content b {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.step-content span {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ===== CHATBOT (MINIMALIST MODERN) ===== */
.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: var(--shadow);
  transition: border-color 0.3s;
}

.chat-container:focus-within {
  border-color: var(--border-hover);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  transition: filter 0.3s ease;
}

[data-theme="dark"] .chat-avatar img {
  filter: invert(1);
}

.chat-info { flex: 1; min-width: 0; }
.chat-info b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.chat-info span { font-size: 13px; color: var(--text-3); }

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

.chat-expand-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

@media (min-width: 768px) {
  .chat-expand-btn {
    display: none;
  }
}

.chat-expand-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.chat-body {
  flex: 1;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  background: var(--bg-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

.mensaje { 
  display: flex; 
  flex-direction: column; 
  max-width: 85%; 
  animation: fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.mensaje.bot { align-self: flex-start; }
.mensaje.usuario { align-self: flex-end; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-content {
  padding: 15px 20px;
  font-size: 14.5px;
  line-height: 1.6;
  border-radius: 16px;
  word-wrap: break-word;
}

.mensaje.bot .msg-content {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-card);
}

.mensaje.usuario .msg-content {
  background: var(--text);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}

.mensaje.thinking .msg-content {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-3);
  padding: 0;
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.chat-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-input-area {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.chat-input-area input {
  flex: 1;
  height: 48px;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  padding: 0 18px;
  margin: 0 !important;
  align-self: center !important;
  transition: background 0.2s, border-color 0.2s;
}

.chat-input-area input:focus {
  background: var(--surface);
  border-color: var(--border);
}

.chat-input-area input::placeholder { color: var(--text-3); font-weight: 500; }

@media (max-width: 767px) {
  .chat-input-area input { font-size: 16px; }
  .chat-header { padding: 16px 20px; }
  .chat-body { padding: 20px 16px; }
  .chat-footer { padding: 16px; }
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 !important;
  align-self: center !important;
  transition: transform 0.2s, opacity 0.2s;
}

.chat-send-btn:hover {
  opacity: 0.85;
}

.chat-send-btn:active { transform: scale(0.96); }

/* Expanded state on mobile */
.chat-container.expanded {
  position: fixed;
  top: 0;
  left: 0;
  width: 100% !important;
  /* height is set dynamically by JS via visualViewport */
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  z-index: 99999;
  border: none;
}

body.chat-expanded {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overscroll-behavior: none;
}
body.chat-expanded .mobile-cta { display: none !important; }
body.chat-expanded .chat-wrapper { position: static; z-index: 999999; transform: none !important; transition: none !important; }

/* Allow flex body to shrink when keyboard appears */
.chat-container.expanded .chat-body { min-height: 0; }

/* ===== FAQ ===== */
#faq { background: var(--bg); }

.faq-list {
  max-width: 780px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s;
}

.faq-item.open { border-color: var(--border-hover); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;

@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: color 0.2s;
}

.faq-question:hover { color: var(--primary); }

.faq-icon {
  flex-shrink: 0;
  transition: transform 0.32s ease, color 0.2s;
  color: var(--text-2);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-answer { max-height: 320px; }

.faq-answer p {
  padding: 0 22px 20px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
}

/* ===== FORMULARIO ===== */
#formulario { background: var(--bg-2); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 30px;
  max-width: 700px;
  margin-inline: auto;
  box-shadow: var(--shadow-card);
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group-full { grid-column: 1 / -1; }

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

input, textarea {
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea { resize: vertical; min-height: 120px; }

form button[type="submit"] { margin-top: 10px; }

/* ===== FOOTER ===== */
footer {
  padding: 40px 0 100px; /* room for mobile CTA */
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.footer-brand p {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 7px;
}

.footer-copy {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ===== MOBILE BOTTOM CTA ===== */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: rgba(6, 12, 24, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  z-index: 60;
}

[data-theme="light"] .mobile-cta {
  background: rgba(244, 247, 255, 0.94);
}

.mobile-cta .btn {
  flex: 1;
  text-align: center;
  justify-content: center;
}

/* ===== SCROLL REVEAL ===== */
.reveal-up {
  opacity: 0;
  transform: translateY(38px);
  transition:
    opacity  0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LEGACY SCROLLBAR (compatibility) ===== */
.scroll-bar-wrap {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 14px;
  box-shadow: var(--shadow-card);
  position: sticky;
  bottom: 18px;
  z-index: 9999;
  backdrop-filter: blur(8px);
  user-select: none;
}

.scroll-bar-wrap.visible { display: flex; }

.scroll-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.scroll-btn:hover { background: var(--surface); color: var(--text); }

.scroll-track {
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
}

.scroll-thumb {
  position: absolute;
  height: 100%;
  background: var(--primary);
  border-radius: 10px;
  left: 0;
  width: 40%;
  min-width: 16px;
  transition: left 0.1s;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tiny phones */
@media (max-width: 374px) {
  .hero-title { font-size: 2.3rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .services-grid { grid-template-columns: 1fr; }
}

/* Tablets and up */
@media (min-width: 640px) {
  .stats-grid { gap: 40px 40px; }
}

@media (min-width: 768px) {
  /* Show desktop nav, hide mobile controls */
  .main-nav { display: flex; }
  .menu-toggle { display: none; }
  .nav-right .btn-primary { display: inline-flex; }
  .mobile-cta { display: none; }
  footer { padding-bottom: 40px; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(4, 1fr); }

  /* Services 3-col */
  .services-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

  /* Proceso 2-col */
  .proceso-grid { grid-template-columns: 1fr 1fr; }

  /* Form 2-col */
  .form-grid { grid-template-columns: repeat(2, 1fr); }

  /* Footer row */
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  section { padding: 100px 0; }
  .stats-section { padding: 80px 0; }
  .tech-section { padding: 80px 0; }
  .hero-content { padding: 80px 0 100px; }
  .chat-container { min-height: 480px; }
}

@media (min-width: 1280px) {
  .wrap { padding-inline: 32px; }
}

/* ===== NUEVA ESTRUCTURA (PROCESO Y CHATBOT STANDALONE) ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.step-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius-lg);
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}
.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--text-3);
}
.step-card .step-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text);
  opacity: 0.05;
  position: absolute;
  top: 16px;
  right: 24px;
  pointer-events: none;
  line-height: 1;
}
.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}
.step-card p {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-wrapper {
  max-width: 760px;
  margin: 0 auto;
}
.chat-container.standalone {
  height: 600px;
  box-shadow: var(--shadow);
}