/* ==========================================================================
   Vecinoo — Hoja de Estilos Principal
   Diseño editorial PropTech / SaaS limpio y modular
   ========================================================================== */

:root {
  --color-bg: #F8F8FB;
  --color-surface: #FFFFFF;
  --color-ink: #16142A;
  --color-ink-muted: #524E6E;
  --color-brand: #6D28D9;
  --color-brand-dark: #4C1D95;
  --color-brand-soft: #EFEBF9;
  --color-border: rgba(22, 20, 42, 0.08);
}

/* Base & Tipografía */
html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 84px;
}

.kpi-counter {
  font-variant-numeric: tabular-nums;
}

.kpi-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.kpi-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #A78BFA 0%, #DDD6FE 100%);
  transition: width 1.45s cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

/* Acento de texto sobrio (sin brillo artificial excesivo) */
.text-brand-accent {
  color: var(--color-brand);
}

/* Botón primario sólido con profundidad natural */
.btn-primary {
  background-color: #6D28D9;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background-color: #5B21B6;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px rgba(91, 33, 182, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Navbar con transición sutil al hacer scroll */
.site-header {
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 20px -6px rgba(22, 20, 42, 0.07);
  border-color: rgba(22, 20, 42, 0.08);
}

/* Enlace activo en navegación */
.nav-link {
  position: relative;
  color: #4B4869;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #16142A;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background-color: #6D28D9;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.nav-link.is-active::after {
  transform: scaleX(1);
}

/* Fotografía Hero con máscara editorial limpia */
.hero-photo-backdrop {
  position: relative;
}

.hero-photo-img {
  object-fit: cover;
  object-position: center 45%;
}

/* Banner de métricas en tono oscuro elegante (pizarra/ciruela profundo) */
.stats-banner-bg {
  background: linear-gradient(105deg, #1E173B 0%, #2F1A5F 55%, #431E85 100%);
}

/* Tarjetas con borde nítido y elevación discreta */
.surface-card {
  background-color: #FFFFFF;
  border: 1px solid rgba(22, 20, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.surface-card:hover {
  border-color: rgba(109, 40, 217, 0.28);
  box-shadow: 0 14px 32px -12px rgba(22, 20, 42, 0.09);
}

/* Fotografías editoriales en tarjetas */
.editorial-photo-wrap {
  overflow: hidden;
}

.editorial-photo-wrap img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.editorial-photo-wrap:hover img {
  transform: scale(1.03);
}

/* Escenario 3D interactivo para MacBook + iPhone en el Hero */
.hero-devices-stage {
  perspective: 1400px;
  transform-style: preserve-3d;
}

.device-laptop-3d {
  transform: rotateY(-11deg) rotateX(4deg) translateZ(0px);
  transform-origin: 78% center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.45s ease,
              opacity 0.45s ease;
  will-change: transform;
  z-index: 15;
}

.device-laptop-3d:hover {
  transform: rotateY(0deg) rotateX(0deg) translateX(-24px) translateY(-14px) translateZ(95px) scale(1.24);
  z-index: 45;
  filter: drop-shadow(0 34px 56px rgba(22, 20, 42, 0.38));
}

.device-phone-3d {
  transform: rotateY(14deg) rotateX(4deg) translateZ(36px);
  transform-origin: center bottom;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.45s ease,
              opacity 0.45s ease;
  will-change: transform;
  z-index: 25;
}

.device-phone-3d:hover {
  transform: rotateY(0deg) rotateX(0deg) translateY(-16px) translateZ(105px) scale(1.26);
  z-index: 50;
  filter: drop-shadow(0 32px 50px rgba(22, 20, 42, 0.4));
}

/* Profundidad cinematográfica: al enfocar un dispositivo, el otro cede ligeramente */
.hero-devices-stage:has(.device-laptop-3d:hover) .device-phone-3d {
  transform: rotateY(18deg) rotateX(4deg) translateX(-14px) translateZ(-10px) scale(0.92);
  opacity: 0.78;
}

.hero-devices-stage:has(.device-phone-3d:hover) .device-laptop-3d {
  transform: rotateY(-15deg) rotateX(5deg) translateX(10px) translateZ(-20px) scale(0.96);
  opacity: 0.88;
}

/* En móviles reducimos la inclinación 3D para evitar desbordes horizontales */
@media (max-width: 639px) {
  .device-laptop-3d {
    transform: rotateY(-5deg) rotateX(2deg);
  }
  .device-phone-3d {
    transform: rotateY(6deg) rotateX(2deg);
  }
  .device-laptop-3d:hover {
    transform: scale(1.03);
  }
  .device-phone-3d:hover {
    transform: scale(1.08);
  }
}

/* Transición suave al cambiar pestañas de módulos */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes photoReveal {
  from {
    opacity: 0.25;
    transform: scale(1.05);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tabProgressFill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.module-fade-in {
  animation: fadeSlideUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.module-photo-reveal {
  animation: photoReveal 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Barra de progreso discreta en el tab activo mientras el auto-avance está encendido */
.module-tab-btn {
  position: relative;
  overflow: hidden;
}

.module-tab-btn.is-auto-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: left center;
  animation: tabProgressFill 2s linear forwards;
}

/* Slider personalizado para el Simulador de Inversión */
.vecinoo-range {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #E5E0F5;
  outline: none;
}

.vecinoo-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6D28D9;
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.vecinoo-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.vecinoo-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6D28D9;
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.35);
  cursor: pointer;
}

/* Utilidad para ocultar scrollbars horizontales en tabs móviles */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Toast con transición */
#toastNotification {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Respeto a usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .animate-float-phone,
  .module-fade-in {
    animation: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

