/*
 * Psykologliv B2B visual baseline: docs/UX_AND_COPY.md.
 * System fonts, no third-party assets/scripts, no tracking.
 */
:root {
    color-scheme: light;
    --ink: #2c3e50;
    --brand: #315d72;
    --brand-hover: #244a5e;
    --brand-light: #6ba5c6;
    --blush: #f0b9b9;
    --blush-light: #fedfe0;
    --surface: #ffffff;
    --canvas: #f5f1f7;
    --border: #d8dde2;
    --muted: #556574;
    --focus: #245e99;
    --error: #8d2632;
    --radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: auto; }
body {
    margin: 0;
    min-width: 280px;
    background: var(--canvas);
    color: var(--ink);
    font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    overflow-wrap: break-word;
}
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem max(1rem, calc((100vw - 1120px)/2));
}
.site-header a {
    color: var(--ink);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 750;
    letter-spacing: -.02em;
}
.site-header span { color: var(--brand); font-weight: 550; }
.site-header a:hover { text-decoration: underline; }
main {
    width: min(100% - 2rem, 1120px);
    margin: clamp(1.5rem, 4vw, 3rem) auto 5rem;
}
main > :first-child { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.22; letter-spacing: -.025em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4vw, 3.05rem); margin: 0 0 1.15rem; }
h2 { font-size: clamp(1.35rem, 2.7vw, 1.8rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { max-width: 78ch; }
.lead { font-size: clamp(1.06rem, 1.6vw, 1.25rem); line-height: 1.65; max-width: 67ch; }
.eyebrow { text-transform: uppercase; font-size: .8rem; font-weight: 700; color: var(--brand); letter-spacing: .09em; }
a { color: var(--brand); text-underline-offset: .19em; }
a:hover { color: var(--brand-hover); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}
.skip-link {
    position: absolute; z-index: 100; top: -8rem; left: 1rem;
    padding: .75rem 1rem; background: var(--surface); color: var(--ink);
    border: 2px solid var(--focus); border-radius: .5rem;
}
.skip-link:focus { top: .75rem; }
main > section, main > article, main > form, main > table, main > dl,
.card, .hero, .notice, .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1rem, 2.5vw, 2rem);
    margin: 1.5rem 0;
}
main > section > :first-child, .card > :first-child { margin-top: 0; }
main > section section { padding-block: .75rem; border-top: 1px solid var(--border); }
main > section section:first-child { border-top: 0; }
.hero {
    background: #fffafa;
    border-color: #e8d1d7;
    padding: clamp(1.5rem, 4vw, 3rem);
}
.hero h1 { max-width: 19ch; }
.hero p { max-width: 64ch; }
.hero-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.button-link, button, input[type=submit], input[type=button] {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; max-width: 100%;
    padding: .68rem 1rem;
    border: 1px solid var(--brand); border-radius: .65rem;
    background: var(--brand); color: #fff;
    font: inherit; font-weight: 650; line-height: 1.3; text-align: center;
    cursor: pointer; text-decoration: none;
    transition: background-color .12s ease, border-color .12s ease;
}
.button-link:hover, button:hover, input[type=submit]:hover {
    color: #fff; background: var(--brand-hover); border-color: var(--brand-hover);
}
button:disabled, input:disabled { cursor: not-allowed; opacity: .65; }
.button-secondary { color: var(--brand); background: white; }
.button-secondary:hover { color: white; }
.steps, .feature-list { display: grid; gap: 1rem; padding: 0; margin: 1.25rem 0; list-style: none; }
.steps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); counter-reset: step; }
.steps li {
    counter-increment: step; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem;
}
.steps li::before {
    content: counter(step);
    display: grid; place-items: center; width: 2rem; height: 2rem;
    border-radius: 50%; background: var(--blush-light); color: var(--ink);
    font-weight: 750; margin-bottom: .5rem;
}
.checkout-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 55rem; }
.checkout-steps li { font-size: .9rem; min-height: 6rem; }
.checkout-steps li[aria-current=step] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 750; }
.feature-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.feature-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.feature-list strong { display: block; font-size: 1.15rem; margin-bottom: .25rem; }
.privacy-note { background: #fff5f6; border-left: 4px solid var(--brand); padding: 1rem 1.25rem; border-radius: .5rem; }
.portal-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem; margin: 1.25rem 0;
}
.portal-nav a {
    display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: .65rem .75rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: .7rem; text-decoration: none; font-weight: 650;
    text-align: center;
}
.portal-nav a[aria-current=page] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #ebf3f6; }
.portal-nav a:hover { border-color: var(--brand); background: #eff6f9; }
.subnav { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
nav[aria-label="Velg bedrift"] { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.25rem 0; }
nav[aria-label="Velg bedrift"] a { background: white; border: 1px solid var(--border); border-radius: .6rem; padding: .5rem .8rem; }
form { max-width: 760px; }
main > form { max-width: 760px; }
main section form, main li form {
    padding: 1rem; background: #fbfcfd; border: 1px solid var(--border); border-radius: .75rem; margin: 1rem 0;
}
/* Compact checkout cards: keep form controls and their results together. */
main > .checkout-panel { max-width: 36rem; padding: clamp(1rem, 2vw, 1.5rem); margin: 1rem 0; }
.checkout-steps.synthetic-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checkout-panel h2 { margin: 0 0 .9rem; }
.checkout-license-layout {
    display: grid;
    grid-template-columns: minmax(0, 35rem) minmax(0, 18rem);
    gap: 2rem;
    max-width: 55rem;
    align-items: start;
}
.checkout-license-layout > .checkout-panel {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1rem, 2vw, 1.5rem);
    margin: 0;
}
.checkout-license-help {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: .2rem 0 .2rem 1.2rem;
    border-left: 3px solid var(--border);
}
.checkout-license-help h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
.checkout-license-help p { margin: .65rem 0; }
.checkout-license-help ul { margin: .6rem 0; padding-left: 1.2rem; }
.checkout-license-help li { margin: .6rem 0; line-height: 1.5; }
.checkout-license-privacy { color: var(--muted); font-size: .9rem; }
.checkout-field-help { margin: .35rem 0 .65rem; color: var(--muted); font-size: .9rem; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]).checkout-seat-count {
    width: 10rem;
    max-width: 100%;
}
.checkout-price-term { margin: 0 0 .75rem; color: var(--muted); font-size: .9rem; }
.checkout-price-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; max-width: 25rem; margin: .75rem 0 1.25rem; }
.checkout-price-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.checkout-price-rows dt { font-weight: 400; }
.checkout-price-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkout-price-rows .checkout-price-total {
    margin-top: .5rem;
    padding-top: .8rem;
    border-top: 1px solid var(--border);
    font-weight: 750;
}
.checkout-price-rows .checkout-price-total dt { font-weight: 750; }
@media (max-width: 880px) {
    .checkout-license-layout { grid-template-columns: minmax(0, 1fr); max-width: 36rem; gap: 1.25rem; }
    .checkout-license-help, .checkout-license-layout > .checkout-panel { grid-column: 1; grid-row: auto; }
    .checkout-license-help { padding-left: 1rem; }
}

main .checkout-panel form { padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; max-width: none; }
main .checkout-panel form.checkout-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; align-items: center; }
.checkout-actions button { margin-top: 0; }
.checkout-company-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.5rem; margin: 0; }
.checkout-company-details > div { min-width: 0; }
.checkout-company-details dt { color: var(--muted); font-size: .9rem; }
.checkout-company-details dd { margin: 0; }
.checkout-price-summary { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.checkout-price-summary p { margin: .4rem 0; }
.checkout-price-summary .button-link { margin-top: .85rem; }
@media (max-width: 600px) { .checkout-company-details { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; margin: .85rem 0 .35rem; }
label:has(input[type=checkbox]) { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; margin: 1rem 0; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
textarea, select {
    width: 100%; max-width: 40rem; min-height: 44px;
    padding: .65rem .75rem; background: var(--surface);
    border: 1px solid #788995; border-radius: .55rem;
    color: var(--ink); font: inherit;
}
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 1.2rem; height: 1.2rem; margin-top: .2rem; flex-shrink: 0; }
input[aria-invalid=true], .input-validation-error { border-color: var(--error) !important; }
.field-validation-error, .validation-summary-errors { color: var(--error); font-weight: 600; }
.field-validation-error { display: block; margin: .25rem 0 .6rem; }
button, input[type=submit] { margin-top: .65rem; }
[role=status] { background: #ebf5f7; border-left: 4px solid var(--brand); padding: 1rem; border-radius: .45rem; }
[role=alert] { background: #fff1f2; border-left: 4px solid var(--error); padding: 1rem; border-radius: .45rem; }
dl { display: grid; grid-template-columns: minmax(9rem, 1fr) 2fr; gap: .45rem 1rem; }
dt { font-weight: 650; }
dd { margin: 0; overflow-wrap: anywhere; }
ul, ol { padding-left: 1.5rem; }
li { margin-block: .35rem; }
main li form { max-width: 40rem; }
table { width: 100%; border-collapse: collapse; background: white; font-variant-numeric: tabular-nums; }
caption { font-size: 1.15rem; font-weight: 700; text-align: left; margin-bottom: .75rem; }
th, td { padding: .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f1f5f7; font-weight: 750; }
td { overflow-wrap: anywhere; }
small { color: var(--muted); }
.footer-note { font-size: .9rem; color: var(--muted); margin-top: 2rem; }
@media (max-width: 760px) {
    main { width: min(100% - 1.25rem, 1120px); margin-top: 1.25rem; }
    .portal-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .checkout-steps, .checkout-steps.synthetic-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    dl { grid-template-columns: 1fr; gap: .05rem; }
    dd { margin: 0 0 .65rem; }
}
/* Eight invoice columns cannot remain readable at tablet widths. */
@media (max-width: 1180px) {
    .invoice-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0,0,0,0); white-space: nowrap;
    }
    .invoice-table, .invoice-table tbody { display: block; width: 100%; }
    .invoice-table tr {
        display: block; margin: 0 0 1rem; padding: .5rem 1rem;
        border: 1px solid var(--border); border-radius: .8rem;
        background: white;
    }
    .invoice-table td {
        display: flex; gap: .65rem; justify-content: space-between;
        align-items: baseline; padding: .65rem 0;
        text-align: right; overflow-wrap: anywhere;
    }
    .invoice-table caption { display: block; width: 100%; }
    .invoice-table td { min-width: 0; }
    .invoice-table td[data-label="Type"] { display: block; text-align: left; }
    .invoice-table td[data-label="Type"]::before {
        display: block; width: auto; margin-bottom: .15rem;
    }
    .invoice-table td::before {
        content: attr(data-label); font-weight: 700; font-size: .9rem;
        color: var(--ink); text-align: left; flex: 0 0 51%;
    }
}
@media (max-width: 420px) {
    .portal-nav { grid-template-columns: 1fr 1fr; }
    .checkout-steps li { font-size: .79rem; padding: .65rem; }
    .hero-actions .button-link { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Issue #339: bounded, public procurement documentation. */
.customer-docs { max-width: 1050px; }
.customer-docs > nav { margin-bottom: 1.5rem; color: var(--muted); }
.customer-doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 1rem; margin: 2rem 0; }
.customer-doc-card { background: white; border: 1px solid var(--border); border-radius: .75rem; padding: 1.35rem; }
.customer-doc-card h2 { margin: 0 0 .65rem; font-size: 1.25rem; }
.customer-doc-card p { margin: .4rem 0 .85rem; }
.customer-doc-version { color: var(--muted); font-size: .875rem; }
.customer-doc-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.customer-doc-actions a { font-weight: 650; }
.customer-docs article { max-width: 80ch; }
.customer-doc-section { margin-top: 1.75rem; }
.customer-doc-section h2 { margin-bottom: .7rem; }
.customer-doc-section p { line-height: 1.7; }
.customer-doc-bullet { margin-left: 1.25rem; }
.customer-doc-bullet::before { content: "• "; margin-left: -.85rem; }
.customer-doc-faq h3 { margin-top: 1.25rem; }
.customer-doc-checkout-link { font-size: .9rem; margin: .8rem 0 1.35rem; }
.customer-doc-download { margin: 1.2rem 0 1.8rem; }
@media (max-width: 600px) {
    .customer-doc-grid { grid-template-columns: 1fr; }
}


/* Keep original text and security-sensitive forms; trim redundant panel chrome. */
.home-features, .home-steps {
    background: transparent; border: 0; border-radius: 0; padding: 0;
}
.home-features h2, .home-steps h2 { margin-top: 0; }
main > section:not(.hero):not(.home-features):not(.home-steps):not(.checkout-panel) {
    max-width: 62rem;
    padding: clamp(1rem, 2vw, 1.5rem);
}
.portal-nav { max-width: 62rem; }
.portal-intro { max-width: 72ch; }
main input[type=number]:not(.checkout-seat-count) { width: min(100%, 12rem); }
.portal-documents-link { margin: -.5rem 0 1.25rem; font-size: .92rem; }

.portal-one-time-link {
    background: #f4fbfd;
    border-left: 4px solid var(--brand);
}
.portal-one-time-link button { margin-bottom: .5rem; }
.customer-doc-card { display: flex; flex-direction: column; }
.customer-doc-actions { margin-top: auto; padding-top: .6rem; }
.customer-doc-references { margin: .8rem 0 1.25rem; padding-left: 1.5rem; overflow-wrap: anywhere; }
