/*
 * Design tokens shared by the public status page (public.css) and the
 * backend (admin.css): the colours of the states, which
 * have a meaning of their own and therefore look the same everywhere, every
 * colour defined once with light-dark(). Surfaces, text and fonts are no
 * longer shared: the public site defines them in public.css (look of
 * easy-smarthome.de), the backend in admin-theme.css (look of the MCC).
 * Which scheme applies is up to the including stylesheet: public.css sets
 * color-scheme on <html> (data-theme of assets/scripts/theme.js), the backend
 * keeps the mechanism of EasyAdmin (color-scheme and .ea-dark-scheme on
 * <body>). Custom properties are substituted where they are used, so
 * light-dark() resolves against the color-scheme of the element that uses
 * the token. Included as its own <link> before public.css or admin-theme.css.
 */

/* --- Colours of the states. --- */

:root {
    --on-status: light-dark(#ffffff, #0b0e13);

    --status-operational-fg: light-dark(#1a7f37, #56d364);
    --status-operational-fill: light-dark(#1a7f37, #56d364);
    --status-operational-tint: light-dark(#ffffff, #121821);
    --status-operational-tint-border: light-dark(#e3e6ea, #1f2731);
    --status-maintenance-fg: light-dark(#0a58b8, #8cc4ff);
    --status-maintenance-fill: light-dark(#0a58b8, #6cb6ff);
    --status-maintenance-tint: light-dark(#eef4fc, #0f1a2b);
    --status-maintenance-tint-border: light-dark(#c6d9f1, #1f3554);
    --status-degraded_performance-fg: light-dark(#8a5a00, #e3b341);
    --status-degraded_performance-fill: light-dark(#9a6700, #e3b341);
    --status-degraded_performance-tint: light-dark(#fbf3e0, #1f1a0e);
    --status-degraded_performance-tint-border: light-dark(#ebd18b, #4a3c14);
    --status-partial_outage-fg: light-dark(#9a3412, #f6a66a);
    --status-partial_outage-fill: light-dark(#c2410c, #f0883e);
    --status-partial_outage-tint: light-dark(#fff4ec, #2a1a0f);
    --status-partial_outage-tint-border: light-dark(#f6c9a8, #5c3417);
    --status-major_outage-fg: light-dark(#c4161c, #ff7b72);
    --status-major_outage-fill: light-dark(#c4161c, #ff7b72);
    --status-major_outage-tint: light-dark(#fde8e8, #2a1213);
    --status-major_outage-tint-border: light-dark(#f2b8bb, #6b2326);
    --status-quiet-dot: light-dark(#3fa65a, #3b8a52);

    --maint-bg: var(--status-maintenance-tint);
    --maint-border: var(--status-maintenance-tint-border);
    --maint-fg: var(--status-maintenance-fg);
}

/* Browsers without light-dark() (before Chrome 123, Firefox 120, Safari 17.5) get the light colours. */
@supports not (color: light-dark(#000000, #ffffff)) {
    :root {
        --on-status: #ffffff;

        --status-operational-fg: #1a7f37;
        --status-operational-fill: #1a7f37;
        --status-operational-tint: #ffffff;
        --status-operational-tint-border: #e3e6ea;
        --status-maintenance-fg: #0a58b8;
        --status-maintenance-fill: #0a58b8;
        --status-maintenance-tint: #eef4fc;
        --status-maintenance-tint-border: #c6d9f1;
        --status-degraded_performance-fg: #8a5a00;
        --status-degraded_performance-fill: #9a6700;
        --status-degraded_performance-tint: #fbf3e0;
        --status-degraded_performance-tint-border: #ebd18b;
        --status-partial_outage-fg: #9a3412;
        --status-partial_outage-fill: #c2410c;
        --status-partial_outage-tint: #fff4ec;
        --status-partial_outage-tint-border: #f6c9a8;
        --status-major_outage-fg: #c4161c;
        --status-major_outage-fill: #c4161c;
        --status-major_outage-tint: #fde8e8;
        --status-major_outage-tint-border: #f2b8bb;
        --status-quiet-dot: #3fa65a;
    }
}
