:root {
    --blue: #1b3a6b;
    --blue-dark: #142c52;
    --red: #e2001a;
    --ink: #1f2733;
    --muted: #6b7686;
    --line: #dfe4ec;
    --bg: #eef2f7;
    --ok: #1e8e58;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(20, 44, 82, .10);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0 16px calc(32px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #f6f8fb 0%, var(--bg) 320px);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.page { max-width: 880px; margin: 0 auto; }

/* ---------- Header ---------- */
.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 22px 0 16px;
    padding: 16px 24px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.brand__logo {
    width: min(320px, 54vw);
    height: auto;
}

.brand__partner {
    width: min(150px, 27vw);
    height: auto;
}

/* ---------- Card ---------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.card__head h1 {
    margin: 0 0 6px;
    font-size: clamp(22px, 4vw, 30px);
    color: var(--blue);
}

.lead { margin: 0; color: var(--muted); }

/* ---------- Voortgang ---------- */
.progress { margin: 24px 0 8px; }

.progress__bar {
    height: 6px;
    background: var(--line);
    border-radius: 99px;
    overflow: hidden;
}

.progress__fill {
    display: block;
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, var(--blue), #3a6fb5);
    border-radius: 99px;
    transition: width .35s ease;
}

.progress__steps {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.progress__step {
    flex: 1 1 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.progress__num {
    display: block;
    width: 28px; height: 28px;
    margin: 0 auto 6px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: #fff;
    line-height: 24px;
    font-weight: 700;
    transition: .2s;
}

.progress__step.is-active .progress__num { border-color: var(--blue); color: var(--blue); }
.progress__step.is-active .progress__label { color: var(--blue); font-weight: 600; }

.progress__step.is-done .progress__num {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-size: 0;
}

.progress__step.is-done .progress__num::after { content: "\2713"; font-size: 14px; }

.progress__mobile { display: none; margin: 10px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Stappen ---------- */
.step { display: none; padding-top: 18px; }
.step.is-active { display: block; animation: fade .25s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step__title { margin: 0 0 4px; font-size: 20px; color: var(--blue); }
.step__intro { margin: 0 0 18px; color: var(--muted); }

/* ---------- Velden ---------- */
.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.req { color: var(--red); }

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, .14);
}

textarea { resize: vertical; min-height: 120px; }

.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: right; }

.privacy {
    margin-top: 22px;
    padding: 12px 14px;
    background: #f5f8fc;
    border-left: 3px solid var(--blue);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: var(--muted);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Vragen ---------- */
.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafd;
    cursor: pointer;
    font-size: 14px;
}

.toggle input { width: 18px; height: 18px; accent-color: var(--blue); }

.questions.is-disabled { opacity: .4; pointer-events: none; }

.questions__head { display: none; }

.question {
    border: 0;
    margin: 0;
    padding: 14px 0;
}

.question + .question { border-top: 1px solid var(--line); }

.question__label {
    display: block;
    padding: 0;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
}

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale--duo { grid-template-columns: repeat(2, minmax(0, 160px)); }

.scale__option { position: relative; display: block; }

.scale__option input {
    position: absolute;
    opacity: 0;
    width: 100%; height: 100%;
    margin: 0;
    cursor: pointer;
}

.scale__pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 4px;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: .15s;
}

.scale__option input:hover + .scale__pill { border-color: #b9c6db; }

.scale__option input:focus-visible + .scale__pill {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, .18);
}

.scale__option input:checked + .scale__pill {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    font-weight: 600;
}

.question.has-error .scale__pill { border-color: var(--red); }

/* ---------- Foutmeldingen ---------- */
.error {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--red);
    min-height: 0;
}

.error:empty { display: none; }

.error--form {
    margin-top: 16px;
    padding: 10px 14px;
    background: #fdeaec;
    border-radius: 8px;
}

/* ---------- Knoppen ---------- */
.actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.btn {
    position: relative;
    min-height: 48px;
    padding: 0 26px;
    font: inherit;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: .15s;
}

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: #fff; color: var(--blue); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); }
.btn:disabled { opacity: .6; cursor: progress; }

.spinner { display: none; }

.btn.is-busy .btn__label { visibility: hidden; }

.btn.is-busy .spinner {
    display: block;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px; height: 20px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bedankt ---------- */
.done { text-align: center; padding: 30px 10px 10px; }

.done__icon {
    width: 68px; height: 68px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--ok);
    color: #fff;
    font-size: 36px;
    line-height: 68px;
}

.done h2 { margin: 0 0 8px; color: var(--blue); }
.done p { margin: 0 auto; max-width: 460px; color: var(--muted); }

.foot { text-align: center; padding: 20px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Desktop: tabelweergave ---------- */
@media (min-width: 760px) {
    .questions__head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) repeat(5, 92px);
        gap: 8px;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--line);
        font-size: 12px;
        font-weight: 700;
        color: var(--muted);
        text-align: center;
        text-transform: uppercase;
        letter-spacing: .3px;
    }

    .question {
        display: grid;
        grid-template-columns: minmax(0, 1fr) repeat(5, 92px);
        gap: 8px;
        align-items: center;
    }

    .question__label { margin: 0; font-weight: 500; }

    .scale {
        display: contents;
    }

    .scale__pill { font-size: 0; min-height: 40px; }

    .scale__pill::before {
        content: "";
        width: 20px; height: 20px;
        border: 2px solid #c3cddd;
        border-radius: 50%;
        transition: .15s;
    }

    .scale__option input:checked + .scale__pill::before {
        border-color: #fff;
        background: radial-gradient(#fff 38%, transparent 40%);
    }

    .question .error { grid-column: 1 / -1; }

    /* De 'Ja/Nee'-vraag blijft als knoppen tonen */
    .question--block { display: block; }
    .question--block .question__label { margin-bottom: 10px; font-weight: 600; }
    .question--block .scale { display: grid; }
    .question--block .scale__pill { font-size: 15px; }
    .question--block .scale__pill::before { display: none; }
}

@media (max-width: 759px) {
    body { padding-left: 12px; padding-right: 12px; }
    .card { padding: 20px 16px; }
    .progress__steps { display: none; }
    .progress__mobile { display: block; }

    .brand {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }

    .brand__logo { width: min(290px, 76vw); }
    .brand__partner { width: 116px; }

    .scale { grid-template-columns: repeat(2, 1fr); }
    .scale__option:first-child { grid-column: 1 / -1; }
    .scale--duo .scale__option:first-child { grid-column: auto; }

    .actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 14px 0 calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -10px 14px rgba(255, 255, 255, .95);
    }

    .btn { flex: 1 1 auto; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
