:root {
    /* Brand palette (from the logo + Farger.pdf). Navy is the primary accent; green/orange/amber
       appear only in the thin top stripe, echoing the logo's four strokes. Kept deliberately subtle. */
    --navy: #182a54;
    --navy-soft: #3c486c;
    --navy-hover: #25386a;
    --green: #7eae42;
    --orange: #d85a24;
    --amber: #f6961e;
    --tint: #e4f0fc;

    --fg: #1a1a1a;
    --muted: #555;
    --accent: var(--navy);
    --line: #d4d7dc;

    /* System font stack only — no external/CDN font (design D14, Q7). */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--fg);
    background: #f5f7fa;
    line-height: 1.5;
}

/* Thin four-segment brand stripe at the very top, echoing the logo's four strokes. */
body::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg,
        var(--green) 0 25%,
        var(--navy) 25% 50%,
        var(--orange) 50% 75%,
        var(--amber) 75% 100%);
}

main {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.app-header .brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand .logo {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
}

h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--navy);
}

.intro {
    color: var(--muted);
    margin-top: 0.6rem;
}

.project {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.project label {
    font-weight: 600;
    display: block;
}

.project input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0.7rem;
    margin-top: 0.3rem;
    font-size: 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.project input[type="text"]:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(24, 42, 84, 0.15);
}

.checklist {
    margin-top: 1rem;
}

.node {
    margin: 0;
}

.node.gate > .question {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    align-items: baseline;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
}

.q-text {
    font-weight: 600;
    flex: 1 1 60%;
}

/* Hover/focus help popover next to a question (placeholder text for now). */
.info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    margin-left: 0.35rem;
    border: 1px solid var(--navy);
    border-radius: 50%;
    color: var(--navy);
    font-size: 0.72rem;
    font-style: italic;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    user-select: none;
    vertical-align: middle;
}

.info .tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 260px;
    padding: 0.5rem 0.7rem;
    background: var(--navy);
    color: #fff;
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    pointer-events: none;
    z-index: 10;
}

.info:hover .tooltip,
.info:focus .tooltip,
.info:focus-visible .tooltip {
    opacity: 1;
    visibility: visible;
}

.q-options {
    display: flex;
    gap: 1.2rem;
    white-space: nowrap;
}

.section-title {
    font-size: 1.15rem;
    margin: 1.5rem 0 0;
    padding-top: 0.9rem;
    border-top: 2px solid var(--accent);
}

.revealed {
    margin: 0.2rem 0 0.8rem 0.6rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--accent);
}

.actions {
    margin-top: 2.5rem;
}

.actions button {
    font-size: 1rem;
    padding: 0.6rem 1.3rem;
    color: #fff;
    background: var(--navy);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.actions button:hover {
    background: var(--navy-hover);
}

.hint {
    color: var(--muted);
    font-size: 0.85rem;
    max-width: 60ch;
}

.loading {
    text-align: center;
    margin-top: 4rem;
    color: var(--muted);
}

/* "Referanser / videre lesning" — points to the authoritative docs rather than restating them. */
.references {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.ref-heading {
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.references ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.references li {
    margin: 0.15rem 0;
}

.references a {
    color: var(--accent);
    text-decoration: underline;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem 1.2rem;
    background: #fff3cd;
    border-top: 1px solid #ffe69c;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* The interactive form prints nothing; the summary is hidden on screen. */
.print-only {
    display: none;
}

@media print {
    body {
        background: #fff;
    }

    /* Brand stripe is screen-only; keep the printed document clean. */
    body::before {
        display: none;
    }

    .screen-only {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .print-summary {
        color: #000;
        font-size: 10.5pt;
        line-height: 1.4;
    }

    .print-summary .brand {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        margin-bottom: 0.3rem;
    }

    .print-summary .brand .logo {
        width: 34px;
        height: 34px;
    }

    .print-summary h1 {
        font-size: 15pt;
        margin: 0;
        color: var(--navy);
    }

    .project-line {
        margin: 0 0 0.15rem;
        color: #222;
    }

    .print-section {
        page-break-inside: avoid;
        margin-bottom: 0.3rem;
    }

    .ps-heading {
        font-weight: 700;
        margin: 0.45rem 0 0.15rem;
        color: var(--navy);
    }

    .print-summary ul {
        margin: 0 0 0.3rem;
        padding-left: 1.4rem;
        list-style: none;
    }

    .print-summary li {
        margin: 0.08rem 0;
    }

    .print-summary .references {
        margin-top: 0.8rem;
        padding-top: 0.5rem;
        border-top: 1px solid #999;
    }

    .print-summary .ref-heading {
        font-weight: 700;
        font-size: 10pt;
        color: #333;
        margin-bottom: 0.2rem;
    }

    .print-summary .references ul {
        list-style: disc;
        padding-left: 1.3rem;
        font-size: 9.5pt;
        color: #333;
    }

    /* Subtle in print — keep the link clickable but not bright-blue on paper. */
    .print-summary .references a {
        color: #333;
        text-decoration: underline;
    }

    .stamp {
        margin-top: 0.8rem;
        padding-top: 0.5rem;
        border-top: 1px solid #999;
        font-size: 9pt;
        color: #333;
        display: flex;
        gap: 2.5rem;
    }
}
