/* ========== factoIA — Premium Design System v2 ========== */
/* Intelligent Financial Management for Chilean SMBs       */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== 1. CSS VARIABLES ===== */
:root {
  /* Backgrounds */
  --bg-deep: #050510;
  --bg-primary: #0a0a1a;
  --bg-secondary: #0f1225;
  --bg-card: #121430;
  --bg-card-hover: #181a3e;
  --bg-glass: rgba(18, 20, 48, 0.6);
  --bg-glass-light: rgba(255,255,255,0.03);
  --bg-glass-border: rgba(255,255,255,0.06);

  /* Accent colors */
  --violet: #7c3aed;
  --violet-light: #a78bfa;
  --violet-dark: #6d28d9;
  --violet-glow: rgba(124, 58, 237, 0.3);
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --cyan-dark: #0891b2;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-dark: #059669;
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --blue: #3b82f6;
  --blue-light: #60a5fa;

  /* Aliases (backward compat with JS inline styles) */
  --green: #10b981;
  --green-light: #34d399;
  --red: #ef4444;
  --red-light: #fb7185;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: var(--violet-light);

  /* Borders */
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --border-active: rgba(124, 58, 237, 0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow-v: 0 0 40px rgba(124, 58, 237, 0.15);
  --shadow-glow-c: 0 0 40px rgba(6, 182, 212, 0.15);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --t-fast: 150ms;
  --t-normal: 250ms;
  --t-slow: 400ms;

  /* Z-index */
  --z-sidebar: 50;
  --z-chat: 80;
  --z-modal: 100;
  --z-toast: 200;
  --z-nav: 90;
}

/* ===== 2. RESET & BASE ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }

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

a { color: var(--cyan-light); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--cyan); }

button { cursor:pointer; font-family:inherit; }

input, select, textarea {
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--t-normal) var(--ease);
  width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow), inset 0 0 0 1px var(--violet);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

img { max-width:100%; height:auto; display:block; }

::selection { background: var(--violet); color: white; }

/* ===== 3. KEYFRAME ANIMATIONS ===== */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeInUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeInDown { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeInLeft { from { opacity:0; transform:translateX(-30px); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeInRight { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
@keyframes scaleIn { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }
@keyframes slideIn { from { transform:translateX(100%); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }

@keyframes float {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-12px); }
}
@keyframes floatSlow {
  0%,100% { transform:translateY(0) rotate(0deg); }
  50% { transform:translateY(-8px) rotate(1deg); }
}

@keyframes shimmer {
  0% { background-position:-200% 0; }
  100% { background-position:200% 0; }
}

@keyframes gradientShift {
  0% { background-position:0% 50%; }
  50% { background-position:100% 50%; }
  100% { background-position:0% 50%; }
}

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes pulseSoft { 0%,100% { opacity:0.6; } 50% { opacity:1; } }
@keyframes pulseGlow {
  0%,100% { box-shadow:0 0 20px var(--violet-glow); }
  50% { box-shadow:0 0 40px var(--violet-glow), 0 0 80px rgba(124,58,237,0.1); }
}

@keyframes spin { to { transform:rotate(360deg); } }

@keyframes typing {
  from { width:0; }
  to { width:100%; }
}

@keyframes blink {
  0%,100% { border-color:var(--violet); }
  50% { border-color:transparent; }
}

@keyframes borderGlow {
  0%,100% { border-color:rgba(124,58,237,0.2); }
  50% { border-color:rgba(124,58,237,0.5); }
}

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

@keyframes gridPulse {
  0%,100% { opacity:0.03; }
  50% { opacity:0.06; }
}

@keyframes orbFloat1 {
  0%,100% { transform:translate(0,0) scale(1); }
  33% { transform:translate(30px,-20px) scale(1.05); }
  66% { transform:translate(-15px,15px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%,100% { transform:translate(0,0) scale(1); }
  33% { transform:translate(-25px,20px) scale(0.95); }
  66% { transform:translate(20px,-15px) scale(1.05); }
}

@keyframes revealLine {
  from { width:0; }
  to { width:60px; }
}

@keyframes dashPulse {
  0%,100% { stroke-dashoffset:0; }
  50% { stroke-dashoffset:10; }
}

/* ===== 4. UTILITY / SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-left.visible { opacity:1; transform:translateX(0); }
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-right.visible { opacity:1; transform:translateX(0); }
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease-bounce);
}
.reveal-scale.visible { opacity:1; transform:scale(1); }

.delay-100 { transition-delay:100ms !important; }
.delay-200 { transition-delay:200ms !important; }
.delay-300 { transition-delay:300ms !important; }
.delay-400 { transition-delay:400ms !important; }
.delay-500 { transition-delay:500ms !important; }

/* Glass morphism */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
}
.glass-light {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--violet-light), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-warm {
  background: linear-gradient(135deg, var(--amber-light), var(--rose-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ===== 5. NAVIGATION (Landing) ===== */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--t-slow) var(--ease);
}
.landing-nav.scrolled {
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
}

.nav-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo .facto { color: var(--text-primary); }
.nav-logo .ia {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 20px var(--violet-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  border-radius: 1px;
  transition: width var(--t-normal) var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 101;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s var(--ease);
}
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(5, 5, 16, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease);
}
.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}
.mobile-nav-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(20px);
  transition: transform 0.4s var(--ease);
}
.mobile-nav-overlay.active .mobile-nav-panel {
  transform: translateY(0);
}
.mobile-nav-link {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 14px 32px;
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
}
.mobile-nav-link:hover {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.08);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== 6. BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-normal) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: width 0.5s, height 0.5s, top 0.5s, left 0.5s;
}
.btn:active::after {
  width: 300px; height: 300px;
  top: calc(50% - 150px);
  left: calc(50% - 150px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: white;
  box-shadow: 0 4px 16px var(--violet-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--violet-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-gradient {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: white;
  box-shadow: 0 4px 16px var(--violet-glow);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--violet-glow), 0 0 60px rgba(124,58,237,0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--violet);
  background: rgba(124, 58, 237, 0.08);
  color: var(--violet-light);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-glass-light); }

.btn-success { background: var(--emerald); color: white; }
.btn-success:hover { background: var(--emerald-dark); transform: translateY(-1px); }
.btn-danger { background: var(--rose); color: white; }
.btn-danger:hover { background: #e11d48; transform: translateY(-1px); }
.btn-warning { background: var(--amber); color: #0a0a1a; }
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; border-radius: var(--radius); }
.btn-xl { padding: 18px 48px; font-size: 17px; border-radius: var(--radius); font-weight: 700; }
.btn-icon { padding: 10px; min-width: 40px; min-height: 40px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ===== 7. LANDING — Hero ===== */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 120px 32px 80px;
  overflow: hidden;
}

/* Animated background */
.hero-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(124, 58, 237, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
}
.hero-bg .grid-pattern {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 6s ease-in-out infinite;
}

/* Floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
}
.hero-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
  top: -10%; left: -5%;
  animation: orbFloat1 15s ease-in-out infinite;
}
.hero-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.12), transparent 70%);
  bottom: -5%; right: -5%;
  animation: orbFloat2 18s ease-in-out infinite;
}
.hero-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  animation: orbFloat1 20s ease-in-out infinite reverse;
}

.hero-content {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text { animation: fadeInUp 0.8s var(--ease) both; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--violet-light);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s var(--ease) both;
}
.hero-badge .pulse-dot {
  width: 8px; height: 8px;
  background: var(--emerald);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--violet-light), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
}
.hero-stat {
  text-align: left;
}
.hero-stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}
.hero-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Hero visual — floating dashboard mockup */
.hero-visual {
  position: relative;
  animation: fadeInRight 1s var(--ease) 0.3s both;
}
.hero-mockup {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow-v);
  animation: floatSlow 6s ease-in-out infinite;
  position: relative;
}
.hero-mockup::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  right: -1px; bottom: -1px;
  background: linear-gradient(135deg, var(--violet), transparent, var(--cyan));
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.3;
}

.mockup-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.mockup-dot { width:8px; height:8px; border-radius:50%; }
.mockup-dot.r { background:#ff5f57; }
.mockup-dot.y { background:#ffbd2e; }
.mockup-dot.g { background:#28c840; }

.mockup-content {
  padding: 20px;
}
.mockup-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.mockup-metric {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 14px;
  border-left: 3px solid;
}
.mockup-metric.g { border-color: var(--emerald); }
.mockup-metric.r { border-color: var(--rose); }
.mockup-metric.b { border-color: var(--blue); }
.mockup-metric.a { border-color: var(--amber); }
.mockup-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mockup-metric-value {
  font-size: 20px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
}
.mockup-chart {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  height: 120px;
  position: relative;
  overflow: hidden;
}
.mockup-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding-top: 10px;
}
.mockup-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 8px;
  transition: height 0.5s var(--ease-bounce);
}
.mockup-bar.violet { background: linear-gradient(180deg, var(--violet-light), var(--violet)); }
.mockup-bar.cyan { background: linear-gradient(180deg, var(--cyan-light), var(--cyan)); }

/* Floating elements around mockup */
.hero-float-card {
  position: absolute;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  z-index: 2;
}
.hero-float-card.top-right {
  top: -20px; right: -30px;
  animation: float 4s ease-in-out infinite;
}
.hero-float-card.bottom-left {
  bottom: 30px; left: -40px;
  animation: float 5s ease-in-out 1s infinite;
}
.float-card-icon { font-size: 20px; margin-bottom: 4px; }
.float-card-value { font-size: 16px; font-weight: 700; }
.float-card-label { font-size: 11px; color: var(--text-muted); }

/* ===== 8. LANDING — Sections shared ===== */
.landing-section {
  padding: 100px 32px;
  position: relative;
  overflow: hidden;
}
.section-container {
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--violet-light);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== 9. LANDING — Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all var(--t-slow) var(--ease);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: var(--shadow-glow-v);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}
.feature-icon.violet { background: rgba(124, 58, 237, 0.15); }
.feature-icon.cyan { background: rgba(6, 182, 212, 0.15); }
.feature-icon.emerald { background: rgba(16, 185, 129, 0.15); }
.feature-icon.amber { background: rgba(245, 158, 11, 0.15); }
.feature-icon.rose { background: rgba(244, 63, 94, 0.15); }
.feature-icon.blue { background: rgba(59, 130, 246, 0.15); }

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.feature-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--violet-light);
  font-weight: 600;
  margin-top: 16px;
}

/* ===== 10. LANDING — How it works ===== */
.steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}
.steps-container::before {
  content: '';
  position: absolute;
  top: 50px; left: 16.67%;
  width: 66.67%;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  opacity: 0.3;
}

.step-card {
  text-align: center;
  position: relative;
}
.step-number {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 30px var(--violet-glow);
}
.step-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== 11. LANDING — Dashboard Demo ===== */
.demo-section {
  background: linear-gradient(180deg, var(--bg-deep), var(--bg-secondary), var(--bg-deep));
}
.demo-container {
  max-width: 1100px;
  margin: 0 auto;
}
.demo-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(124, 58, 237, 0.08);
  position: relative;
}
.demo-frame::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2), transparent 40%, transparent 60%, rgba(6,182,212,0.2));
  border-radius: var(--radius-xl);
  z-index: -1;
}
.demo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.demo-topbar-dots { display: flex; gap: 6px; }
.demo-topbar-url {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-family: 'JetBrains Mono', monospace;
}
.demo-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 450px;
}
.demo-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.demo-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.demo-sidebar-item.active {
  background: var(--violet);
  color: white;
}
.demo-sidebar-item .icon { font-size: 16px; width: 20px; text-align: center; }
.demo-main {
  padding: 24px;
}
.demo-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.demo-metric-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  border-left: 3px solid;
}
.demo-metric-card.g { border-color: var(--emerald); }
.demo-metric-card.r { border-color: var(--rose); }
.demo-metric-card.b { border-color: var(--blue); }
.demo-metric-card.a { border-color: var(--amber); }
.demo-metric-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.demo-metric-value { font-size: 22px; font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-top: 4px; }
.demo-metric-change { font-size: 11px; margin-top: 2px; }
.demo-metric-change.up { color: var(--emerald); }
.demo-metric-change.down { color: var(--rose); }

.demo-charts-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}
.demo-chart-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.demo-chart-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* ===== 12. LANDING — AI Chat Demo ===== */
.chat-demo-section {
  position: relative;
}
.chat-demo-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(124, 58, 237, 0.06), transparent);
}

.chat-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.chat-demo-text h3 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.chat-demo-text p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.chat-demo-features {
  list-style: none;
}
.chat-demo-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-secondary);
}
.chat-demo-features .check {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
  font-size: 14px;
  flex-shrink: 0;
}

.chat-demo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow-v);
  max-width: 420px;
  margin-left: auto;
}
.chat-demo-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--violet-dark), #1e1145);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-demo-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.chat-demo-header-info h4 { font-size: 15px; font-weight: 600; }
.chat-demo-header-info span { font-size: 12px; color: rgba(255,255,255,0.5); }

.chat-demo-messages {
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
  animation: fadeInUp 0.4s var(--ease) both;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--violet);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-demo-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.chat-demo-input input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 13px;
}
.chat-demo-input button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--violet);
  color: white;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.chat-demo-input button:hover { background: var(--violet-dark); transform: scale(1.05); }

/* ===== 13. LANDING — Social Proof / Testimonials ===== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.testimonial-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--t-slow) var(--ease);
}
.testimonial-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.2);
}
.testimonial-stars { color: var(--amber); margin-bottom: 16px; font-size: 16px; letter-spacing: 2px; }
.testimonial-text { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; font-style: italic; }
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}
.testimonial-name { font-size: 14px; font-weight: 600; }
.testimonial-role { font-size: 12px; color: var(--text-muted); }

/* ===== 13b. LANDING — Photo Sections ===== */
.hero-photo-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  overflow: hidden;
}
.hero-photo-overlay img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.07;
  filter: saturate(0.6) brightness(0.5);
}

.section-photo {
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.section-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.section-photo:hover img {
  transform: scale(1.03);
}
.section-photo .photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 24px;
  background: linear-gradient(to top, rgba(5,5,16,0.9), transparent);
}
.section-photo .photo-overlay span {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.before-after {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 48px;
}
.before-after-card {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bg-glass-border);
}
.before-after-card img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  filter: grayscale(0.3);
}
.before-after-card h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.before-after-card p {
  font-size: 13px;
  color: var(--text-muted);
}
.before-after-arrow {
  font-size: 32px;
  color: var(--violet-light);
  animation: pulse 2s ease-in-out infinite;
}

.testimonial-photo {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.cta-bg-photo {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  overflow: hidden;
}
.cta-bg-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.06;
  filter: saturate(0.3) brightness(0.4);
}

/* Photo reveal animation */
.photo-reveal {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.8s var(--ease);
}
.photo-reveal.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== 14. LANDING — CTA ===== */
.cta-section {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse 50% 60% at 50% 50%, rgba(124, 58, 237, 0.1), transparent);
  z-index: 1;
}
.cta-content {
  position: relative;
  z-index: 2;
}
.cta-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.cta-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 15. LANDING — Footer ===== */
.landing-footer {
  padding: 60px 32px 32px;
  border-top: 1px solid var(--border);
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .nav-logo { margin-bottom: 12px; }
.footer-brand p { font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 280px; }
.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 16. AUTH MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 460px;
  width: 92%;
  box-shadow: var(--shadow-lg), var(--shadow-glow-v);
  position: relative;
  animation: scaleIn 0.3s var(--ease-bounce) both;
}
.modal h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}
.modal .modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-glass-light); }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== 17. DASHBOARD — Layout ===== */
.dashboard-container { display: flex; min-height: 100vh; background: var(--bg-deep); }

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: var(--z-sidebar);
  transition: width var(--t-slow) var(--ease);
}
.sidebar.collapsed { width: 72px; }

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--violet-glow);
}
.sidebar-header .logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-normal);
}
.sidebar-header .logo-text .facto { color: var(--text-primary); }
.sidebar-header .logo-text .ia { color: var(--violet-light); }
.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 12px 6px;
}
.sidebar.collapsed .nav-section-label { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.1));
  color: white;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--violet);
  border-radius: 0 2px 2px 0;
}
.nav-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.nav-item .nav-label {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-normal);
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: rgba(255,255,255,0.03); }
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }
.sidebar.collapsed .sidebar-user-info { display: none; }

.sidebar-toggle {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 18px;
  transition: all var(--t-fast);
  margin-top: 8px;
}
.sidebar-toggle:hover { background: rgba(124, 58, 237, 0.08); border-color: var(--border-light); }

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 28px;
  min-height: 100vh;
  transition: margin-left var(--t-slow) var(--ease);
}
.sidebar.collapsed ~ .main-content { margin-left: 72px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-header-actions { display: flex; gap: 10px; }

/* ===== 18. DASHBOARD — Metric Cards ===== */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-normal) var(--ease);
}
.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
}
.metric-card.green::before { background: linear-gradient(90deg, var(--emerald), var(--emerald-light)); }
.metric-card.red::before { background: linear-gradient(90deg, var(--rose), var(--rose-light)); }
.metric-card.blue::before { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.metric-card.amber::before { background: linear-gradient(90deg, var(--amber), var(--amber-light)); }

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.metric-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.metric-card.green .metric-icon { background: rgba(16, 185, 129, 0.12); }
.metric-card.red .metric-icon { background: rgba(244, 63, 94, 0.12); }
.metric-card.blue .metric-icon { background: rgba(59, 130, 246, 0.12); }
.metric-card.amber .metric-icon { background: rgba(245, 158, 11, 0.12); }

.metric-value {
  font-size: 28px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.metric-label {
  font-size: 13px;
  color: var(--text-muted);
}
.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.metric-change.up {
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.1);
}
.metric-change.down {
  color: var(--rose);
  background: rgba(244, 63, 94, 0.1);
}

/* ===== 19. DASHBOARD — Charts ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--t-normal) var(--ease);
}
.chart-card:hover { border-color: var(--border-light); }
.chart-card h3 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* ===== 20. DASHBOARD — Progress Bar ===== */
.progress-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.progress-header h3 { font-size: 14px; font-weight: 600; }
.progress-header .progress-pct {
  font-size: 14px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--violet-light);
}
.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 1s var(--ease);
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s linear infinite;
  background-size: 200% 100%;
}

/* ===== 21. DASHBOARD — Tables ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all var(--t-normal) var(--ease);
}
.card:hover { border-color: var(--border-light); }

.table-container { overflow-x: auto; border-radius: var(--radius-sm); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
}
td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
tr:hover td { background: rgba(124, 58, 237, 0.03); }
tr:last-child td { border-bottom: none; }

/* ===== 22. DASHBOARD — Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-ingreso { background: rgba(16, 185, 129, 0.12); color: var(--emerald-light); }
.badge-gasto { background: rgba(244, 63, 94, 0.12); color: var(--rose-light); }
.badge-pendiente { background: rgba(245, 158, 11, 0.12); color: var(--amber-light); }
.badge-vencida { background: rgba(244, 63, 94, 0.12); color: var(--rose-light); }
.badge-pagada { background: rgba(16, 185, 129, 0.12); color: var(--emerald-light); }
.badge-parcial { background: rgba(59, 130, 246, 0.12); color: var(--blue-light); }

/* ===== 23. DASHBOARD — Filters ===== */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}
.filters select, .filters input {
  width: auto;
  min-width: 150px;
  font-size: 13px;
  padding: 10px 14px;
}
.filters .search-input {
  min-width: 220px;
}

/* ===== 24. DASHBOARD — Tabs ===== */
.tab-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}
.tab-btn {
  padding: 8px 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  transition: all var(--t-fast) var(--ease);
}
.tab-btn.active {
  background: var(--violet);
  color: white;
  box-shadow: 0 2px 8px var(--violet-glow);
}
.tab-btn:hover:not(.active) { color: var(--text-primary); background: var(--bg-glass-light); }

.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s var(--ease); }

/* ===== 25. FACTO CHAT ===== */
.flux-toggle {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border: none;
  color: white;
  font-size: 26px;
  z-index: var(--z-chat);
  box-shadow: 0 4px 24px var(--violet-glow);
  transition: all var(--t-normal) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseGlow 3s ease-in-out infinite;
}
.flux-toggle:hover { transform: scale(1.1); box-shadow: 0 8px 32px var(--violet-glow); }

.flux-panel {
  position: fixed;
  bottom: 96px; right: 24px;
  width: 400px;
  height: 560px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow-v);
  display: none;
  flex-direction: column;
  z-index: var(--z-chat);
  overflow: hidden;
  animation: fadeInUp 0.3s var(--ease-bounce) both;
}
.flux-panel.active { display: flex; }

.flux-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--violet-dark), #1e1145);
  display: flex;
  align-items: center;
  gap: 12px;
}
.flux-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: pulse 3s ease-in-out infinite;
}
.flux-header-info h4 { font-size: 15px; font-weight: 700; }
.flux-header-info span { font-size: 12px; color: rgba(255,255,255,0.5); }
.flux-header-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.flux-header-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s ease-in-out infinite;
}

.flux-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.flux-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  animation: fadeInUp 0.3s var(--ease) both;
}
.flux-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: white;
  border-bottom-right-radius: 4px;
}
.flux-msg.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.flux-msg .suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.flux-msg .suggestion-btn {
  padding: 5px 12px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-full);
  color: var(--violet-light);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.flux-msg .suggestion-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: var(--violet);
  transform: translateY(-1px);
}

.flux-input-area {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-card);
}
.flux-input {
  flex: 1;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 13px;
}
.flux-input:focus { border-color: var(--violet); outline: none; }

.flux-send, .flux-mic {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--t-fast) var(--ease);
  flex-shrink: 0;
}
.flux-send { background: var(--violet); color: white; }
.flux-send:hover { background: var(--violet-dark); transform: scale(1.05); }
.flux-mic { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); }
.flux-mic:hover { border-color: var(--rose); color: var(--rose); }
.flux-mic.recording {
  background: var(--rose); color: white; border-color: var(--rose);
  animation: pulse 1s infinite;
}

/* ===== 26. ALERTS, TOASTS, LOADING ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-info { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.15); color: var(--blue-light); }
.alert-success { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.15); color: var(--emerald-light); }
.alert-warning { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.15); color: var(--amber-light); }
.alert-error { background: rgba(244, 63, 94, 0.08); border: 1px solid rgba(244, 63, 94, 0.15); color: var(--rose-light); }

.flux-suggestion-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.flux-suggestion-card .suggestion-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.flux-suggestion-card .suggestion-text {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}
.flux-suggestion-card .suggestion-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--violet-light);
  cursor: pointer;
  white-space: nowrap;
}
.flux-suggestion-card .suggestion-action:hover { color: var(--violet); }

.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.4s var(--ease-bounce);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(12px);
}
.toast-success { background: rgba(16, 185, 129, 0.9); color: white; }
.toast-error { background: rgba(244, 63, 94, 0.9); color: white; }
.toast-info { background: rgba(59, 130, 246, 0.9); color: white; }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-sm);
}

/* ===== 27. EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 56px;
  margin-bottom: 20px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}
.empty-state p {
  font-size: 15px;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ===== 28. RESPONSIVE ===== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 60;
  width: 38px; height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.mobile-menu-btn:hover { background: var(--bg-card-hover); }

@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero-text { order: 1; }
  .hero-visual { order: 2; max-width: 500px; margin: 0 auto; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-float-card { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-container { grid-template-columns: 1fr; gap: 24px; }
  .steps-container::before { display: none; }
  .before-after { grid-template-columns: 1fr; gap: 16px; }
  .before-after-arrow { transform: rotate(90deg); }
  .chat-demo-grid { grid-template-columns: 1fr; gap: 40px; }
  .chat-demo-panel { margin: 0 auto; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: repeat(2, 1fr); }
  .demo-metrics-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .landing-nav { padding: 12px 20px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: flex !important; }
  .hero { padding: 100px 20px 60px; }
  .hero-title { font-size: 32px; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
  .landing-section { padding: 60px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .demo-body { grid-template-columns: 1fr; }
  .demo-sidebar { display: none; }
  .demo-metrics-row { grid-template-columns: 1fr 1fr; }
  .demo-charts-row { grid-template-columns: 1fr; }

  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding: 12px 16px 20px; max-width: 100vw; overflow-x: hidden; }
  .page-header h1 { margin-left: 44px; }
  .mobile-menu-btn { display: flex !important; }
  .charts-grid { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .flux-panel { width: calc(100% - 16px); right: 8px; bottom: 80px; height: 65vh; }
  .modal { width: 95%; padding: 28px; }
  .filters { flex-direction: column; }
  .filters select, .filters input { width: 100%; min-width: auto; }
  .footer-content { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
  .hero { padding: 90px 16px 50px; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 16px; }
  .metric-cards { grid-template-columns: 1fr; gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 24px; }
  .page-header h1 { font-size: 22px; }
  .main-content { padding: 16px 12px !important; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .demo-metrics-row { grid-template-columns: 1fr; }
  .tab-btns { overflow-x: auto; width: 100%; }
}

/* ===== 29. SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== 30. PRINT ===== */
@media print {
  .sidebar, .flux-toggle, .flux-panel, .mobile-menu-btn { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; color: black; }
}
