/* ==========================================================================
   ErDetSkjorteVenligt — Netcompany brand theme
   Pure CSS. Mobile-first.
   ========================================================================== */

:root {
    /* ---- Brand palette ---- */
    --coral: #FF6359;
    --coral-dark: #E24A40;
    --green-dark: #141E1E;
    --green-80: #41605E;
    --green-60: #718886;
    --green-40: #A0AFAF;
    --green-20: #D0D7D7;
    --green-10: #E7EBEB;
    --green: #123836;
    --white: #FFFFFF;

    /* ---- Support colours ---- */
    --amber: #E8A33D;
    --amber-dark: #C9862A;
    --success: #3E8E4E;

    /* ---- Semantic tokens (light) ---- */
    --bg: var(--white);
    --bg-blur: rgba(255, 255, 255, 0.82);
    --bg-subtle: var(--green-10);
    --surface: var(--white);
    --surface-2: var(--green-10);
    --text: var(--green-dark);
    --text-muted: var(--green-60);
    --heading: var(--green-dark);
    --border: var(--green-20);
    --primary: var(--green);
    --primary-hover: var(--green-80);
    --on-primary: var(--white);
    --accent: var(--coral);
    --focus-ring: rgba(18, 56, 54, 0.4);

    /* ---- Shape, depth & motion ---- */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(20, 30, 30, 0.05), 0 1px 3px rgba(20, 30, 30, 0.07);
    --shadow-md: 0 6px 18px rgba(20, 30, 30, 0.09), 0 2px 5px rgba(20, 30, 30, 0.05);
    --shadow-lg: 0 18px 44px rgba(20, 30, 30, 0.16);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition: 180ms var(--ease);

    --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F1717;
        --bg-blur: rgba(15, 23, 23, 0.82);
        --bg-subtle: #16201F;
        --surface: #1B2726;
        --surface-2: #22302F;
        --text: #E7EBEB;
        --text-muted: var(--green-40);
        --heading: var(--white);
        --border: #2E403E;
        --primary: var(--green-40);
        --primary-hover: var(--green-20);
        --on-primary: var(--green-dark);
        --focus-ring: rgba(160, 175, 175, 0.5);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Ramp the base size up on wider viewports so desktop doesn't read small. */
    font-size: clamp(16px, calc(13px + 0.45vw), 19px);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0 0 0.5em;
    line-height: 1.2;
    color: var(--heading);
    letter-spacing: -0.02em;
    font-weight: 700;
}

h1 {
    font-size: clamp(1.75rem, 6vw, 2.75rem);
}

h2 {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
}

h3 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 1em;
}

ul {
    margin: 0;
    padding: 0;
}

::selection {
    background: var(--coral);
    color: var(--white);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 0 16px;
}

main.container {
    padding-bottom: 48px;
}

/* ==========================================================================
   App header
   ========================================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-blur);
    backdrop-filter: saturate(1.5) blur(14px);
    -webkit-backdrop-filter: saturate(1.5) blur(14px);
    border-bottom: 1px solid var(--border);
}

.app-header__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 10px 16px;
}

.app-header__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-header__controls .office-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-weight: 800;
    letter-spacing: -0.03em;
    justify-self: start;
}

.brand:hover {
    color: var(--heading);
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0.18rem;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(20, 30, 30, 0.16);
    overflow: hidden;
}

.brand__mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand__mark svg {
    width: 19px;
    height: 19px;
}

.brand__text {
    font-size: 1rem;
    white-space: nowrap;
}

/* Office segmented control */
.office-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.office-nav::-webkit-scrollbar {
    display: none;
}

.office-nav__link {
    flex: 1 0 auto;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    transition: var(--transition);
}

.office-nav__link:hover {
    color: var(--text);
}

.office-nav__link.is-active {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-sm);
}

/* Language dropdown */
.lang-switch {
    position: relative;
    flex: 0 0 auto;
}

.lang-switch>summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    list-style: none;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
}

.lang-switch>summary::-webkit-details-marker {
    display: none;
}

.lang-switch>summary:hover {
    border-color: var(--border);
}

.lang-switch[open]>summary {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.lang-switch>summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform var(--transition);
}

.lang-switch[open]>summary::after {
    transform: rotate(180deg);
}

.lang-switch .flag {
    display: block;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(20, 30, 30, 0.14);
}

.lang-switch__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: drop-in 140ms var(--ease);
}

.lang-switch__menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-switch__menu a:hover,
.lang-switch__menu a.is-active {
    background: var(--surface-2);
    color: var(--text);
}

.lang-switch__menu a.is-active {
    font-weight: 700;
}

@media (min-width: 640px) {
    .app-header__inner {
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 20px;
        padding-block: 12px;
    }

    .app-header__controls {
        justify-self: end;
    }

    .office-nav__link {
        flex: 0 0 auto;
        padding-inline: 18px;
    }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    padding: 24px 0 8px;
}

.hero__eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--coral);
}

.hero__title {
    margin: 0;
}

/* ==========================================================================
   Weekday picker
   ========================================================================== */

.day-nav {
    margin: 16px 0 20px;
}

.day-nav__scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    /* Vertical padding keeps the hover lift, focus ring and shadow from
       being clipped by the scroll container's overflow. */
    padding: 6px 4px;
    margin: -6px -4px -2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.day-nav__scroll::-webkit-scrollbar {
    display: none;
}

.day-chip {
    flex: 0 0 auto;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.day-chip:hover {
    border-color: var(--primary);
    color: var(--text);
    transform: translateY(-1px);
}

.day-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Action bar (stain report + queue)
   ========================================================================== */

.action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 359px) {
    .action-bar {
        grid-template-columns: 1fr;
    }
}

.stain-card,
.queue>summary {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.stain-card:hover,
.queue>summary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stain-card:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

/* Stain button */
.stain-card__icon {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.stain-card__icon svg {
    width: 100%;
    height: 100%;
    transition: filter var(--transition);
    filter: drop-shadow(0 3px 6px rgba(255, 99, 89, 0.35));
}

.stain-card__count {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--white);
    font-size: 1.15rem;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.stain-card__meta,
.queue__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stain-card__label,
.queue__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stain-card__hint {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--heading);
}

.stain-card.reporting {
    border-color: var(--amber);
}

.stain-card.reporting .stain-card__icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: rgba(232, 163, 61, 0.35);
    animation: pulse 1s infinite var(--ease);
}

.stain-card.reported {
    border-color: var(--success);
}

.stain-card.error {
    border-color: var(--coral);
}

@keyframes pulse {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Queue dropdown */
.queue {
    position: relative;
}

.queue>summary {
    list-style: none;
}

.queue>summary::-webkit-details-marker {
    display: none;
}

.queue__dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green-40);
    box-shadow: 0 0 0 4px rgba(160, 175, 175, 0.2);
    transition: var(--transition);
}

.queue__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--heading);
}

.queue.queue-empty>summary .queue__dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(62, 142, 78, 0.18);
}

.queue.queue-medium>summary .queue__dot {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(232, 163, 61, 0.2);
}

.queue.queue-busy>summary .queue__dot {
    background: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 99, 89, 0.2);
}

.queue__menu .queue__dot--empty {
    background: var(--success);
    box-shadow: none;
}

.queue__menu .queue__dot--medium {
    background: var(--amber);
    box-shadow: none;
}

.queue__menu .queue__dot--busy {
    background: var(--coral);
    box-shadow: none;
}

.queue[open]>summary {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.queue__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    min-width: 170px;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: drop-in 140ms var(--ease);
}

@keyframes drop-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.queue__menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.queue__menu a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.queue.queue-reporting>summary {
    opacity: 0.6;
    animation: pulse 1.2s infinite var(--ease);
}

.queue.queue-reported>summary {
    border-color: var(--success);
}

.queue.queue-error>summary {
    border-color: var(--coral);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    padding: 20px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card__head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.card__meta {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Menu groups */
.menu-group+.menu-group {
    margin-top: 20px;
}

.menu-group__name {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--green-80);
}

@media (prefers-color-scheme: dark) {
    .menu-group__name {
        color: var(--green-40);
    }
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.tag-list li {
    max-width: 100%;
    padding: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 0.9rem;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ==========================================================================
   Risk card
   ========================================================================== */

.risk-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.risk-card__head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.risk-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--white);
    background: var(--green-60);
}

.risk-card--low .risk-badge {
    background: var(--success);
}

.risk-card--medium .risk-badge {
    background: var(--amber-dark);
}

.risk-card--high .risk-badge {
    background: var(--coral-dark);
}

.risk-meter {
    position: relative;
    height: 12px;
    margin-bottom: 18px;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.risk-meter__fill {
    height: 100%;
    border-radius: var(--radius-pill);
    /* One consistent green -> yellow -> red scale. The gradient is sized to
       the full track (not the fill) so the colour at the fill's tip always
       maps to the risk value, whatever the level. */
    background-image: linear-gradient(90deg,
            var(--success) 0%,
            var(--amber) 50%,
            var(--coral) 100%);
    background-repeat: no-repeat;
    background-size: calc(100% * 10 / max(var(--level, 1), 1)) 100%;
    transition: width 600ms var(--ease);
}

.quote {
    margin: 0;
    padding: 14px 16px;
    background: var(--surface-2);
    border-left: 4px solid var(--coral);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text);
}

.quote footer {
    margin-top: 8px;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 700;
    color: var(--text-muted);
}

/* ==========================================================================
   Mitigations
   ========================================================================== */

.mitigations {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.mitigations .card {
    margin-bottom: 0;
}

.mitigation__label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mitigation--color {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(150deg, var(--green), var(--green-80));
    border-color: transparent;
    color: var(--white);
}

.mitigation--color .mitigation__label {
    color: var(--green-20);
}

.mitigation__value {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
}

.check-list {
    list-style: none;
    display: grid;
    gap: 10px;
}

.check-list li {
    position: relative;
    padding-left: 30px;
    font-size: 0.95rem;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.28em;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--primary);
}

.check-list li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.5em;
    width: 5px;
    height: 9px;
    border: solid var(--on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==========================================================================
   Error page
   ========================================================================== */

.error-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 32px 24px;
    margin-top: 32px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--coral);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.error-card h1 {
    margin: 0;
    font-size: 1.5rem;
}

.error-card p {
    margin: 0;
    color: var(--text-muted);
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 18px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.button:hover {
    background: var(--primary-hover);
    color: var(--on-primary);
    transform: translateY(-1px);
}

/* ==========================================================================
   Responsive up-scaling
   ========================================================================== */

@media (min-width: 720px) {
    .hero {
        padding-top: 36px;
    }

    .card {
        padding: 28px;
    }

    .action-bar {
        gap: 16px;
    }

    .mitigations {
        grid-template-columns: minmax(220px, 1fr) 2fr;
    }
}

@media (min-width: 900px) {
    main.container {
        padding-inline: 24px;
    }
}

/* ==========================================================================
   Motion & print preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
