/* Highspan status page.
   Colors are the resolved values of acvs-osp-web's semantic tokens
   (nxsrc/libs/assets-lib/src/sass/_tokens/semantic/_light.scss / _dark.scss,
   main/hsp), so the page matches the product. Token names are kept. */

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

:root {
    color-scheme: light;
    --s-bg-page: #f3f5fb;
    --s-bg-surface: #ffffff;
    --s-bg-fill-secondary: #e3e7f2;
    --s-bg-fill-emphasis: #109ac1;
    --s-bg-fill-success-muted: #589c0526;
    --s-bg-fill-warning-muted: #cb7c0626;
    --s-bg-fill-critical-muted: #ff5a5a26;
    --s-bg-fill-emphasis-muted: #109ac126;
    --s-stroke-secondary: #b6bdcd;
    --s-stroke-focus: #6fdcfa;
    --s-text-primary: #1e2021;
    --s-text-secondary: #404759;
    --s-text-emphasis: #1d748e;
    --s-text-success: #589c05;
    --s-text-warning: #cb7c06;
    --s-text-critical: #a60c0c;
    --s-icon-subtle: #717c98;
    --shadow-low: 0 1px 2px #13151514, 0 4px 12px #1315150a;
    --radius: 12px;
    /* Uptime bars: no downtime, then rising weighted downtime. */
    --bar-ok: #589c05;
    --bar-minor: #d4a106;
    --bar-partial: #e8590c;
    --bar-major: #c42b1c;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --s-bg-page: #131515;
        --s-bg-surface: #1e2021;
        --s-bg-fill-secondary: #2e333d;
        --s-bg-fill-emphasis: #6fdcfa;
        --s-bg-fill-success-muted: #589c0533;
        --s-bg-fill-warning-muted: #cb7c0633;
        --s-bg-fill-critical-muted: #ff5a5a33;
        --s-bg-fill-emphasis-muted: #6fdcfa26;
        --s-stroke-secondary: #404759;
        --s-text-primary: #ffffff;
        --s-text-secondary: #b6bdcd;
        --s-text-emphasis: #6fdcfa;
        --s-text-success: #c3ff79;
        --s-text-warning: #ffc670;
        --s-text-critical: #ff5a5a;
        --s-icon-subtle: #959db2;
        --shadow-low: none;
        --bar-ok: #7cc242;
        --bar-minor: #ffc670;
        --bar-partial: #ff9248;
        --bar-major: #ff5a5a;
    }
}

[x-cloak] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--s-bg-page);
    color: var(--s-text-primary);
    font-family: Outfit, Roboto, Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--s-text-emphasis); }
a:focus-visible { outline: 2px solid var(--s-stroke-focus); outline-offset: 2px; }

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.header .logo { height: 22px; width: auto; display: block; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
    .logo-light { display: none !important; }
    .logo-dark { display: block !important; }
}
.header .divider {
    width: 1px;
    height: 20px;
    background: var(--s-stroke-secondary);
}
.header .product {
    font-size: 18px;
    font-weight: 400;
    color: var(--s-text-secondary);
    letter-spacing: 0.02em;
}

/* Cards */
.card {
    background: var(--s-bg-surface);
    border: 1px solid var(--s-stroke-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-low);
}

/* Overall banner */
.banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border-left-width: 6px;
}
.banner h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.3;
}
.banner p {
    margin: 4px 0 0;
    color: var(--s-text-secondary);
    font-size: 15px;
}
.banner .icon { width: 32px; height: 32px; flex: none; }

/* Notice (manual) */
.notice {
    padding: 16px 24px;
    margin-bottom: 24px;
    border-left-width: 6px;
}
.notice h2 { margin: 0; font-size: 17px; font-weight: 500; }
.notice p { margin: 6px 0 0; color: var(--s-text-secondary); white-space: pre-line; }
.notice .meta { margin-top: 8px; font-size: 13px; color: var(--s-icon-subtle); }

/* Components */
.components { list-style: none; margin: 0; padding: 0; }
.component { padding: 16px 24px; }
.component-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.component + .component { border-top: 1px solid var(--s-stroke-secondary); }
.component .name { font-weight: 500; }
.component .desc { color: var(--s-text-secondary); font-size: 14px; }

/* Uptime bars (one per UTC day), as on githubstatus.com */
.history { margin-top: 12px; }
.bars { display: flex; gap: 2px; height: 34px; }
.bar {
    flex: 1 1 0;
    min-width: 2px;
    border-radius: 2px;
    background: var(--bar-ok);
    cursor: default;
}
.bar:hover, .bar:focus-visible { opacity: 0.7; outline: none; }
.bar.is-minor { background: var(--bar-minor); }
.bar.is-partial { background: var(--bar-partial); }
.bar.is-major { background: var(--bar-major); }
.bar.is-nodata { background: var(--s-bg-fill-secondary); }
.history-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--s-icon-subtle);
    white-space: nowrap;
}
.history-legend .rule { flex: 1; height: 1px; background: var(--s-stroke-secondary); }
.history-legend .uptime { color: var(--s-text-secondary); }
.tip {
    position: fixed;
    z-index: 10;
    width: 240px;
    transform: translate(-50%, -100%);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--s-stroke-secondary);
    background: var(--s-bg-surface);
    box-shadow: 0 4px 16px #13151533;
    font-size: 13px;
    color: var(--s-text-secondary);
    pointer-events: none;
}
.tip-date { font-weight: 500; color: var(--s-text-primary); margin-bottom: 2px; }

.scheduled-section { margin-top: 32px; }
.scheduled { list-style: none; margin: 0; padding: 0; }
.scheduled-item { padding: 14px 20px; }
.scheduled-item + .scheduled-item { border-top: 1px solid var(--s-stroke-secondary); }
.scheduled-item .when { font-weight: 500; color: var(--s-text-emphasis); }
.scheduled-item .desc { margin-top: 4px; white-space: pre-line; }
.scheduled-item .affects { margin-top: 4px; font-size: 13px; color: var(--s-text-secondary); }
.state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.state .icon { width: 18px; height: 18px; }

/* Status colours. Text label always present; colour is never the only cue. */
.is-operational { color: var(--s-text-success); }
.is-degraded { color: var(--s-text-warning); }
.is-outage { color: var(--s-text-critical); }
.is-maintenance { color: var(--s-text-emphasis); }
.is-unknown { color: var(--s-icon-subtle); }

.banner.is-operational, .notice.is-operational { border-left-color: var(--s-text-success); }
.banner.is-degraded, .notice.is-degraded { border-left-color: var(--s-text-warning); background: linear-gradient(var(--s-bg-fill-warning-muted), var(--s-bg-fill-warning-muted)), var(--s-bg-surface); }
.banner.is-outage, .notice.is-outage { border-left-color: var(--s-text-critical); background: linear-gradient(var(--s-bg-fill-critical-muted), var(--s-bg-fill-critical-muted)), var(--s-bg-surface); }
.banner.is-maintenance, .notice.is-maintenance, .notice.is-info { border-left-color: var(--s-bg-fill-emphasis); background: linear-gradient(var(--s-bg-fill-emphasis-muted), var(--s-bg-fill-emphasis-muted)), var(--s-bg-surface); }
.banner.is-unknown { border-left-color: var(--s-icon-subtle); }
.banner h1, .notice h2 { color: var(--s-text-primary); }

/* Icons: masks so they take the status colour. */
.icon {
    display: inline-block;
    background-color: currentColor;
    -webkit-mask: var(--glyph) center / contain no-repeat;
    mask: var(--glyph) center / contain no-repeat;
}
.is-operational .icon, .icon.is-operational {
    --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7Z'/%3E%3C/svg%3E");
}
.is-degraded .icon, .icon.is-degraded {
    --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2Zm1 16h-2v-2h2v2Zm0-4h-2V9h2v5Z'/%3E%3C/svg%3E");
}
.is-outage .icon, .icon.is-outage {
    --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm4.3 12.9-1.4 1.4-2.9-2.9-2.9 2.9-1.4-1.4 2.9-2.9-2.9-2.9 1.4-1.4 2.9 2.9 2.9-2.9 1.4 1.4-2.9 2.9 2.9 2.9Z'/%3E%3C/svg%3E");
}
.is-maintenance .icon, .icon.is-maintenance, .is-info .icon {
    --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22.7 19.3 13.6 10.2c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3l4.3 4.3-3 3L1.6 5C.4 7.4.9 10.4 2.9 12.4c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4Z'/%3E%3C/svg%3E");
}
.is-unknown .icon, .icon.is-unknown {
    --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 17h-2v-2h2v2Zm2.1-7.8-.9.9c-.7.7-1.2 1.3-1.2 2.9h-2v-.5c0-1.1.4-2.1 1.2-2.8l1.2-1.3c.4-.4.6-.9.6-1.4a2 2 0 0 0-4 0H8a4 4 0 1 1 8 0c0 .9-.4 1.7-.9 2.2Z'/%3E%3C/svg%3E");
}

.section-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--s-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer {
    margin-top: 24px;
    font-size: 13px;
    color: var(--s-icon-subtle);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.loading { padding: 24px; color: var(--s-text-secondary); }

@media (max-width: 520px) {
    .page { padding-top: 20px; }
    .banner { padding: 16px; }
    .banner h1 { font-size: 19px; }
    .component { padding: 14px 16px; }
    .component-head { align-items: flex-start; }
    .notice { padding: 14px 16px; }
}

@media (prefers-reduced-motion: no-preference) {
    .state, .banner { transition: color 0.2s ease, background-color 0.2s ease; }
}
