/* VORTEX TECH · Tema claro/oscuro compartido */

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --navy: #f5f8ff;
  --navy-light: #ffffff;
  --navy-mid: #eaf1fb;
  /* Blanco de marca: también se usa dentro de mockups y paneles oscuros. */
  --white: #ffffff;
  --gray-100: #0e203d;
  --gray-200: #243c5d;
  --gray-400: #56708f;
  --gray-600: #6d829c;
  --text: #172a46;
  --text-muted: #536b88;
  --border: rgba(22, 52, 91, 0.1);
  --border2: rgba(22, 52, 91, 0.2);
  --blue-dim: rgba(37, 99, 235, 0.09);
  --blue-glow: rgba(37, 99, 235, 0.16);
  --shadow-card: 0 16px 44px rgba(26, 55, 94, 0.12);
}

html[data-theme="light"] body {
  background: var(--navy, #f5f8ff);
  color: var(--text, #172a46);
}

/* Títulos de las páginas generales sobre superficies claras. */
html[data-theme="light"] .hero-title,
html[data-theme="light"] .stat-n,
html[data-theme="light"] .section-title,
html[data-theme="light"] .product-card h3,
html[data-theme="light"] .why-card h4,
html[data-theme="light"] .t-author strong,
html[data-theme="light"] .cta-content h2,
html[data-theme="light"] .product-hero-title,
html[data-theme="light"] .module-card h3,
html[data-theme="light"] .contact-info h1,
html[data-theme="light"] .mv-card h3,
html[data-theme="light"] .value-item h4,
html[data-theme="light"] .location-card h3,
html[data-theme="light"] .client-info h3 {
  color: #0a1830;
}

body,
.navbar,
.nav,
.product-card,
.why-card,
.testimonial-card,
.module-card,
.contact-form {
  transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.theme-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: rgba(96, 165, 250, 0.7);
  background: rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.38);
  outline-offset: 3px;
}

.theme-toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 48px;
  height: 26px;
  padding: 0 5px;
}

.theme-icon {
  z-index: 1;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.58;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.theme-icon-moon {
  color: #bfdbfe;
  opacity: 1;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, #60a5fa, #2563eb);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.45);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), background 0.28s ease;
}

/* Acceso flotante compartido a WhatsApp. */
.whatsapp-chat {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.whatsapp-chat-label {
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #d9e7e2;
  background: rgba(7, 24, 30, 0.94);
  box-shadow: 0 12px 34px rgba(2, 16, 21, 0.24);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.whatsapp-chat-label b {
  color: #55e6a5;
  font-weight: 700;
}

.whatsapp-chat-button {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, #2ee66b, #16a951);
  box-shadow: 0 13px 34px rgba(13, 132, 65, 0.36), 0 0 0 6px rgba(37, 211, 102, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-chat-button::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: inherit;
  animation: whatsapp-pulse 2.5s ease-out infinite;
}

.whatsapp-chat svg {
  width: 32px;
  height: 32px;
  overflow: visible;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.whatsapp-chat:hover .whatsapp-chat-label,
.whatsapp-chat:focus-visible .whatsapp-chat-label {
  opacity: 1;
  transform: translateX(0);
}

.whatsapp-chat:hover .whatsapp-chat-button,
.whatsapp-chat:focus-visible .whatsapp-chat-button {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 17px 38px rgba(13, 132, 65, 0.42), 0 0 0 7px rgba(37, 211, 102, 0.12);
}

.whatsapp-chat:focus-visible {
  outline: none;
}

.whatsapp-chat:focus-visible .whatsapp-chat-button {
  outline: 3px solid rgba(96, 165, 250, 0.7);
  outline-offset: 4px;
}

@keyframes whatsapp-pulse {
  0% { opacity: 0.7; transform: scale(0.88); }
  75%, 100% { opacity: 0; transform: scale(1.22); }
}

html[data-theme="light"] .theme-toggle {
  color: #244161;
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(219, 234, 254, 0.14);
}

html[data-theme="light"] .theme-icon-sun {
  color: #fbbf24;
  opacity: 1;
}

html[data-theme="light"] .theme-icon-moon {
  opacity: 0.45;
}

html[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(-22px);
  background: linear-gradient(145deg, #fde68a, #f59e0b);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

/* El encabezado se mantiene azul marino para conservar contraste y marca. */
html[data-theme="light"] .navbar,
html[data-theme="light"] .navbar.scrolled,
html[data-theme="light"] .nav {
  background: rgba(7, 20, 38, 0.96);
  border-bottom-color: rgba(147, 197, 253, 0.13);
  box-shadow: 0 8px 28px rgba(31, 58, 92, 0.12);
}

html[data-theme="light"] .navbar .nav-links a,
html[data-theme="light"] .nav .nav-links a,
html[data-theme="light"] .nav .btn-back {
  color: #aebed2;
}

html[data-theme="light"] .navbar .nav-links a:hover,
html[data-theme="light"] .navbar .nav-links a.active,
html[data-theme="light"] .nav .nav-links a:hover,
html[data-theme="light"] .nav .btn-back:hover {
  color: #ffffff;
}

html[data-theme="light"] .hamburger span {
  background: #e8edf5;
}

html[data-theme="light"] .nav-open .nav-links {
  background: rgba(7, 20, 38, 0.99);
}

html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-nav,
html[data-theme="light"] .btn-green {
  color: #ffffff;
}

html[data-theme="light"] .hero-grid {
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.35) 1px, transparent 1px);
}

html[data-theme="light"] .hero-badge,
html[data-theme="light"] .card-badge.popular {
  color: #1d4ed8;
}

html[data-theme="light"] .card-badge.nuevo,
html[data-theme="light"] .factura-tag {
  color: #047857;
}

html[data-theme="light"] .client-chip {
  background: #f7faff;
}

html[data-theme="light"] .product-card,
html[data-theme="light"] .why-card,
html[data-theme="light"] .testimonial-card,
html[data-theme="light"] .module-card,
html[data-theme="light"] .contact-form {
  box-shadow: 0 12px 36px rgba(26, 55, 94, 0.07);
}

html[data-theme="light"] .product-card:hover,
html[data-theme="light"] .module-card:hover,
html[data-theme="light"] .testimonial-card:hover {
  box-shadow: var(--shadow-card);
}

html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group select,
html[data-theme="light"] .form-group textarea {
  background: #f8fbff;
  color: #172a46;
}

html[data-theme="light"] .form-msg.ok {
  color: #047857;
}

html[data-theme="light"] .form-msg.err {
  color: #b91c1c;
}

html[data-theme="light"] .hero .btn-outline {
  color: #1d3553;
  border-color: rgba(29, 53, 83, 0.24);
}

html[data-theme="light"] .hero .btn-outline:hover {
  color: #0b1e38;
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.07);
}

html[data-theme="light"] .trust-badge {
  color: #47708d;
}

/* Labs conserva deliberadamente su estética oscura de laboratorio en ambos modos. */
html[data-theme="light"] body.labs-page {
  background: #071426;
  color: #dce9f7;
}

/* KYC: la landing se aclara; el teléfono y portal siguen siendo demos del producto. */
html[data-theme="light"] .kyc-page {
  background: #f3f6fc;
  color: #172b49;
}

html[data-theme="light"] .kyc-hero,
html[data-theme="light"] .kyc-section,
html[data-theme="light"] .kyc-value-section,
html[data-theme="light"] .kyc-flow-section,
html[data-theme="light"] .decision-section,
html[data-theme="light"] .portal-section,
html[data-theme="light"] .industries-section,
html[data-theme="light"] .integration-section,
html[data-theme="light"] .kyc-final-cta {
  background-color: #f3f6fc;
  background-image:
    radial-gradient(circle at 78% 15%, rgba(109, 22, 255, 0.09), transparent 26%),
    linear-gradient(135deg, #fbfdff, #edf3fb);
}

html[data-theme="light"] .kyc-hero h1,
html[data-theme="light"] .kyc-section-heading h2,
html[data-theme="light"] .decision-copy h2,
html[data-theme="light"] .integration-copy h2,
html[data-theme="light"] .value-card h3,
html[data-theme="light"] .journey h3,
html[data-theme="light"] .industry-card h3,
html[data-theme="light"] .integration-layout h2,
html[data-theme="light"] .kyc-final-cta h2 {
  color: #0b2141;
}

html[data-theme="light"] .kyc-hero-lead,
html[data-theme="light"] .kyc-section-heading p,
html[data-theme="light"] .decision-copy > p,
html[data-theme="light"] .integration-copy > p,
html[data-theme="light"] .value-card p,
html[data-theme="light"] .journey p,
html[data-theme="light"] .industry-card p,
html[data-theme="light"] .integration-layout p,
html[data-theme="light"] .kyc-final-cta p {
  color: #566e8c;
}

html[data-theme="light"] .kyc-hero-lead strong,
html[data-theme="light"] .kyc-audiences span {
  color: #274666;
}

html[data-theme="light"] .kyc-value-grid article,
html[data-theme="light"] .journey article,
html[data-theme="light"] .industries-grid article,
html[data-theme="light"] .integration-point,
html[data-theme="light"] .kyc-trust-note {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(53, 91, 145, 0.14);
  box-shadow: 0 14px 40px rgba(27, 58, 101, 0.08);
}

html[data-theme="light"] .kyc-proof-strip,
html[data-theme="light"] .kyc-footer {
  background: #e8eff9;
  color: #526b88;
}

/* Arquitectura KYC: bloque técnico oscuro, aislado del fondo diurno. */
html[data-theme="light"] .product-architecture {
  background:
    radial-gradient(circle at 50% 110%, rgba(39, 125, 244, 0.12), transparent 38%),
    #07142f;
}

html[data-theme="light"] .product-architecture .kyc-section-heading h2 {
  color: #f2f6ff;
}

html[data-theme="light"] .product-architecture .kyc-section-heading > p {
  color: #849bb8;
}

html[data-theme="light"] .kyc-value-grid h3,
html[data-theme="light"] .industries-grid h3 {
  color: #173252;
}

html[data-theme="light"] .kyc-value-grid p,
html[data-theme="light"] .industries-grid p {
  color: #58718f;
}

/* Vortex/A es una página autónoma con estilos embebidos. */
html[data-theme="light"] body:not(.labs-page):not(.kyc-page) .features,
html[data-theme="light"] body:not(.labs-page):not(.kyc-page) .section,
html[data-theme="light"] body:not(.labs-page):not(.kyc-page) .benefits,
html[data-theme="light"] body:not(.labs-page):not(.kyc-page) .resources-grid {
  color: #142743;
}

html[data-theme="light"] .feature-card,
html[data-theme="light"] .integ-item,
html[data-theme="light"] .benefit-card,
html[data-theme="light"] .impact,
html[data-theme="light"] .impact-card,
html[data-theme="light"] .price-card,
html[data-theme="light"] .resource-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(31, 73, 125, 0.13);
  box-shadow: 0 14px 38px rgba(31, 63, 105, 0.07);
}

html[data-theme="light"] .feature-card h3,
html[data-theme="light"] .integ-item h3,
html[data-theme="light"] .benefit-card h3,
html[data-theme="light"] .section-head h2,
html[data-theme="light"] .impact-top p b,
html[data-theme="light"] .bar-label b,
html[data-theme="light"] .impact-card strong,
html[data-theme="light"] .price-name,
html[data-theme="light"] .price-amount,
html[data-theme="light"] .resource-card h3 {
  color: #101f38;
}

html[data-theme="light"] .hero-desc,
html[data-theme="light"] .feature-card p,
html[data-theme="light"] .section-head p,
html[data-theme="light"] .integ-item p,
html[data-theme="light"] .benefit-card p,
html[data-theme="light"] .impact-top p,
html[data-theme="light"] .bar-label,
html[data-theme="light"] .impact-card p,
html[data-theme="light"] .price-sub,
html[data-theme="light"] .price-note,
html[data-theme="light"] .price-feats li,
html[data-theme="light"] .resource-card p {
  color: #586e89;
}

html[data-theme="light"] .integrations,
html[data-theme="light"] .integ-media,
html[data-theme="light"] .code-block,
html[data-theme="light"] .phone-frame,
html[data-theme="light"] .floating-card.dark {
  background-color: #081426;
  color: #ffffff;
}

html[data-theme="light"] .integrations {
  background: #edf4fc;
  color: #142743;
}

html[data-theme="light"] .impact-table thead th,
html[data-theme="light"] .impact-table tbody td,
html[data-theme="light"] .impact-table tbody td:first-child,
html[data-theme="light"] .impact-table tr.year td:first-child,
html[data-theme="light"] .impact-table .col-save {
  color: #314a68;
}

html[data-theme="light"] .impact-table th,
html[data-theme="light"] .impact-table td {
  border-bottom-color: rgba(31, 73, 125, 0.11);
}

html[data-theme="light"] .final-cta {
  background-color: #eaf3ff;
}

html[data-theme="light"] .final-cta h2 {
  color: #10223d;
}

html[data-theme="light"] .final-cta p,
html[data-theme="light"] .footer-inner p {
  color: #5b718d;
}

html[data-theme="light"] .site-footer {
  background: #e7eff9;
  border-top-color: rgba(31, 73, 125, 0.12);
}

@media (max-width: 700px) {
  .whatsapp-chat {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .whatsapp-chat-label {
    display: none;
  }

  .whatsapp-chat-button {
    width: 54px;
    height: 54px;
  }

  .whatsapp-chat svg {
    width: 29px;
    height: 29px;
  }

  .theme-toggle {
    width: 52px;
    height: 32px;
    margin-left: auto;
    margin-right: 10px;
  }

  .theme-toggle-track {
    width: 44px;
    height: 24px;
  }

  .theme-toggle-thumb {
    width: 18px;
    height: 18px;
  }

  html[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(-20px);
  }

  .nav {
    padding: 14px 20px !important;
  }

  .nav .nav-left,
  .nav .nav-right {
    gap: 8px;
  }

  .nav .nav-links,
  .nav .btn-back {
    display: none;
  }

  .nav .theme-toggle {
    margin: 0;
  }

  .nav .logo-text {
    font-size: 19px;
  }

  .nav .btn-primary {
    padding: 10px 14px;
    font-size: 12px;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle-thumb,
  body,
  .navbar,
  .nav {
    transition: none !important;
  }

  .whatsapp-chat-button::before {
    animation: none;
  }
}
