/* COAS Wizard house style (purple of the star, anthracite of the text). Brand and accent colour are
   overridden per company from JavaScript: brand for progress, selections and positive buttons,
   accent for negative buttons (Terug, Annuleren). */

/* ---------- Tokens ---------- */
:root {
    --color-primary: #292b31;
    --color-brand: #796cbf;
    --color-brand-text: #ffffff;
    --color-accent: #292b31;
    --color-accent-text: #ffffff;
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #242424;
    --color-text-light: #707070;
    --color-title: #171717;
    --color-danger: #dc2626;
    --color-danger-soft: #fef2f2;
    --color-danger-line: #f87171;
    --color-success: #16a34a;

    /* Kept for the ported diagrams and icons, which use the names of the previous version. */
    --color-hoofdkleur: var(--color-brand);
    --color-text-light-legacy: var(--color-text-light);

    --font-body: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Dosis", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --radius: 4px;
    --radius-lg: 8px;
    --space: 1rem;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--color-primary);
}

p {
    margin: 0;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.load-error {
    color: var(--color-danger);
    font-size: 0.875rem;
}

/* ---------- Buttons, cards, inputs ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, background-color 0.15s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--color-brand);
    color: var(--color-brand-text);
}

.btn--negative {
    background: var(--color-accent);
    color: var(--color-accent-text);
}

.btn--primary:hover:not(:disabled),
.btn--negative:hover:not(:disabled) {
    filter: brightness(0.88);
}

.btn--secondary {
    background: var(--color-border);
    color: var(--color-primary);
}

.btn--secondary:hover:not(:disabled) {
    background: #cbd5e1;
}

/* The shared modal uses these names. */
.btn--ghost {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.btn--danger {
    background: var(--color-danger);
    color: #ffffff;
}

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn--block {
    width: 100%;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1rem;
}

.input:focus,
.choice input:focus-visible,
.checkbox input:focus-visible,
.btn:focus-visible,
.info-button:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 1px;
}

textarea.input {
    resize: vertical;
}

/* ---------- Wizard layout ---------- */
.wizard {
    width: min(100% - 2rem, 80%);
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 0;
}

@media (max-width: 720px) {
    .wizard {
        width: calc(100% - 2rem);
    }
}

.wizard__header {
    margin-bottom: 1.5rem;
}

.wizard__logo {
    display: block;
    height: 2.25rem;
    width: auto;
}

.wizard__logo--company {
    height: 3rem;
}

.wizard__loading {
    padding: 4rem 0;
    text-align: center;
}

.wizard__heading {
    margin: 1.5rem 0 1rem;
}

.wizard__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-title);
}

.wizard__intro {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.wizard__step {
    display: grid;
    gap: 1.5rem;
}

.wizard__error {
    margin-top: 1rem;
    color: var(--color-danger);
    font-size: 0.875rem;
}

.wizard__nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.wizard__done,
.wizard__fatal {
    margin-top: 2rem;
    text-align: center;
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.wizard__done p {
    color: var(--color-text-light);
}

/* ---------- Progress ---------- */
.progress__labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.progress__track {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-border);
}

.progress__bar {
    width: 0;
    height: 100%;
    background: var(--color-brand);
    transition: width 0.3s ease;
}

/* ---------- Fields ---------- */
.step-fields {
    display: grid;
    gap: 1.5rem;
}

.step-fields > .field + .field {
    border-top: 1px solid var(--color-border);
    padding-top: 1.25rem;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field--sub {
    gap: 0.25rem;
}

.field--missing {
    border: 2px solid var(--color-danger-line) !important;
    background: var(--color-danger-soft);
    border-radius: var(--radius-lg);
    padding: 1rem !important;
}

.field__label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-title);
}

.field__label--sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.field__error {
    color: var(--color-danger);
    font-size: 0.875rem;
}

.field__counter {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-align: right;
}

.required-mark {
    color: var(--color-danger);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
}

.field-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-title);
}

.field-heading--sub {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}

.notice {
    padding: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--color-brand) 30%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--color-brand) 5%, transparent);
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* ---------- Groups and live drawings ---------- */
.group {
    display: grid;
    gap: 1rem;
}

.group--missing {
    border: 2px solid var(--color-danger-line);
}

.split {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

@media (max-width: 860px) {
    .split {
        grid-template-columns: minmax(0, 1fr);
    }
}

.preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.preview--text {
    justify-content: center;
    align-self: stretch;
    text-align: center;
}

.preview__image {
    height: auto;
    max-height: 560px;
    width: auto;
    max-width: 100%;
}

.preview__caption,
.preview__text,
.diagram-caption {
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-align: center;
}

.diagram-caption {
    margin-top: 0.25rem;
}

.diagram-svg {
    width: 100%;
    height: auto;
}

/* ---------- Heights ---------- */
.heights {
    display: grid;
    gap: 0.5rem;
}

.heights__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heights__remove {
    border: none;
    background: none;
    font-size: 1.25rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.heights__remove:hover {
    color: var(--color-danger);
}

.heights .btn {
    justify-self: start;
}

/* ---------- Choices ---------- */
.choice-list {
    display: grid;
    gap: 0.5rem;
}

.choice {
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice--selected {
    border-color: var(--color-brand);
    background: color-mix(in srgb, var(--color-brand) 5%, transparent);
}

.choice--row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.choice--row input {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.choice__label {
    font-size: 0.875rem;
}

.choice-tiles {
    display: grid;
    gap: 1rem;
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .choice-tiles--3,
    .choice-tiles--6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .choice-tiles--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .choice-tiles--6 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.choice-tiles--1 {
    grid-template-columns: minmax(0, 1fr);
}

.choice-tiles__cell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice--tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 0.75rem;
    text-align: center;
}

.choice--tile.choice--selected {
    border-width: 2px;
    padding: 11px;
}

.choice__check {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    padding: 2px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--color-surface) 90%, transparent);
    line-height: 0;
}

.choice__check input {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.choice--tile .choice__label {
    width: 100%;
    flex-shrink: 0;
    overflow-wrap: break-word;
}

.choice__icon {
    display: block;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    object-fit: contain;
    color: var(--color-text-light);
}

.choice__icon--small {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}

.choice-icon {
    width: 100%;
    height: 100%;
}

.choice-dropdown {
    display: grid;
    gap: 0.75rem;
}

.subfields {
    display: grid;
    gap: 0.75rem;
}

.subfields--list {
    margin-left: 1rem;
    padding: 0.25rem 0 0.25rem 1rem;
    border-left: 2px solid color-mix(in srgb, var(--color-brand) 30%, transparent);
}

.subfields--tiles,
.subfields--dropdown {
    width: 100%;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--color-brand) 30%, transparent);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-brand) 5%, transparent);
}

.subfields--missing {
    border-color: var(--color-danger-line);
    background: var(--color-danger-soft);
}

/* ---------- Info button and pop-up ---------- */
.info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    padding: 0;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background: none;
    color: var(--color-text-light);
    cursor: pointer;
    flex-shrink: 0;
}

.info-button:hover {
    color: var(--color-brand);
}

.info-button__icon {
    font-family: Georgia, serif;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.choice__info {
    margin-left: auto;
}

.choice__info--tile {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1;
    background: color-mix(in srgb, var(--color-surface) 90%, transparent);
}

.info-dialog {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 95vw;
    max-height: 90vh;
}

.info-dialog::backdrop {
    background: rgb(0 0 0 / 0.4);
}

.info-dialog__inner {
    width: min(28rem, 95vw);
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.info-dialog--long .info-dialog__inner {
    width: min(36rem, 95vw);
}

.info-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.info-dialog__title {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-title);
}

.info-dialog__close {
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-light);
    cursor: pointer;
}

.info-dialog__content--visual {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .info-dialog__content--visual {
        flex-direction: column-reverse;
    }

    .info-dialog__content--visual > * {
        width: 100% !important;
    }
}

.info-dialog__visual {
    flex-shrink: 0;
    max-width: 100%;
}

.info-dialog__visual img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.info-dialog__visual--icon {
    aspect-ratio: 1 / 1;
    color: var(--color-text-light);
}

.info-dialog__visual--many {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 1;
}

.info-dialog__visual--many img {
    flex: 1 1 0;
    min-width: 0;
}

.info-text {
    max-width: 100%;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.info-text strong {
    font-weight: 600;
    color: var(--color-title);
}

.info-text__blank {
    height: 1.25rem;
}

.info-text__indent {
    padding-left: 1rem;
}

/* ---------- Uploads ---------- */
.uploads {
    display: grid;
    gap: 0.75rem;
}

.upload-zone {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    padding: 1.5rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    text-align: center;
}

.upload-zone--over {
    border-color: var(--color-brand);
    background: color-mix(in srgb, var(--color-brand) 5%, transparent);
}

.upload-zone--busy {
    opacity: 0.7;
}

.upload-zone__title {
    font-weight: 500;
}

.upload-zone__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.upload-progress {
    display: grid;
    gap: 0.25rem;
}

.upload-progress__text {
    overflow: hidden;
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-messages__line {
    color: var(--color-danger);
    font-size: 0.875rem;
}

.upload-list {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.upload-list__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.upload-list__check {
    color: var(--color-success);
}

.upload-list__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-list__remove {
    margin-left: auto;
    border: none;
    background: none;
    font-size: 1.125rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.upload-list__remove:hover {
    color: var(--color-danger);
}

/* ---------- Overview ---------- */
.overview {
    display: grid;
    gap: 1.5rem;
}

.overview__section h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-title);
}

.overview__list {
    margin: 0;
    font-size: 0.875rem;
}

.overview__row {
    display: grid;
    gap: 0.125rem 1.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--color-border);
}

.overview__row:first-child {
    border-top: none;
}

@media (min-width: 640px) {
    .overview__row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.overview__question {
    color: var(--color-text-light);
}

.overview__question--level-1 { padding-left: 20px; }
.overview__question--level-2 { padding-left: 40px; }
.overview__question--level-3 { padding-left: 60px; }
.overview__question--level-4 { padding-left: 80px; }
.overview__question--level-5 { padding-left: 100px; }
.overview__question--level-6 { padding-left: 120px; }

.overview__answer {
    margin: 0;
    font-weight: 500;
    overflow-wrap: break-word;
}

/* ---------- Shared modal (Views/Shared/_Modal from Shared.Web) ---------- */
.modal {
    width: min(28rem, calc(100% - 2rem));
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.modal::backdrop {
    background: rgb(0 0 0 / 0.4);
}

.modal__inner {
    display: grid;
    gap: 0.75rem;
    padding: 1.5rem;
}

.modal__accent {
    width: 2.5rem;
    height: 4px;
    border-radius: 2px;
    background: var(--color-brand);
}

.modal__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-title);
}

.modal__message {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ---------- Error page ---------- */
.error-page {
    display: grid;
    gap: 1rem;
    justify-items: center;
    max-width: 32rem;
    margin: 4rem auto;
    padding: 0 1rem;
    text-align: center;
}

/* A group inside a group: a section of the same card. */
.group--nested {
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}
