/*
  Verapay design tokens — the single source of colour, shadow and motion for
  every screen. Components (app.css) use these, never raw colours.

  Each colour is defined twice: a hex value for direct CSS/SVG use and an
  "R G B" triple so Tailwind opacity modifiers (bg-brand/40) work. Keep both
  in step. Text/fill pairs are chosen for WCAG AA contrast.

  The dark theme applies only where the app shell sets data-theme="dark" on
  <html>; public pages (sign-in, checkout) never do, so they stay light.
*/

:root {
  color-scheme: light;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --color-text-primary: #0e1a2f;
  --color-text-primary-rgb: 14 26 47;
  --color-text-secondary: #56627a;
  --color-text-secondary-rgb: 86 98 122;
  --color-text-tertiary: #1e5fd0;
  --color-text-tertiary-rgb: 30 95 208;
  --color-text-inverse: #f4f7ff;
  --color-text-inverse-rgb: 244 247 255;

  --color-surface-base: #f4f6fa;
  --color-surface-base-rgb: 244 246 250;
  --color-surface-muted: #f7f9fc;
  --color-surface-muted-rgb: 247 249 252;
  --color-surface-raised: #ffffff;
  --color-surface-raised-rgb: 255 255 255;
  --color-surface-strong: #0e1a2f;
  --color-surface-strong-rgb: 14 26 47;

  --color-border-default: #e4e9f1;
  --color-border-default-rgb: 228 233 241;
  --color-border-strong: #cbd3e1;
  --color-border-strong-rgb: 203 211 225;

  --color-brand: #1e5fd0;
  --color-brand-rgb: 30 95 208;
  --color-brand-emphasis: #174ba8;
  --color-brand-emphasis-rgb: 23 75 168;
  --color-brand-muted: #eaf1fd;
  --color-brand-muted-rgb: 234 241 253;
  --color-accent: #0ea5c6;
  --color-accent-rgb: 14 165 198;
  --gradient-aurora: linear-gradient(135deg, #0b1730 0%, #14356e 55%, #1e5fd0 100%);

  --color-success: #0f7236;
  --color-success-rgb: 15 114 54;
  --color-success-bg: #e5f5ea;
  --color-danger: #b4232f;
  --color-danger-rgb: 180 35 47;
  --color-danger-bg: #fdeaec;
  --color-warning: #855700;
  --color-warning-rgb: 133 87 0;
  --color-warning-bg: #fff2d3;
  --color-info: #0b6780;
  --color-info-rgb: 11 103 128;
  --color-info-bg: #e0f3f9;
  --color-neutral: #4b5873;
  --color-neutral-rgb: 75 88 115;
  --color-neutral-bg: #eef1f6;

  /* Chart series: PayIn, PayOut. */
  --series-1: #2a78d6;
  --series-2: #eb6834;

  /* Heatmap: one blue hue, more is further from the surface. */
  --heat-0: #eef1f6;
  --heat-1: #86b6ef;
  --heat-2: #5598e7;
  --heat-3: #2a78d6;
  --heat-4: #1c5cab;
  --heat-5: #104281;

  /* Sidebar stays dark in both themes. */
  --color-nav: #0b1730;
  --color-nav-ink: #a9b7d3;
  --color-nav-muted: #7c8db0;
  --nav-width: 15.25rem;

  --shadow-card: 0 12px 32px -8px rgb(14 26 47 / 0.18);
  --shadow-soft: 0 1px 2px rgb(14 26 47 / 0.04), 0 6px 20px -12px rgb(14 26 47 / 0.16);

  --duration-instant: 150ms;
  --duration-fast: 220ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --color-text-primary: #e9eef8;
  --color-text-primary-rgb: 233 238 248;
  --color-text-secondary: #a6b4ce;
  --color-text-secondary-rgb: 166 180 206;
  --color-text-tertiary: #8ab6ff;
  --color-text-tertiary-rgb: 138 182 255;

  --color-surface-base: #0b111c;
  --color-surface-base-rgb: 11 17 28;
  --color-surface-muted: #182235;
  --color-surface-muted-rgb: 24 34 53;
  --color-surface-raised: #131b2a;
  --color-surface-raised-rgb: 19 27 42;
  --color-surface-strong: #060b14;
  --color-surface-strong-rgb: 6 11 20;

  --color-border-default: #243149;
  --color-border-default-rgb: 36 49 73;
  --color-border-strong: #354769;
  --color-border-strong-rgb: 53 71 105;

  --color-brand: #3a76e0;
  --color-brand-rgb: 58 118 224;
  --color-brand-emphasis: #2f64c4;
  --color-brand-emphasis-rgb: 47 100 196;
  --color-brand-muted: #1a2b4b;
  --color-brand-muted-rgb: 26 43 75;

  --color-success: #62d389;
  --color-success-rgb: 98 211 137;
  --color-success-bg: #102e20;
  --color-danger: #ff8d96;
  --color-danger-rgb: 255 141 150;
  --color-danger-bg: #37171d;
  --color-warning: #f7c04a;
  --color-warning-rgb: 247 192 74;
  --color-warning-bg: #33270c;
  --color-info: #66d1ec;
  --color-info-rgb: 102 209 236;
  --color-info-bg: #0d2c37;
  --color-neutral: #b3bfd6;
  --color-neutral-rgb: 179 191 214;
  --color-neutral-bg: #212c43;

  --series-1: #3987e5;
  --series-2: #d95926;
  --heat-0: #1d283d;
  --heat-1: #184f95;
  --heat-2: #256abf;
  --heat-3: #3987e5;
  --heat-4: #6da7ec;
  --heat-5: #b7d3f6;
  --color-nav: #070d19;

  --shadow-card: 0 16px 40px -8px rgb(0 0 0 / 0.6);
  --shadow-soft: none;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
  }
}
