/*
 * ContractsIQ — Design Tokens
 * Single source of truth, shared by the Small Business site, the Enterprise
 * page, and the contact/legal pages. Distilled from the ContractIQ design
 * system (frontend/src/theme.js — Material UI v6).
 *
 * Load this BEFORE styles.css / pages.css / the Enterprise inline styles.
 */

/* ---------- Light theme (default) ---------- */
:root,
[data-theme="light"] {
  /* Brand */
  --primary: #1f4fd0;
  --primary-contrast: #ffffff;
  --secondary: #7c3aed;

  /* Surfaces */
  --bg-default: #f6f7fb;
  --bg-paper: #ffffff;
  --bg-subtle: rgba(15, 23, 42, 0.03);
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-selected: rgba(31, 79, 208, 0.08);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-disabled: rgba(15, 23, 42, 0.38);

  /* Lines */
  --divider: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --info: #2563eb;

  /* Risk */
  --risk-high: #dc2626;
  --risk-medium: #d97706;
  --risk-low: #16a34a;
  --risk-high-tint: rgba(220, 38, 38, 0.08);
  --risk-medium-tint: rgba(217, 119, 6, 0.08);
  --risk-low-tint: rgba(22, 163, 74, 0.08);

  /* Accents (subtle brand glow — used at 3–6% opacity only) */
  --accent-glow-1: rgba(31, 79, 208, 0.04);
  --accent-glow-2: rgba(124, 58, 237, 0.03);

  /* Marketing-layer additions (not in the product theme, kept for the
     marketing sites: hover state for the brand button, and a third text
     tier the marketing pages lean on for fine print / metadata). */
  --primary-hover: #1a44b8;
  --text-tertiary: #94a3b8;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --primary: #7aa2ff;
  --primary-contrast: #ffffff;
  --secondary: #c084fc;

  --bg-default: #0d1117;
  --bg-paper: #161b22;
  --bg-subtle: rgba(255, 255, 255, 0.04);
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-selected: rgba(122, 162, 255, 0.12);

  --text-primary: #e6edf3;
  --text-secondary: #9aa6b2;
  --text-disabled: rgba(230, 237, 243, 0.38);

  --divider: rgba(240, 246, 252, 0.1);
  --border-strong: rgba(240, 246, 252, 0.18);

  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;

  --risk-high: #f87171;
  --risk-medium: #fbbf24;
  --risk-low: #4ade80;
  --risk-high-tint: rgba(248, 113, 113, 0.14);
  --risk-medium-tint: rgba(251, 191, 36, 0.14);
  --risk-low-tint: rgba(74, 222, 128, 0.14);

  --accent-glow-1: rgba(122, 162, 255, 0.06);
  --accent-glow-2: rgba(192, 132, 252, 0.04);

  --primary-hover: #6b93f5;
  --text-tertiary: #6e7b8a;
}

/* ---------- Type families ---------- */
:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo,
    Consolas, monospace;
}

/* ---------- Type scale (matches the MUI variants in theme.js) ---------- */
:root {
  --fs-h1: 40px;
  --fs-h2: 32px;
  --fs-h3: 28px;
  --fs-h4: 24px;
  --fs-h5: 20px;
  --fs-h6: 18px;
  --fs-subtitle1: 16px;
  --fs-body1: 15px;
  --fs-body2: 14px;   /* workhorse body size */
  --fs-caption: 12px;
  --fs-overline: 11px;
  --fs-button: 14px;

  --lh-tight: 1.1;
  --lh-snug: 1.2;
  --lh-normal: 1.4;
  --lh-relaxed: 1.55;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;   /* reserved for the marketing hero headline */

  --tracking-tight: -0.02em;    /* h1, h2 */
  --tracking-tighter: -0.01em;  /* h3, h4 */
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.08em;     /* overline / section eyebrows */
}

/* ---------- Spacing / shape / elevation ---------- */
:root {
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 6px;
  --radius-md: 8px;    /* buttons, chips */
  --radius-lg: 10px;   /* cards, papers */
  --radius-xl: 12px;   /* dialogs, large marketing cards */
  --radius-pill: 999px;

  --shadow-none: 0 0 #0000;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.15s;
  --dur-base: 0.2s;
}
