/* OH MY! FANTASY brand for the Cockpit: every colour and the font, in one place.
   index.html and login.html link this file and use only the tokens below; a brand change
   is a change here. Values follow the brandbook of 2026-10-26 and are the same as in
   omf_typst_style.py (PDF reports) -- tests/test_dashboard_brand.py compares the two.

   Rules the tokens encode:
   - creme instead of white, aubergine instead of black (no #FFF, no #000 anywhere);
   - orange (--cta) only for the one primary button of a view and as the edge of a
     warning or error, never as an area and never as small text on a light ground
     (2.7:1 on creme) -- small text uses --warn, a darkened orange;
   - status colours (Sebastian, 2026-11-16, departing from the brandbook's "no red, green,
     yellow"): fine is green (--ok), an error red (--danger), in muted tones that sit with
     the brand -- forest/sage green and berry red, not traffic-light colours; orange
     (--warn, --warn-edge) is left for hints and warnings. IRIS uses the same values
     (iris/web/src/app.css) -- change them in both places;
   - the dark scheme is not in the brandbook: it is Aubergine darkened towards black, so
     orange and lavender keep a readable contrast as text. */

/* Poppins (SIL OFL 1.1), Latin subsets built by tools/build_cockpit_fonts.py from
   assets/fonts/poppins. Served from this host like chart.umd.min.js: no request to a
   font service, so no visitor address goes there and the Content-Security-Policy needs
   no extra source. swap: text shows at once in the fallback and re-flows when the file
   arrives. */
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("/static/fonts/poppins-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700 900; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins-700.woff2") format("woff2"); }

:root {
  /* --- The brandbook's colours, by name. Use the roles below, not these. --- */
  --lavendel: #AFA2FF;
  --creme: #FFF7E8;
  --aubergine: #5B294A;
  --orange: #FF6B35;
  --lila: #481C86;
  --nachtviolett: #32025B;
  --flieder: #C895D7;
  --hellflieder: #E7D0F1;
  --graublau: #B6C2D2;

  /* Arial is the brandbook's replacement font. */
  --font: "Poppins", Arial, "Helvetica Neue", sans-serif;
  --radius-pill: 999px;

  /* --- Roles, light scheme --- */
  --bg: #FFF7E8;            /* page: creme */
  --card-bg: #FFFBF4;       /* card on the page: creme halfway to white, never white itself */
  --input-bg: #FFFBF4;
  --secondary: #F6ECF1;     /* inset tile inside a card: hellflieder in creme (reports' ROW_ALT) */
  --primary: #AFA2FF;       /* decorative lines and fills; not readable as text on creme (2.1:1) */
  --primary-soft: #E7D0F1;  /* active tab or segment, info box */
  --neutral-dark: #5B294A;
  --text: #5B294A;          /* 10.6:1 on creme */
  --text-strong: #5B294A;
  --text-muted: #7A5A6E;    /* aubergine in creme, 5.6:1 */
  --stroke: #E7D0F1;
  --accent: #481C86;        /* links, hover, selection, highlighted series: Lila, 11:1 */
  --on-accent: #FFF7E8;
  --cta: #FF6B35;           /* the one primary button of a view */
  --on-cta: #32025B;        /* 5.7:1 on orange; white would be 2.9:1 */
  --btn-bg: #5B294A;        /* every other filled button */
  --btn-text: #FFF7E8;
  --ok: #2F6B4F;            /* fine: forest green, 5.9:1 on creme */
  --ok-bg: #AFA2FF; --on-ok: #32025B;   /* lavender area with its text (avatar) */
  --danger: #A3294E;        /* error: berry red, 6.6:1 on creme; brick red sat too close to the hint orange */
  --danger-edge: #A3294E;   /* edge of an error box, filled failure dot */
  --danger-bg: #FFF7E8;     /* warning/error box: creme with a coloured left edge */
  --warn: #B8461A;          /* hint or warning as text: orange darkened to 5.0:1 on creme */
  --warn-edge: #FF6B35;     /* edge of a hint, warning ring, counter dot */
  --banner-bg: #FFF7E8;
  --banner-text: #5B294A;
  --positive: #2F6B4F;
  --negative: #A3294E;
  --badge-bg: #AFA2FF; --badge-text: #32025B;
  --heat-rgb: 72, 28, 134;  /* heat maps: rgba(var(--heat-rgb), share) */
  --grid: rgba(91, 41, 74, 0.12);
  --shade: rgba(50, 2, 91, 0.45);       /* veil behind a dialog */
  --shadow: rgba(50, 2, 91, 0.16);
  --log-bg: #32025B; --log-text: #FFF7E8;
  /* Third-party marks keep their owners' rules, not ours. */
  --slack: #4A154B;
  --google-bg: #FFFFFF; --google-text: #1F1F1F; --google-stroke: #747775;

  /* Chart series: omf_typst_style.CHART_PALETTE, same order, so Cockpit and PDF reports
     give a series the same colour. Brand tones first, light and dark alternating; orange
     late and once; then functional fallbacks for charts with up to 15 series. */
  --chart-1: #AFA2FF; --chart-2: #5B294A; --chart-3: #C895D7;
  --chart-4: #481C86; --chart-5: #B6C2D2; --chart-6: #FF6B35;
  --chart-7: #32025B; --chart-8: #1C7BA6; --chart-9: #86481C;
  --chart-10: #C2185B; --chart-11: #0097A7; --chart-12: #C9A227;
  --chart-13: #5C4EE5; --chart-14: #8FA300; --chart-15: #D9776B;

  /* Group colours for people's name chips (Verwaltung › Gruppen, IT tickets v2). Text colours: each
     reads at least 4.5:1 on the card in its scheme (tests/test_it_tickets_v2_page.py). The keys are
     dashboard_auth_store.GROUP_COLOURS. */
  --gruppe-aubergine: #5B294A; --gruppe-rose: #9C2F6B; --gruppe-orange: #A4421A; --gruppe-gold: #74580A;
  --gruppe-gruen: #2F6B4F; --gruppe-tuerkis: #0B6A73; --gruppe-blau: #1D5C84; --gruppe-grau: #66585F;
  --gruppe-blizzard: #0072E3;

  /* Makes date fields, select lists and scroll bars follow the scheme. */
  color-scheme: light;
}

/* --- Dark scheme ------------------------------------------------------------------
   Three states: "system" (no data-theme, follows the browser), "hell" and "dunkel". The
   dark values therefore stand twice: CSS cannot share a declaration list between a media
   query and an attribute selector. The media query excludes itself once "hell" is chosen.
   KEEP THE TWO BLOCKS IDENTICAL -- tests/test_dashboard_brand.py checks it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    color-scheme: dark;
    --bg: #23101C; --card-bg: #321729; --input-bg: #23101C; --secondary: #401D34;
    --primary-soft: #5B294A;
    --text: #FFF7E8; --text-strong: #FFF7E8; --text-muted: #C9B3C2; --stroke: #6F425D;
    --accent: #AFA2FF; --on-accent: #32025B;
    --btn-bg: #AFA2FF; --btn-text: #32025B;
    --ok: #9BD0B1; --danger: #F58CA8; --danger-edge: #F58CA8; --danger-bg: #321729; --warn: #FFAE6B;
    --banner-bg: #321729; --banner-text: #FFF7E8;
    --positive: #9BD0B1; --negative: #F58CA8;
    --heat-rgb: 175, 162, 255;
    --grid: rgba(255, 247, 232, 0.12);
    --shade: rgba(0, 0, 0, 0.55); --shadow: rgba(0, 0, 0, 0.35);
    --log-bg: #1A0B14;
    --slack: #6B2A6C;
    --google-bg: #131314; --google-text: #E3E3E3; --google-stroke: #8E918F;
    /* The dark brand tones sink into the dark card; lightened here. */
    --chart-2: #C9A7BC; --chart-4: #9B7FD1; --chart-7: #E7D0F1;
    --chart-8: #4FA8D3; --chart-9: #C08858; --chart-10: #F06292; --chart-13: #9A91F5;
    --gruppe-aubergine: #E7D0F1; --gruppe-rose: #F2A7CF; --gruppe-orange: #FFB98A; --gruppe-gold: #E8C766;
    --gruppe-gruen: #9BD0B1; --gruppe-tuerkis: #7FD3DB; --gruppe-blau: #8CC3E6; --gruppe-grau: #CFC3CA;
    --gruppe-blizzard: #00B4FF;
  }
}
:root[data-theme="dunkel"] {
  color-scheme: dark;
  --bg: #23101C; --card-bg: #321729; --input-bg: #23101C; --secondary: #401D34;
  --primary-soft: #5B294A;
  --text: #FFF7E8; --text-strong: #FFF7E8; --text-muted: #C9B3C2; --stroke: #6F425D;
  --accent: #AFA2FF; --on-accent: #32025B;
  --btn-bg: #AFA2FF; --btn-text: #32025B;
  --ok: #9BD0B1; --danger: #F58CA8; --danger-edge: #F58CA8; --danger-bg: #321729; --warn: #FFAE6B;
  --banner-bg: #321729; --banner-text: #FFF7E8;
  --positive: #9BD0B1; --negative: #F58CA8;
  --heat-rgb: 175, 162, 255;
  --grid: rgba(255, 247, 232, 0.12);
  --shade: rgba(0, 0, 0, 0.55); --shadow: rgba(0, 0, 0, 0.35);
  --log-bg: #1A0B14;
  --slack: #6B2A6C;
  --google-bg: #131314; --google-text: #E3E3E3; --google-stroke: #8E918F;
  --chart-2: #C9A7BC; --chart-4: #9B7FD1; --chart-7: #E7D0F1;
  --chart-8: #4FA8D3; --chart-9: #C08858; --chart-10: #F06292; --chart-13: #9A91F5;
  --gruppe-aubergine: #E7D0F1; --gruppe-rose: #F2A7CF; --gruppe-orange: #FFB98A; --gruppe-gold: #E8C766;
  --gruppe-gruen: #9BD0B1; --gruppe-tuerkis: #7FD3DB; --gruppe-blau: #8CC3E6; --gruppe-grau: #CFC3CA;
  --gruppe-blizzard: #00B4FF;
}

/* --- Shared base ------------------------------------------------------------------- */
body { font-family: var(--font); color: var(--text); background: var(--bg); }
button, input, select, textarea { font-family: inherit; }
/* Every button is a pill (brandbook). A button without a rule of its own is the brandbook's
   outline button: 1.5px aubergine, no fill, hellflieder on hover. :where() keeps these
   defaults at zero specificity, so any rule in the pages wins -- they replace the
   browser's grey button and black field text, nothing else. */
:where(button) {
  border-radius: var(--radius-pill); border: 1.5px solid var(--text); background: transparent;
  color: var(--text); cursor: pointer;
}
:where(button:hover:not(:disabled)) { background: var(--primary-soft); }
:where(button:disabled) { border-color: var(--stroke); color: var(--text-muted); cursor: default; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea) {
  color: var(--text); background-color: var(--input-bg); border: 1px solid var(--stroke); border-radius: 8px;
}
:root { accent-color: var(--accent); }
/* Focus: 3px lavender with a gap, never removed. */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* The word mark, as an image in the colour the ground asks for: aubergine on creme,
   creme on the dark scheme. Two files instead of a recoloured one -- the brandbook
   forbids recolouring the logo. */
.omf-logo { height: 40px; width: auto; display: block; }
.omf-logo.auf-dunkel { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) .omf-logo.auf-hell { display: none; }
  :root:not([data-theme="hell"]) .omf-logo.auf-dunkel { display: block; }
}
:root[data-theme="dunkel"] .omf-logo.auf-hell { display: none; }
:root[data-theme="dunkel"] .omf-logo.auf-dunkel { display: block; }

/* Status dot instead of a coloured emoji: fine is a filled green dot, a warning an orange
   ring, an error a filled red dot. Colour and shape both carry the level, so the three
   stay apart for people who cannot tell red from green. */
.status-punkt {
  display: inline-block; width: 0.72em; height: 0.72em; border-radius: 50%; flex: none;
  margin-right: 0.45em; vertical-align: 0.02em; box-sizing: border-box;
  background: var(--ok); border: 2px solid var(--ok);
}
.status-punkt.warnung { background: transparent; border-color: var(--warn-edge); }
.status-punkt.fehler { background: var(--danger-edge); border-color: var(--danger-edge); }
.status-punkt.unbekannt { background: transparent; border-color: var(--text-muted); }
