/* ==========================================================================
   SmartScan design tokens (v2, audit 2026-11, wave 2)
   Reference: shadcn/ui conventions — neutral base, one accent, thin borders,
   shadows only for floating layers. Mobile-first.

   Naming: --c-* colors, --sp-* spacing, --fs-* font sizes, --r-* radii.
   Deliberately different from the legacy names in style.css (--bg, --accent…)
   so both can live on one page while pages move over one by one.

   Breakpoints (CSS vars can't be used in media queries — use these numbers):
     sm 640px · md 768px · lg 1024px · xl 1280px   (always min-width)
   ========================================================================== */

:root {
  /* ── Color: light ─────────────────────────────────────────────────────── */
  --c-bg:            #ffffff;
  --c-bg-subtle:     #f8fafc;   /* page sections, table header */
  --c-surface:       #ffffff;   /* cards */
  --c-muted:         #f1f5f9;   /* chips, inputs on subtle bg, hover */
  --c-border:        #e2e8f0;
  --c-border-strong: #cbd5e1;   /* inputs */
  --c-text:          #0f172a;
  --c-text-muted:    #64748b;   /* 4.8:1 on white */
  --c-text-subtle:   #94a3b8;   /* placeholders, disabled — not for body text */

  /* Brand teal. teal-600 (#0d9488) fails AA with white text, so solid
     buttons use teal-700; teal-600 stays for icons and accents. */
  --c-primary:        #0f766e;  /* 5.5:1 with white */
  --c-primary-hover:  #115e59;
  --c-primary-fg:     #ffffff;
  --c-primary-soft:   #f0fdfa;  /* selected chip, info bg */
  --c-primary-border: #99f6e4;
  --c-accent:         #0d9488;  /* icons, links on hover, focus ring base */

  --c-success:      #15803d;  --c-success-soft: #f0fdf4;
  --c-warning:      #b45309;  --c-warning-soft: #fffbeb;
  --c-danger:       #dc2626;  --c-danger-soft:  #fef2f2;
  --c-info:         #2563eb;  --c-info-soft:    #eff6ff;

  --c-ring: rgba(13, 148, 136, 0.35);
  --c-overlay: rgba(15, 23, 42, 0.5);

  /* ── Typography ───────────────────────────────────────────────────────── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  /* The whole scale — nothing in between. */
  --fs-xs:   12px;   /* captions, badges */
  --fs-sm:   14px;   /* secondary text, table cells, buttons */
  --fs-base: 16px;   /* body, inputs (16px = no iOS zoom) */
  --fs-lg:   18px;   /* lead paragraph */
  --fs-xl:   20px;   /* card title, h3 */
  --fs-2xl:  24px;   /* h2 mobile */
  --fs-3xl:  30px;   /* h1 mobile, h2 desktop */
  --fs-4xl:  36px;   /* h1 desktop */

  --lh-tight: 1.2;   /* headings */
  --lh-snug:  1.4;   /* UI text */
  --lh-body:  1.6;   /* paragraphs */

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;

  /* ── Spacing: 4px grid ────────────────────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;   /* mobile page gutter */
  --sp-5: 20px;
  --sp-6: 24px;   /* desktop gutter, card padding desktop */
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;  /* section gap mobile */
  --sp-16: 64px;  /* section gap desktop */

  /* ── Shape & depth ────────────────────────────────────────────────────── */
  --r-sm:   6px;    /* badges, small chips */
  --r-md:   8px;    /* buttons, inputs */
  --r-lg:   12px;   /* cards */
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);   /* popovers, sheets */

  /* ── Sizing ───────────────────────────────────────────────────────────── */
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;   /* primary CTA on mobile */
  --tap-min:    44px;   /* any tappable element on touch */
  --container:  1120px;
  --container-narrow: 720px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur:  150ms;

  color-scheme: light;
}

[data-theme="dark"] {
  --c-bg:            #0a0b0d;
  --c-bg-subtle:     #101216;
  --c-surface:       #14161b;
  --c-muted:         #1c1f26;
  --c-border:        #262a33;
  --c-border-strong: #353a45;
  --c-text:          #f4f5f7;
  --c-text-muted:    #9aa3b2;
  --c-text-subtle:   #646c7a;

  --c-primary:        #2dd4bf;
  --c-primary-hover:  #5eead4;
  --c-primary-fg:     #042f2e;
  --c-primary-soft:   rgba(45, 212, 191, 0.10);
  --c-primary-border: rgba(45, 212, 191, 0.35);
  --c-accent:         #2dd4bf;

  --c-success: #4ade80;  --c-success-soft: rgba(74, 222, 128, 0.10);
  --c-warning: #fbbf24;  --c-warning-soft: rgba(251, 191, 36, 0.10);
  --c-danger:  #f87171;  --c-danger-soft:  rgba(248, 113, 113, 0.10);
  --c-info:    #60a5fa;  --c-info-soft:    rgba(96, 165, 250, 0.10);

  --c-ring: rgba(45, 212, 191, 0.40);
  --c-overlay: rgba(0, 0, 0, 0.65);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}
