/*
 * Design-Tokens von Xplario (CLUB-35), gemeinsam für Office und Mitgliederportal (/css/xplario-tokens.css).
 *
 * Skins sind vollständige Token-Sätze auf <html data-skin="…">: blue (Blue Magic, Standard), dojo, studio (hell),
 * kontrast (Hoher Kontrast, mindestens 7:1). Ohne gewählten Skin gilt Blue Magic – oder Hoher Kontrast, wenn das
 * Betriebssystem mehr Kontrast wünscht (prefers-contrast). Im Windows-Kontrastmodus (forced-colors) übernimmt das
 * System die Farben; Xplario sorgt nur für sichtbare Rahmen und Fokus.
 *
 * Die Akzentfarbe des Mandanten kommt als --tenant-accent-<skin> / --tenant-accent-ink-<skin> (vom Server auf den
 * Kontrast des Skins angepasst); Hoher Kontrast ignoriert sie.
 */
:root, html[data-skin="blue"] {
    --scale: 1;
    --font-body: "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
    --font-display: "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
    --border-w: 1px;
    --focus-w: 3px;
    --link-decoration: none;

    --bg: #0f2650;
    --bg-glow: #1b4a8f;
    --rail: #0a1a3a;
    --rail-text: #c9d7f2;
    --surface: #163463;
    --surface-2: #1d417a;
    --surface-soft: rgba(255, 255, 255, .06);
    --field: #0e2852;
    --line: #2f5794;
    --line-soft: rgba(255, 255, 255, .15);
    --line-strong: #6f93cf;
    --text: #eef3ff;
    --muted: #a8bce0;
    --title: #ffa24a;
    --accent: var(--tenant-accent-blue, #f7941d);
    --accent-ink: var(--tenant-accent-ink-blue, #1a0e00);
    --link: #9cc6ff;
    --focus: #ffb35c;
    --tile-a: #2d63b5;
    --tile-b: #173a74;
    --icon: #f4f8ff;
    --icon-fill: #f7941d;
    --shadow: rgba(2, 10, 30, .55);
    --ok: #57d68d;
    --ok-bg: rgba(87, 214, 141, .16);
    --warn: #ffb547;
    --crit: #ff8a80;
    --crit-bg: rgba(255, 107, 94, .18);
    color-scheme: dark;
}

html[data-skin="dojo"] {
    --bg: #16110e;
    --bg-glow: #3a1f16;
    --rail: #0d0907;
    --rail-text: #dccdbb;
    --surface: #221a15;
    --surface-2: #2e231c;
    --surface-soft: rgba(255, 240, 225, .05);
    --field: #120d0a;
    --line: #4a3a2f;
    --line-soft: rgba(255, 240, 225, .14);
    --line-strong: #8d7360;
    --text: #f5ece0;
    --muted: #bfae9a;
    --title: #ff7a6e;
    --accent: var(--tenant-accent-dojo, #f07022);
    --accent-ink: var(--tenant-accent-ink-dojo, #1a1200);
    --link: #f0b36a;
    --focus: #f2c44e;
    --tile-a: #7d2a22;
    --tile-b: #3a1611;
    --icon: #fbefe0;
    --icon-fill: #e0573f;
    --shadow: rgba(0, 0, 0, .6);
    --ok: #7fcf8c;
    --ok-bg: rgba(127, 207, 140, .15);
    --warn: #f2b046;
    --crit: #ff8f86;
    --crit-bg: rgba(255, 110, 100, .16);
    color-scheme: dark;
}

html[data-skin="studio"] {
    --bg: #f1f2f4;
    --bg-glow: #ffffff;
    --rail: #3a3a3c;
    --rail-text: #ececee;
    --surface: #ffffff;
    --surface-2: #f6f6f8;
    --surface-soft: #ffffff;
    --field: #ffffff;
    --line: #d6d7dc;
    --line-soft: #d6d7dc;
    --line-strong: #6b6c73;
    --text: #232326;
    --muted: #55565d;
    --title: #b13a0a;
    --accent: var(--tenant-accent-studio, #c2410c);
    --accent-ink: var(--tenant-accent-ink-studio, #ffffff);
    --link: #a8380a;
    --focus: #c2410c;
    --tile-a: #ffffff;
    --tile-b: #e7e8ec;
    --icon: #414141;
    --icon-fill: #f7941d;
    --shadow: rgba(35, 35, 38, .16);
    --ok: #17803d;
    --ok-bg: #e6f4ea;
    --warn: #9a5b00;
    --crit: #b3261e;
    --crit-bg: #fdecea;
    color-scheme: light;
}

/* Hoher Kontrast: mindestens 7:1, kräftiger Fokus, unterstrichene Links, keine Mandantenfarbe */
html[data-skin="kontrast"] {
    --border-w: 2px;
    --focus-w: 4px;
    --link-decoration: underline;
    --bg: #000000;
    --bg-glow: #000000;
    --rail: #000000;
    --rail-text: #ffffff;
    --surface: #000000;
    --surface-2: #000000;
    --surface-soft: #000000;
    --field: #000000;
    --line: #ffffff;
    --line-soft: #ffffff;
    --line-strong: #ffffff;
    --text: #ffffff;
    --muted: #ffffff;
    --title: #ffff00;
    --accent: #ffff00;
    --accent-ink: #000000;
    --link: #00ffff;
    --focus: #00ffff;
    --tile-a: #000000;
    --tile-b: #000000;
    --icon: #ffffff;
    --icon-fill: #000000;
    --shadow: transparent;
    --ok: #00ff66;
    --ok-bg: #000000;
    --warn: #ffff00;
    --crit: #ff9e9e;
    --crit-bg: #000000;
    color-scheme: dark;
}

/* Ohne eigene Wahl: Hoher Kontrast, wenn das System mehr Kontrast wünscht */
@media (prefers-contrast: more) {
    html:not([data-skin]) {
        --border-w: 2px;
        --focus-w: 4px;
        --link-decoration: underline;
        --bg: #000000;
        --bg-glow: #000000;
        --rail: #000000;
        --rail-text: #ffffff;
        --surface: #000000;
        --surface-2: #000000;
        --surface-soft: #000000;
        --field: #000000;
        --line: #ffffff;
        --line-soft: #ffffff;
        --line-strong: #ffffff;
        --text: #ffffff;
        --muted: #ffffff;
        --title: #ffff00;
        --accent: #ffff00;
        --accent-ink: #000000;
        --link: #00ffff;
        --focus: #00ffff;
        --tile-a: #000000;
        --tile-b: #000000;
        --icon: #ffffff;
        --icon-fill: #000000;
        --shadow: transparent;
        --ok: #00ff66;
        --ok-bg: #000000;
        --warn: #ffff00;
        --crit: #ff9e9e;
        --crit-bg: #000000;
        color-scheme: dark;
    }
}

/* Grundregeln, die in jedem Skin gelten */
html { font-size: calc(100% * var(--scale, 1)); }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse 80% 60% at 50% 30%, var(--bg-glow), transparent 70%), var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}
a { color: var(--link); text-decoration: var(--link-decoration); }
a:hover { text-decoration: underline; }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }

/* Windows-Kontrastmodus: Systemfarben, aber Rahmen und Fokus bleiben sichtbar */
@media (forced-colors: active) {
    * { forced-color-adjust: auto; }
    :focus-visible { outline: 3px solid CanvasText; }
    a { text-decoration: underline; }
    [aria-current="page"], [aria-current="true"], [aria-pressed="true"] { outline: 2px solid Highlight; }
    .ico, .ico .f { fill: none; stroke: CanvasText; }
}
