/* ============================================================================
   NEXUS — Design Tokens
   Fuente única de verdad del lenguaje visual. Se consume en:
   - design/mockups/*.html  (prototipo estático)
   - apps/web, apps/admin   (tailwind.config.js -> theme.extend)
   - apps/mobile            (lib/core/theme/app_theme.dart, ColorScheme)
   Capas: primitivo -> semántico -> componente.
   ========================================================================= */

:root {
  /* ---------- 1. PRIMITIVOS: paleta cruda ---------- */
  --violet-300:#c4b5fd; --violet-400:#a78bfa; --violet-500:#8b5cf6;
  --violet-600:#7c3aed; --violet-700:#6d28d9; --violet-900:#4c1d95;

  --cyan-300:#67e8f9;  --cyan-400:#22d3ee;  --cyan-500:#06b6d4;
  --cyan-600:#0891b2;

  --ink-950:#05060f;   /* fondo base, casi negro azulado */
  --ink-900:#0a0b1a;
  --ink-850:#0e1024;
  --ink-800:#141732;
  --ink-700:#1d2143;
  --ink-600:#2a2f5c;

  --slate-100:#f1f5f9; --slate-300:#cbd5e1; --slate-400:#94a3b8; --slate-500:#64748b;

  --lime-400:#a3e635;  --amber-400:#fbbf24;
  --rose-500:#f43f5e;  --emerald-400:#34d399;

  /* ---------- 2. SEMÁNTICOS ---------- */
  --bg:               var(--ink-950);
  --bg-elevated:      var(--ink-900);
  --surface:          rgba(20, 23, 50, 0.55);   /* base glassmorphism */
  --surface-strong:   rgba(20, 23, 50, 0.85);
  --surface-hover:    rgba(42, 47, 92, 0.65);
  --border:           rgba(148, 163, 184, 0.14);
  --border-strong:    rgba(167, 139, 250, 0.38);

  --text:             var(--slate-100);
  --text-muted:       var(--slate-400);
  --text-dim:         var(--slate-500);

  --primary:          var(--violet-600);
  --primary-hover:    var(--violet-500);
  --accent:           var(--cyan-400);
  --on-primary:       #ffffff;

  --success: var(--emerald-400);
  --warning: var(--amber-400);
  --danger:  var(--rose-500);
  --info:    var(--cyan-400);

  /* ---------- 3. GRADIENTES ELÉCTRICOS ---------- */
  --grad-primary:  linear-gradient(135deg, #7c3aed 0%, #22d3ee 100%);
  --grad-primary-soft: linear-gradient(135deg, rgba(124,58,237,.22) 0%, rgba(34,211,238,.18) 100%);
  --grad-hero:     radial-gradient(1200px 600px at 15% -10%, rgba(124,58,237,.45) 0%, transparent 60%),
                   radial-gradient(900px 500px at 95% 10%, rgba(34,211,238,.28) 0%, transparent 60%),
                   linear-gradient(180deg, #05060f 0%, #0a0b1a 100%);
  --grad-text:     linear-gradient(100deg, #c4b5fd 0%, #67e8f9 55%, #a78bfa 100%);
  --grad-border:   linear-gradient(135deg, rgba(167,139,250,.75), rgba(34,211,238,.45), rgba(167,139,250,.1));

  /* ---------- 4. GLASS / ELEVACIÓN ---------- */
  --blur-glass: 18px;
  --blur-nav:   24px;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
  --shadow-md:  0 8px 24px -6px rgba(0,0,0,.55);
  --shadow-lg:  0 24px 60px -16px rgba(0,0,0,.7);
  --shadow-glow-violet: 0 0 0 1px rgba(167,139,250,.25), 0 18px 50px -14px rgba(124,58,237,.55);
  --shadow-glow-cyan:   0 0 0 1px rgba(34,211,238,.25),  0 18px 50px -14px rgba(6,182,212,.45);

  /* ---------- 5. TIPOGRAFÍA ---------- */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-xs:.75rem;  --fs-sm:.875rem; --fs-base:1rem;  --fs-lg:1.125rem;
  --fs-xl:1.375rem; --fs-2xl:1.75rem; --fs-3xl:2.25rem;
  --fs-display: clamp(2.5rem, 6vw, 4.5rem);

  --lh-tight:1.1; --lh-snug:1.3; --lh-normal:1.6;
  --tracking-tight:-.02em; --tracking-wide:.08em;

  /* ---------- 6. ESPACIADO (escala 4px) ---------- */
  --s-1:.25rem; --s-2:.5rem;  --s-3:.75rem; --s-4:1rem;   --s-5:1.25rem;
  --s-6:1.5rem; --s-8:2rem;   --s-10:2.5rem; --s-12:3rem; --s-16:4rem; --s-20:5rem;

  /* ---------- 7. RADIOS ---------- */
  --r-sm:8px; --r-md:12px; --r-lg:18px; --r-xl:24px; --r-2xl:32px; --r-full:999px;

  /* ---------- 8. MOVIMIENTO ---------- */
  --dur-fast:140ms; --dur-base:240ms; --dur-slow:420ms; --dur-hero:900ms;
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  /* ---------- 9. LAYOUT ---------- */
  --container: 1280px;
  --nav-h: 72px;
  --admin-sidebar: 264px;
  --z-nav:100; --z-drawer:200; --z-modal:300; --z-toast:400;
}

/* Accesibilidad: respetar preferencia de movimiento reducido. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important;
  }
}

/* El requerimiento fija dark mode como experiencia principal; se expone un
   tema claro mínimo para cumplir contraste en entornos de alta luminosidad. */
:root[data-theme="light"] {
  --bg:#f6f7fb; --bg-elevated:#ffffff;
  --surface: rgba(255,255,255,.72); --surface-strong: rgba(255,255,255,.92);
  --surface-hover: rgba(124,58,237,.07);
  --border: rgba(15,23,42,.1); --border-strong: rgba(124,58,237,.35);
  --text:#0f172a; --text-muted:#475569; --text-dim:#64748b;
  --grad-hero: radial-gradient(1000px 500px at 10% -10%, rgba(124,58,237,.18) 0%, transparent 60%),
               linear-gradient(180deg,#f6f7fb 0%,#eef1f8 100%);
}
