/* ==========================================================================
   CONSORCIO SMART - LANDING PAGE STYLES
   B2B PropTech Aesthetic: Clean Bento UI, Ultra-Smooth Transitions & Micro-interactions
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================
   SISTEMA DE TOKENS DE CONTRASTE Y ELEVACIÓN - CONSORCIO SMART
   ========================================================== */
:root {
  --bg-canvas: #e2e8f0;          /* --bg-canvas: #eef2f6; Slate 200 frío para contraste */          /* #eef2f6: Slate 100 frío para profundidad y contraste */
  --bg-canvas-legacy: #f8fafc;   /* Compatibilidad */
  --surface-card: #ffffff;       /* Blanco puro para elevar cards */
  --border-card: #cbd5e1;        /* Slate 300: bordes definidos y visibles */
  --border-card-hover: #94a3b8;  /* Slate 400 */
  
  --text-main: #0f172a;          /* Slate 900: títulos firmes */
  --text-body: #334155;          /* Slate 700: lectura nítida sin cansar */
  --text-muted: #64748b;         /* Slate 500 */

  --brand-blue: #2563eb;         /* Blue 600 */
  --brand-blue-hover: #1d4ed8;   /* Blue 700 */
  --brand-indigo: #4f46e5;       /* Indigo 600 (Bildy Bot) */
  --brand-cyan: #06b6d4;
  --brand-emerald: #10b981;
  --brand-amber: #f59e0b;

  --card-border: #cbd5e1;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-dark-bg: rgba(15, 23, 42, 0.92);
}

html {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text-body);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-body);
}

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

h1, h2, h3, h4 {
  color: var(--text-main);
}

/* Contenedores oscuros y Tarjeta de Garantía: Contraste de Alta Legibilidad */
#garantia-piloto h2,
#garantia-piloto .font-heading,
#garantia-piloto h2 span {
  color: #ffffff;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Tarjetas con Contraste y Elevación */
.smart-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-card);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.smart-card:hover {
  border-color: var(--border-card-hover);
  box-shadow: 0 10px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

/* Semáforo de Tickets y Estados con Contraste Nítido */
.badge-state-resolved {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-weight: 600;
}

.badge-state-pending {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 600;
}

.badge-state-urgent {
  background-color: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-weight: 600;
}

.badge-state-faq {
  background-color: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-weight: 600;
}

/* Glassmorphism Styles */
.glass-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-card);
}

.glass-card-dark {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.8);
}

/* Subtle Hero Glow Backgrounds */
.hero-glow-1 {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 480px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(6, 182, 212, 0.08) 45%, rgba(248, 250, 252, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  top: 15%;
  right: 5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(248, 250, 252, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* Micro-Interactions on Interactive Elements */
.btn-primary {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px 0 rgba(37, 99, 235, 0.36);
}

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

.btn-secondary {
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.card-hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.card-hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.08);
  border-color: var(--border-card-hover);
}

/* Interactive Slider Custom Styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 9999px;
  background: #cbd5e1;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563eb;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563eb;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

/* Custom Scrollbar for Chat Simulation */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.6);
}

/* Pulsing Dots & Status Indicators */
.status-dot-active {
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.9;
  }
}

/* Phone Mockup Frame Accents */
.phone-mockup-shadow {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(51, 65, 85, 0.7);
}

.ticket-mockup-shadow {
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(203, 213, 225, 0.9);
}

/* Focus Visible for Accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}


/* Anti-overflow global para mobile (360px - 412px) sin romper compositor scroll */
html, body {
  overflow-x: clip !important;
  max-width: 100vw !important;
  width: 100% !important;
}

@media (min-width: 400px) {
  .xs\:inline {
    display: inline !important;
  }
  .xs\:text-3xl {
    font-size: 1.875rem !important;
    line-height: 2.25rem !important;
  }
}

/* ==========================================================================
   BILDY HERO & MICRO-ESCENAS SVG (GPU-ONLY: transform & opacity)
   ========================================================================== */
@keyframes bildyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes bildyShadow {
  0%, 100% { transform: scaleX(1); opacity: 0.24; }
  50% { transform: scaleX(0.9); opacity: 0.14; }
}

@keyframes bildyBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  93%, 96% { transform: scaleY(0.1); }
}

@keyframes bildyPulse {
  0% { transform: scale(0.75); opacity: 0.85; }
  100% { transform: scale(1.85); opacity: 0; }
}

@keyframes bildyWave {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

@keyframes bildyTrackFlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes bildyCardCycle {
  0%, 26%, 100% { transform: translateY(0) scale(1); }
  8%, 18% { transform: translateY(-5px) scale(1.05); }
}

@keyframes bildyCardActiveGlow {
  0%, 26%, 100% { opacity: 0; }
  8%, 18% { opacity: 1; }
}

@keyframes svgScanLine {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(26px); opacity: 1; }
}

@keyframes svgCheckPop {
  0%, 35% { opacity: 0.4; transform: scale(0.88); }
  50%, 85% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.4; transform: scale(0.88); }
}

@keyframes svgPulseSoft {
  0%, 100% { opacity: 0.65; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes svgNodeStep {
  0%, 28% { opacity: 1; transform: scale(1.12); }
  45%, 100% { opacity: 0.42; transform: scale(0.95); }
}

@keyframes svgBarGrow {
  0%, 100% { transform: scaleY(0.74); }
  50% { transform: scaleY(1); }
}

@keyframes svgNotifyBob {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.9; }
  50% { transform: translateY(-3px) scale(1.08); opacity: 1; }
}

@keyframes gastoRowPulse {
  0%, 28%, 100% {
    opacity: 0.92;
    transform: translateY(0) scale(1);
  }
  10%, 20% {
    opacity: 1;
    transform: translateY(-1px) scale(1.012);
  }
}

@keyframes gastoRowRing {
  0%, 28%, 100% { opacity: 0; }
  10%, 20% { opacity: 1; }
}

@keyframes facturaDropMove {
  0% {
    opacity: 0;
    transform: translateX(0px) translateY(4px) scale(0.96);
  }
  8%, 16% {
    opacity: 1;
    transform: translateX(0px) translateY(0px) scale(1);
  }
  42% {
    opacity: 1;
    transform: translateX(155px) translateY(-4px) scale(0.96);
  }
  58% {
    opacity: 1;
    transform: translateX(278px) translateY(1px) scale(0.92);
  }
  66%, 100% {
    opacity: 0;
    transform: translateX(292px) translateY(4px) scale(0.84);
  }
}

@keyframes folderReceivePulse {
  0%, 56%, 90%, 100% {
    transform: scale(1);
  }
  64%, 82% {
    transform: scale(1.045);
  }
}

@keyframes folderBadgePop {
  0%, 60%, 90%, 100% {
    opacity: 0;
    transform: translateY(3px) scale(0.92);
  }
  68%, 84% {
    opacity: 1;
    transform: translateY(0px) scale(1);
  }
}

.bildy-float { will-change: transform; animation: bildyFloat 4s ease-in-out infinite; }
.bildy-shadow { transform-box: fill-box; transform-origin: center; animation: bildyShadow 4s ease-in-out infinite; }
.bildy-blink { transform-box: fill-box; transform-origin: center; animation: bildyBlink 4.5s infinite; }
.bildy-pulse { transform-box: fill-box; transform-origin: center; animation: bildyPulse 2.8s ease-out infinite; }
.bildy-pulse-delay { animation-delay: 1.4s; }
.bildy-wave { transform-box: fill-box; transform-origin: right center; animation: bildyWave 2.6s ease-in-out infinite; }
.bildy-track-flow { transform-box: fill-box; transform-origin: center; will-change: transform; animation: bildyTrackFlow 24s linear infinite; }
.bildy-card-cycle-1 { transform-box: fill-box; transform-origin: center; will-change: transform; animation: bildyCardCycle 8s ease-in-out 0s infinite; }
.bildy-card-cycle-2 { transform-box: fill-box; transform-origin: center; will-change: transform; animation: bildyCardCycle 8s ease-in-out 2s infinite; }
.bildy-card-cycle-3 { transform-box: fill-box; transform-origin: center; will-change: transform; animation: bildyCardCycle 8s ease-in-out 4s infinite; }
.bildy-card-cycle-4 { transform-box: fill-box; transform-origin: center; will-change: transform; animation: bildyCardCycle 8s ease-in-out 6s infinite; }

main > section,
#modulos,
#bildy,
#calculadora,
#piloto {
  contain: layout style;
}

.anim-paused,
.anim-paused * {
  animation-play-state: paused !important;
}
.bildy-card-active-1 { animation: bildyCardActiveGlow 8s ease-in-out 0s infinite; }
.bildy-card-active-2 { animation: bildyCardActiveGlow 8s ease-in-out 2s infinite; }
.bildy-card-active-3 { animation: bildyCardActiveGlow 8s ease-in-out 4s infinite; }
.bildy-card-active-4 { animation: bildyCardActiveGlow 8s ease-in-out 6s infinite; }
.bildy-sat-1 { animation: bildyFloat 4.2s ease-in-out infinite; }
.bildy-sat-2 { animation: bildyFloat 4.2s ease-in-out 0.9s infinite; }
.bildy-sat-3 { animation: bildyFloat 4.2s ease-in-out 1.8s infinite; }

.svg-scan-line { animation: svgScanLine 3s ease-in-out infinite; }
.svg-check-pop { transform-box: fill-box; transform-origin: center; animation: svgCheckPop 3s ease-in-out infinite; }
.svg-pulse-soft { transform-box: fill-box; transform-origin: center; animation: svgPulseSoft 2.4s ease-in-out infinite; }
.svg-node-1 { transform-box: fill-box; transform-origin: center; animation: svgNodeStep 3.6s ease-in-out 0s infinite; }
.svg-node-2 { transform-box: fill-box; transform-origin: center; animation: svgNodeStep 3.6s ease-in-out 1.2s infinite; }
.svg-node-3 { transform-box: fill-box; transform-origin: center; animation: svgNodeStep 3.6s ease-in-out 2.4s infinite; }
.svg-bar-1 { transform-box: fill-box; transform-origin: bottom; animation: svgBarGrow 3s ease-in-out 0s infinite; }
.svg-bar-2 { transform-box: fill-box; transform-origin: bottom; animation: svgBarGrow 3s ease-in-out 0.35s infinite; }
.svg-bar-3 { transform-box: fill-box; transform-origin: bottom; animation: svgBarGrow 3s ease-in-out 0.7s infinite; }
.svg-notify-bob { transform-box: fill-box; transform-origin: center; animation: svgNotifyBob 2.6s ease-in-out infinite; }
.gasto-row-1 { will-change: transform, opacity; animation: gastoRowPulse 5.4s ease-in-out 0s infinite; }
.gasto-row-2 { will-change: transform, opacity; animation: gastoRowPulse 5.4s ease-in-out 1.8s infinite; }
.gasto-row-3 { will-change: transform, opacity; animation: gastoRowPulse 5.4s ease-in-out 3.6s infinite; }
.gasto-row-ring-1 { animation: gastoRowRing 5.4s ease-in-out 0s infinite; }
.gasto-row-ring-2 { animation: gastoRowRing 5.4s ease-in-out 1.8s infinite; }
.gasto-row-ring-3 { animation: gastoRowRing 5.4s ease-in-out 3.6s infinite; }
.factura-drop-move { transform-box: fill-box; transform-origin: center; will-change: transform, opacity; animation: facturaDropMove 5.4s ease-in-out infinite; }
.folder-receive-pulse { transform-box: fill-box; transform-origin: center; will-change: transform; animation: folderReceivePulse 5.4s ease-in-out infinite; }
.folder-badge-pop { transform-box: fill-box; transform-origin: center; will-change: transform, opacity; animation: folderBadgePop 5.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .bildy-float,
  .bildy-shadow,
  .bildy-blink,
  .bildy-pulse,
  .bildy-pulse-delay,
  .bildy-wave,
  .bildy-track-flow,
  .bildy-card-cycle-1,
  .bildy-card-cycle-2,
  .bildy-card-cycle-3,
  .bildy-card-cycle-4,
  .bildy-card-active-1,
  .bildy-card-active-2,
  .bildy-card-active-3,
  .bildy-card-active-4,
  .bildy-sat-1,
  .bildy-sat-2,
  .bildy-sat-3,
  .svg-scan-line,
  .svg-check-pop,
  .svg-pulse-soft,
  .svg-node-1,
  .svg-node-2,
  .svg-node-3,
  .svg-bar-1,
  .svg-bar-2,
  .svg-bar-3,
  .svg-notify-bob,
  .gasto-row-1,
  .gasto-row-2,
  .gasto-row-3,
  .gasto-row-ring-1,
  .gasto-row-ring-2,
  .gasto-row-ring-3,
  .factura-drop-move,
  .folder-receive-pulse,
  .folder-badge-pop,
  .status-dot-active {
    animation: none !important;
    transition: none !important;
  }
}
