/* The two themes and the one place their colours live (Look and Theme, phase 1).

   Every colour in the CRM is a variable defined HERE, once for the dark theme (the default) and once for the light theme. The page carries data-theme="dark" or
   data-theme="light" on its html element (static/js/theme-boot.js sets it before anything paints); a person's own choice wins over the company's starting theme.
   Colour comes from lights on a near black page, never from pastel tinted tiles: the main colour lights buttons, the active menu item and highlights, and each of
   the five supporting colours keeps ONE meaning everywhere: green is paid, positive or live, red is failed, negative or overdue, orange is waiting or neutral, teal
   is replies, pink is opens.

   The surfaces, the text colours and the five meaning colours are fixed: every pair has been checked for readable contrast (4.5 to 1 for text, 3 to 1 for chart
   marks), and tests/test_theme.py reads them back from this file and re-checks them. The main colour, its pressed shade, its button label, the link colours and
   the chart series that come from it are the standard blue below until the owner sets a colour in Settings, Branding; the server then writes the owner's own set
   into the page head (app/theme.py works every one out and refuses a colour nobody could read). A fill uses --primary, text and links use --link: the main colour
   is never used as text.

   The CRM's older names (--ink, --paper, --line, --accent and the rest) point at these in app.css. glow.css holds the components built from them.

   The font is Inter, served from this CRM (static/fonts, with its licence file): the content policy lets a page load fonts from its own site only, so a font service
   cannot be used. One variable font file holds every weight; the system font stands in until it loads and when it cannot. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* shape, the same in both themes */
  --radius: 14px;
  --footer-h: 40px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* the small rounded plate a logo sits on when it is shown on the other theme's page (only one logo was uploaded) */
  --plate-dark: #0d1220;
  --plate-light: #ffffff;
  /* the ink on paper: the page is white when it is printed, so every text colour becomes one of these whichever theme is on screen (glow.css, the print block) */
  --print-ink: #000000;
  --print-ink-soft: #333333;
  /* the two inks for words drawn ON a mark that is painted at a strength (a tile of the map): the page picks the one that reads on the colour the mark really shows (static/js/ink.js). White and black,
     because one of those two always reaches 4.5 to 1 on any colour (at worst 4.58), under any main colour a buyer might choose */
  --mark-ink-light: #ffffff;
  --mark-ink-dark: #000000;
}

/* A box that wears one theme whole (the two live previews of the Branding page): the same values as the page's own theme, on any element that says data-theme and theme-scope. */
:root,
:root[data-theme="dark"],
.theme-scope[data-theme="dark"] {
  color-scheme: dark;
  /* surfaces */
  --bg: #070b14;
  --bg-alt: #0d1220;
  --card: #111827;
  --card-raised: #141b2d;
  --border: #1e2535;
  --border-strong: #2b3550;
  /* text */
  --text: #e8eaf0;
  --text-muted: #7a8499;
  --text-strong: #ffffff;
  /* the main colour and what is worked out from it (app/theme.py; the standard blue until Branding sets one) */
  --primary: #2b5fd9;
  --primary-rgb: 43, 95, 217;
  --primary-dark: #2450b6;
  --link: #6289e3;
  --on-primary: #ffffff;
  /* the one extra brand colour (app/theme.py accent_for): the link colour until Branding sets an accent; a fill of it carries --on-brand-accent */
  --brand-accent: #6289e3;
  --on-brand-accent: #05070d;
  /* the five meaning colours */
  --green: #4ade80;
  --red: #f87171;
  --orange: #fb923c;
  --teal: #2dd4bf;
  --pink: #f472b6;
  --green-rgb: 74, 222, 128;
  --red-rgb: 248, 113, 113;
  --orange-rgb: 251, 146, 60;
  --teal-rgb: 45, 212, 191;
  --pink-rgb: 244, 114, 182;
  --green-text: var(--green);
  --red-text: var(--red);
  --orange-text: var(--orange);
  --teal-text: var(--teal);
  --pink-text: var(--pink);
  /* the label on a filled red or green button (a light fill needs a dark label, a dark fill a white one) */
  --on-red: #05070d;
  --on-green: #05070d;
  /* chart series: the first three come from the main colour, the two slates are for series with no meaning */
  --channel-phone: #2b5fd9;
  --channel-email: #6289e3;
  --channel-both: #a9bef0;
  --slate-1: #94a3b8;
  --slate-2: #64748b;
  /* shape and effects: on a dark page colour glows, on a light page it is a soft shadow */
  --tag-alpha: 0.14;
  /* a tint is the colour at --tag-alpha over the card, a solid colour: the words on it have one known pair of colours, whatever sits behind the tag */
  --green-tint: color-mix(in srgb, var(--green) calc(var(--tag-alpha) * 100%), var(--card));
  --red-tint: color-mix(in srgb, var(--red) calc(var(--tag-alpha) * 100%), var(--card));
  --orange-tint: color-mix(in srgb, var(--orange) calc(var(--tag-alpha) * 100%), var(--card));
  --teal-tint: color-mix(in srgb, var(--teal) calc(var(--tag-alpha) * 100%), var(--card));
  --pink-tint: color-mix(in srgb, var(--pink) calc(var(--tag-alpha) * 100%), var(--card));
  --primary-tint: color-mix(in srgb, var(--primary) 16%, var(--card));
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  --glow-chip: 0 0 0 1px rgba(var(--primary-rgb), 0.45), 0 0 16px rgba(var(--primary-rgb), 0.35);
  --glow-button: 0 0 0 1px rgba(var(--primary-rgb), 0.55), 0 4px 18px rgba(var(--primary-rgb), 0.38);
  --glow-button-hover: 0 0 0 1px rgba(var(--primary-rgb), 0.8), 0 6px 26px rgba(var(--primary-rgb), 0.55);
  --glow-active: inset 3px 0 0 var(--primary), 0 0 22px rgba(var(--primary-rgb), 0.25);
  --scrim: rgba(3, 5, 10, 0.65);
  /* the assistant orb, the floating tooltip, chart grid lines and the soft light behind the page */
  --orb-core-a: color-mix(in srgb, var(--primary) 35%, white);
  --orb-core-b: var(--primary);
  --orb-core-c: color-mix(in srgb, var(--primary) 40%, black);
  --orb-gloss: rgba(255, 255, 255, 0.28);
  --tip-bg: #0b1020;
  --tip-border: #2b3550;
  --tip-text: #ffffff;
  --tip-text-soft: #cdd3e2;
  --grid: rgba(255, 255, 255, 0.06);
  --page-glow: radial-gradient(900px 420px at 78% -8%, rgba(var(--primary-rgb), 0.16), transparent 70%);
}

:root[data-theme="light"],
.theme-scope[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5fa;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --card-raised: #f8f9fd;
  --border: #e1e4ee;
  --border-strong: #c6cde0;
  --text: #0f1423;
  --text-muted: #555d72;
  --text-strong: #05070d;
  --primary: #2b5fd9;
  --primary-rgb: 43, 95, 217;
  --primary-dark: #2450b6;
  --link: #2b5ed7;
  --on-primary: #ffffff;
  /* the one extra brand colour (app/theme.py accent_for): the link colour until Branding sets an accent; a fill of it carries --on-brand-accent */
  --brand-accent: #2b5ed7;
  --on-brand-accent: #ffffff;
  --green: #15803d;
  --red: #b91c1c;
  --orange: #c2410c;
  --teal: #0f766e;
  --pink: #be185d;
  --green-rgb: 21, 128, 61;
  --red-rgb: 185, 28, 28;
  --orange-rgb: 194, 65, 12;
  --teal-rgb: 15, 118, 110;
  --pink-rgb: 190, 24, 93;
  --green-text: var(--green);
  --red-text: var(--red);
  --orange-text: var(--orange);
  --teal-text: var(--teal);
  --pink-text: var(--pink);
  --on-red: #ffffff;
  --on-green: #ffffff;
  --channel-phone: #1e4298;
  --channel-email: #2b5fd9;
  --channel-both: #6087e2;
  --slate-1: #64748b;
  --slate-2: #475569;
  --tag-alpha: 0.08;
  /* a tint is the colour at --tag-alpha over the card, a solid colour: the words on it have one known pair of colours, whatever sits behind the tag */
  --green-tint: color-mix(in srgb, var(--green) calc(var(--tag-alpha) * 100%), var(--card));
  --red-tint: color-mix(in srgb, var(--red) calc(var(--tag-alpha) * 100%), var(--card));
  --orange-tint: color-mix(in srgb, var(--orange) calc(var(--tag-alpha) * 100%), var(--card));
  --teal-tint: color-mix(in srgb, var(--teal) calc(var(--tag-alpha) * 100%), var(--card));
  --pink-tint: color-mix(in srgb, var(--pink) calc(var(--tag-alpha) * 100%), var(--card));
  --primary-tint: color-mix(in srgb, var(--primary) 16%, var(--card));
  --shadow-card: 0 1px 2px rgba(15, 20, 35, 0.06), 0 8px 20px rgba(15, 20, 35, 0.06);
  --shadow-pop: 0 12px 28px rgba(15, 20, 35, 0.18);
  --glow-chip: 0 1px 3px rgba(var(--primary-rgb), 0.3);
  --glow-button: 0 4px 14px rgba(var(--primary-rgb), 0.3);
  --glow-button-hover: 0 6px 20px rgba(var(--primary-rgb), 0.42);
  --glow-active: inset 3px 0 0 var(--primary), 0 2px 10px rgba(var(--primary-rgb), 0.14);
  --scrim: rgba(20, 24, 36, 0.45);
  --orb-core-a: color-mix(in srgb, var(--primary) 20%, white);
  --orb-core-b: var(--primary);
  --orb-core-c: color-mix(in srgb, var(--primary) 70%, black);
  --orb-gloss: rgba(255, 255, 255, 0.4);
  --tip-bg: #0f1423;
  --tip-border: #0f1423;
  --tip-text: #ffffff;
  --tip-text-soft: #cdd3e2;
  --grid: rgba(15, 20, 35, 0.08);
  --page-glow: radial-gradient(900px 380px at 78% -8%, rgba(var(--primary-rgb), 0.1), transparent 70%);
}

body { -webkit-font-smoothing: antialiased; }
