/* ============================================================
   PulseIQ — Design Tokens
   css/design-tokens.css

   Single source of truth for all color, spacing, and radius
   variables used across the platform. Load this first on
   every page, AFTER theme.js so the data-theme attribute
   is already set before the first paint.

   Load order:
     <script src="../theme.js"></script>
     <link rel="stylesheet" href="../css/design-tokens.css">
     <link rel="stylesheet" href="../css/components.css">
     <link rel="stylesheet" href="../css/layout.css">
============================================================ */

/* ── Dark theme (default) ─────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #22263a;
  --surface3:    #2a2f47;

  /* Borders */
  --border:      #2e3350;
  --border2:     #3a4060;

  /* Brand */
  --accent:      #3b82f6;
  --accent2:     #6366f1;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --action-primary: #2563eb;
  --action-primary-hover: #1d4ed8;
  --action-primary-text: #ffffff;
  --focus-ring:  #93c5fd;

  /* Semantic */
  --green:       #22c55e;
  --green-text:  #86efac;
  --green-soft:  rgba(34, 197, 94, 0.10);
  --green-border:rgba(34, 197, 94, 0.25);
  --yellow:      #f59e0b;
  --yellow-text: #fde68a;
  --yellow-soft: rgba(245, 158, 11, 0.12);
  --yellow-border:rgba(245, 158, 11, 0.25);
  --red:         #ef4444;
  --red-text:    #fca5a5;
  --red-soft:    rgba(239, 68, 68, 0.12);
  --red-border:  rgba(239, 68, 68, 0.25);
  --purple:      #8b5cf6;
  --cyan:        #06b6d4;

  /* Text */
  --text:        #e2e8f0;
  --text-muted:  #8892a4;
  --text-dim:    #8995ae;

  /* Radius */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   18px;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg:   0 8px 40px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --transition:  0.15s ease;

  /* Z-index scale */
  --z-dropdown:  100;
  --z-modal:     200;
  --z-toast:     300;
  --z-nav:       400;
}

/* ── Light theme ──────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:          #f0f2f8;
  --surface:     #ffffff;
  --surface2:    #f4f6fb;
  --surface3:    #eaecf4;

  --border:      #dde1ed;
  --border2:     #c8cde0;

  --accent:      #1d4ed8;
  --accent2:     #4338ca;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --action-primary: #1d4ed8;
  --action-primary-hover: #1e40af;
  --focus-ring:  #1d4ed8;

  --green-soft:  rgba(34, 197, 94, 0.08);
  --green-text:  #166534;
  --yellow-soft: rgba(245, 158, 11, 0.08);
  --yellow-text: #92400e;
  --red-soft:    rgba(239, 68, 68, 0.08);
  --red-text:    #b91c1c;

  --text:        #111827;
  --text-muted:  #5a6577;
  --text-dim:    #6b7280;

  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.10);
  --shadow-lg:   0 8px 40px rgba(0, 0, 0, 0.12);
}

/* ── Base reset ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.5;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}
