/* Design tokens. Single source of truth. Components may only use var(--*).
   The light values follow the CampaignHub portal theme (CampaignHub frontend/src/index.css @theme
   and the Tailwind default scale its components use). Keep colours as `--c-name: #rrggbb;`, one per line,
   between the BEGIN/END markers. */
@layer reset, tokens, base, layout, components, utilities, overrides;

@layer tokens {
  :root {
    /* Type: the CampaignHub stack. Roboto is used when the device has it; no font is downloaded. */
    --font-sans: Roboto, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --lh-tight: 1.25;
    --lh-base: 1.5;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --tracking-caps: 0.025em;

    /* Spacing scale (4px rhythm, same steps as Tailwind) */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Radius: lg for controls, xl for cards and tables, 2xl for the main panel and sign-in card */
    --radius-1: 0.375rem;
    --radius-2: 0.5rem;
    --radius-3: 0.75rem;
    --radius-4: 1rem;
    --radius-pill: 62rem;

    /* Borders, focus, sizes */
    --border-w: 1px;
    --border-hair: 0.5px;
    --focus-w: 2px;
    --focus-offset: 2px;
    --ring-w: 3px;
    --size-control: 2.25rem;
    --size-control-sm: 2rem;
    --size-nav: 16.875rem;
    --size-header: 4rem;
    --size-content-max: 80rem;
    --size-dialog: 28rem;
    --size-auth: 64rem;
    --size-table-max: 32rem;
    --size-dot: 0.375rem;
    --size-mark: 2rem;
    --size-avatar: 2rem;
    --size-indicator: 3px;

    /* Stacking */
    --z-sticky: 10;
    --z-header: 20;
    --z-backdrop: 30;
    --z-drawer: 40;
    --z-skip: 50;

    /* Shadow (CampaignHub shadow-xs, -sm, -md, -panel) */
    --shadow-1: 0 1px 2px 0 rgb(11 26 64 / 0.05);
    --shadow-2: 0 4px 8px -2px rgb(11 26 64 / 0.1), 0 2px 4px -2px rgb(11 26 64 / 0.06);
    --shadow-3: 0 12px 24px -6px rgb(11 26 64 / 0.18), 0 4px 8px -2px rgb(11 26 64 / 0.1);
    --shadow-panel: 0 3px 6px -2px rgb(0 0 0 / 0.02), 0 1px 1px 0 rgb(0 0 0 / 0.04);
    --overlay: rgb(24 24 27 / 0.4);

    /* Sign-in brand panel glow and soft text (CampaignHub BrandPanel.jsx:41,45,62) */
    --hero-glow-light: rgb(255 255 255 / 0.1);
    --hero-glow-warm: rgb(255 122 0 / 0.22);
    --hero-text-2: rgb(255 255 255 / 0.8);

    /* Motion */
    --dur-1: 150ms;
    --dur-2: 200ms;
    --dur-skeleton: 1400ms;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --dur-1: 0.01ms;
      --dur-2: 0.01ms;
      --dur-skeleton: 0.01ms;
    }
  }

  /* BEGIN:light */
  :root, :root[data-theme="light"] {
    color-scheme: light;
    --c-bg: #f8f9fc;
    --c-panel: #fcfcfd;
    --c-surface: #ffffff;
    --c-surface-2: #f9fafb;
    --c-hover: #f3f4f6;
    --c-border: #e4e4e7;
    --c-card-line: #e8e8e8;
    --c-border-strong: #8b8b94;
    --c-text: #18181b;
    --c-text-2: #52525b;
    --c-text-3: #71717a;
    --c-icon: #6b7280;
    --c-accent: #0b1a40;
    --c-accent-hover: #12285c;
    --c-on-accent: #ffffff;
    --c-accent-text: #0b1a40;
    --c-accent-soft: #eef1f8;
    --c-accent-100: #dce2f0;
    --c-brand: #ff7a00;
    --c-brand-soft: #fff1e6;
    --c-danger: #b91c1c;
    --c-danger-hover: #991b1b;
    --c-on-danger: #ffffff;
    --c-danger-text: #b91c1c;
    --c-danger-soft: #fef2f2;
    --c-success: #15803d;
    --c-success-text: #15803d;
    --c-success-soft: #f0fdf4;
    --c-warning: #b45309;
    --c-warning-text: #b45309;
    --c-warning-soft: #fffbeb;
    --c-neutral-text: #374151;
    --c-neutral-soft: #f3f4f6;
    --c-focus: #0b1a40;
    --c-chart-1: #2f5bb7;
    --c-skeleton: #f3f4f6;
    --c-hero-1: #0b1a40;
    --c-hero-2: #12285c;
    --c-hero-3: #1d3a8a;
    --c-on-hero: #ffffff;
    --c-hero-mark: #ffffff;
    --c-hero-accent: #ff7a00;
    --c-hero-accent-2: #fbbf24;
  }
  /* END:light */

  @media (prefers-color-scheme: dark) {
    /* BEGIN:dark-auto */
    :root:where(:not([data-theme="light"])) {
      color-scheme: dark;
      --c-bg: #0b1020;
      --c-panel: #10172a;
      --c-surface: #141c31;
      --c-surface-2: #1a2440;
      --c-hover: #1f2a48;
      --c-border: #2a3553;
      --c-card-line: #2a3553;
      --c-border-strong: #7f8aa6;
      --c-text: #eef1f8;
      --c-text-2: #c3cad8;
      --c-text-3: #9ea8bd;
      --c-icon: #9ea8bd;
      --c-accent: #dce2f0;
      --c-accent-hover: #ffffff;
      --c-on-accent: #0b1a40;
      --c-accent-text: #b9c7f2;
      --c-accent-soft: #1d2b52;
      --c-accent-100: #2a3a68;
      --c-brand: #ff8f2b;
      --c-brand-soft: #3a2410;
      --c-danger: #ff7b70;
      --c-danger-hover: #ff948b;
      --c-on-danger: #2a0705;
      --c-danger-text: #ffa59d;
      --c-danger-soft: #3b1816;
      --c-success: #3ccf8a;
      --c-success-text: #6fe0a8;
      --c-success-soft: #11301f;
      --c-warning: #f1a54f;
      --c-warning-text: #f6bc7a;
      --c-warning-soft: #35230d;
      --c-neutral-text: #c3cad8;
      --c-neutral-soft: #1f2a48;
      --c-focus: #b9c7f2;
      --c-chart-1: #6f97ea;
      --c-skeleton: #1f2a48;
      --c-hero-1: #0b1a40;
      --c-hero-2: #12285c;
      --c-hero-3: #1d3a8a;
      --c-on-hero: #ffffff;
    --c-hero-mark: #ffffff;
    --c-hero-accent: #ff7a00;
    --c-hero-accent-2: #fbbf24;
    }
    /* END:dark-auto */
  }

  /* BEGIN:dark */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --c-bg: #0b1020;
    --c-panel: #10172a;
    --c-surface: #141c31;
    --c-surface-2: #1a2440;
    --c-hover: #1f2a48;
    --c-border: #2a3553;
    --c-card-line: #2a3553;
    --c-border-strong: #7f8aa6;
    --c-text: #eef1f8;
    --c-text-2: #c3cad8;
    --c-text-3: #9ea8bd;
    --c-icon: #9ea8bd;
    --c-accent: #dce2f0;
    --c-accent-hover: #ffffff;
    --c-on-accent: #0b1a40;
    --c-accent-text: #b9c7f2;
    --c-accent-soft: #1d2b52;
    --c-accent-100: #2a3a68;
    --c-brand: #ff8f2b;
    --c-brand-soft: #3a2410;
    --c-danger: #ff7b70;
    --c-danger-hover: #ff948b;
    --c-on-danger: #2a0705;
    --c-danger-text: #ffa59d;
    --c-danger-soft: #3b1816;
    --c-success: #3ccf8a;
    --c-success-text: #6fe0a8;
    --c-success-soft: #11301f;
    --c-warning: #f1a54f;
    --c-warning-text: #f6bc7a;
    --c-warning-soft: #35230d;
    --c-neutral-text: #c3cad8;
    --c-neutral-soft: #1f2a48;
    --c-focus: #b9c7f2;
    --c-chart-1: #6f97ea;
    --c-skeleton: #1f2a48;
    --c-hero-1: #0b1a40;
    --c-hero-2: #12285c;
    --c-hero-3: #1d3a8a;
    --c-on-hero: #ffffff;
    --c-hero-mark: #ffffff;
    --c-hero-accent: #ff7a00;
    --c-hero-accent-2: #fbbf24;
  }
  /* END:dark */
}
