/* ═══════════════════════════════════════════════════════════════════════
   CS5 — CyberSchijf van Vijf  |  Main Stylesheet
   Target: iPad (768px+), touch-first, zero hover states.

   Sections:
     1.  Design tokens
     2.  Reset & base
     3.  Shell layout
     4.  App header
     5.  Progress indicator
     6.  Loading screen
     7.  Shared step components (container, header, footer, buttons,
         cards, badges, feedback messages)
     8.  Step 0 — Unlock screen
     9.  Step 1 — Drag-and-drop ranking
     10. Step 2 — Weak question selection
     11. Step 3 — Top-3 priority selection
     12. Step 4 — Company info form
     13. Step 5 — Result screen
     14. Utilities
     15. Animations
   ═══════════════════════════════════════════════════════════════════════ */


/* ── SELF-HOSTED FONTS ───────────────────────────────────────────────── */

@font-face {
    font-family: 'Anton';
    src: url('font/Anton-Regular.woff2') format('woff2'),
         url('font/Anton-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* ── 1. DESIGN TOKENS ────────────────────────────────────────────────── */

:root {
    /* ─ Palette (client colours) ─ */
    --color-bg:              #f0f3fb;   /* very light blue-white */
    --color-surface:         #ffffff;
    --color-surface-2:       #f5f7ff;
    --color-surface-3:       #eaedfa;

    --color-primary:         #2e3192;   /* dark navy  */
    --color-primary-mid:     #363bab;
    --color-primary-light:   #9cc0e5;   /* sky blue   */

    --color-accent:          #f58643;   /* orange  — CTAs, highlights */
    --color-accent-yellow:   #fff200;   /* yellow  — logo accents     */

    --color-success:         #75c58a;   /* green (client palette)     */
    --color-success-bg:      #f0fbf5;
    --color-success-border:  #75c58a;

    --color-pink:            #e39dbb;   /* pink/rose (client palette) */

    --color-text-primary:    #1a1d4a;   /* deep navy-black            */
    --color-text-secondary:  #4a4f8a;   /* muted navy                 */
    --color-text-muted:      #7878aa;
    --color-text-inverse:    #ffffff;

    --color-border:          #dde2f4;
    --color-border-strong:   #b8c2e0;

    --color-error:           #c53030;
    --color-error-bg:        #fff5f5;
    --color-error-border:    #feb2b2;

    --color-warning:         #c05621;
    --color-warning-bg:      #fffaf0;
    --color-warning-border:  #fbd38d;

    /* ─ Five theme colours (client palette mapped to themes) ─
       These will be confirmed by the client alongside the real questions.
       Badges for dark backgrounds use white text; for light backgrounds
       use --color-primary (navy) for sufficient contrast.              */
    --theme-risico:          #9cc0e5;   /* light blue — Risico & organisatie   */
    --theme-techniek:        #f58643;   /* orange     — Techniek & beveiliging */
    --theme-mensen:          #2e3192;   /* dark blue  — Mens & gedrag          */
    --theme-incident:        #e39dbb;   /* pink       — Incident & reactie     */
    --theme-data:            #75c58a;   /* green      — Data & informatie      */

    /* ─ Typography ─ */
    --font-display: "Anton", "Impact", sans-serif;
    --font:         'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

    --text-xs:    0.75rem;    /*  12px */
    --text-sm:    0.875rem;   /*  14px */
    --text-base:  1rem;       /*  16px */
    --text-md:    1.125rem;   /*  18px */
    --text-lg:    1.25rem;    /*  20px */
    --text-xl:    1.5rem;     /*  24px */
    --text-2xl:   1.875rem;   /*  30px */
    --text-3xl:   2.25rem;    /*  36px */
    --text-4xl:   3rem;       /*  48px */

    /* ─ Spacing (4px grid) ─ */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.25rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;
    --sp-16: 4rem;

    /* ─ Shape ─ */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    /* ─ Shadows ─ */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.08);

    /* ─ Motion ─ */
    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:   cubic-bezier(0.5, 0, 0.75, 0);
    --dur-fast:  150ms;
    --dur-base:  250ms;
    --dur-slow:  400ms;

    /* ─ Layout ─ */
    --header-h:      64px;
    --content-max-w: 720px;
    --tap-min:       48px;   /* minimum touch target — WCAG 2.5.5 */
}


/* ── 2. RESET & BASE ──────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    height: 100%;
    font-family: var(--font);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg);
    line-height: 1.5;
    -webkit-touch-callout: none;    /* no callout on long press (iOS) */
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
}

/* Allow text selection in form controls only */
input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
    font-family: var(--font);
    font-size: var(--text-base);
}

/* Anton display font applied to headings */
h1, h2 {
    font-family: var(--font-display);
    line-height: 1.1;
    font-weight: 400;    /* Anton has only weight 400 */
    color: var(--color-text-primary);
}

h3, h4, h5 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-text-primary);
}

p { line-height: 1.6; }

ul, ol { list-style: none; }

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    background: none;
    touch-action: manipulation;
}

/* Remove blue tap flash on tappable elements */
a, button, [role="button"], label {
    -webkit-tap-highlight-color: transparent;
}

/* Keyboard focus ring — only for non-touch navigation */
:focus-visible {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) { outline: none; }


/* ── 3. SHELL LAYOUT ──────────────────────────────────────────────────── */

#shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;   /* iOS Safari dynamic viewport */
}

#app {
    flex: 1;
    min-height: 0;    /* required: allows flex children to shrink */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}


/* ── 4. APP HEADER ────────────────────────────────────────────────────── */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    background: var(--color-primary);
    padding: 0 var(--sp-6);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 100;
    transition:
        opacity   var(--dur-base) var(--ease-out),
        transform var(--dur-base) var(--ease-out);
}

/* Hidden during step 0 (unlock screen) */
.app-header--hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
    height: 0;
    overflow: hidden;
    padding: 0;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.header-logo-img {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.app-header__logo {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--color-text-inverse);
    letter-spacing: 1px;
    margin-left: 4px;
}

/* The "5" in "CS5" — orange accent */
.app-header__logo strong {
    color: var(--color-accent);
    font-style: normal;
}

.app-header__subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    white-space: nowrap;
    margin-left: 8px;
}


/* ── 5. PROGRESS INDICATOR ────────────────────────────────────────────── */

.app-header__progress {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.25);
    transition:
        background  var(--dur-base) var(--ease-out),
        transform   var(--dur-base) var(--ease-out);
}

.progress-dot--done   { background: rgba(255,255,255,0.55); }
.progress-dot--active { background: var(--color-accent); transform: scale(1.4); }

.app-header__step-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    min-width: 56px;
    text-align: right;
    flex: 1;
}


/* ── 6. LOADING SCREEN ────────────────────────────────────────────────── */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: var(--sp-6);
    padding: var(--sp-8);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    font-weight: 500;
}


/* ── 7. SHARED STEP COMPONENTS ────────────────────────────────────────── */

/* ─ Step wrapper ─ */

.step-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: var(--sp-6) var(--sp-6) 120px;
    max-width: var(--content-max-w);
    margin: 0 auto;
    width: 100%;
}

.step-header { margin-bottom: var(--sp-6); text-align: center; width: 100%; }

.step-eyebrow {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--color-primary-light);
    margin-bottom: var(--sp-2);
    font-family: var(--font);   /* eyebrow stays in system font */
}

.step-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-text-primary);
    margin-bottom: var(--sp-3);
}

.step-subtitle {
    font-family: var(--font);
    font-size: var(--text-md);
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.step3-callout {
    background: rgba(156, 192, 229, 0.18);
    border: 1px solid rgba(156, 192, 229, 0.4);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 8px auto 16px;
    text-align: center;
    max-width: 600px;
}
.step3-callout p {
    margin: 0;
    line-height: 1.5;
    font-size: var(--text-md);
    color: var(--color-text-secondary);
}
.step3-callout__action {
    font-weight: 600;
}

.step-content { flex: 1; }

.step-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 32px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    bottom: 0;
    z-index: 10;
}


/* ─ Buttons ─
   All min 48×48px touch target. NO hover states — touch-only app.   */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: var(--tap-min);
    padding: var(--sp-3) var(--sp-8);
    border-radius: var(--radius-full);
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    transition:
        transform   var(--dur-fast) var(--ease-out),
        box-shadow  var(--dur-fast) var(--ease-out),
        opacity     var(--dur-fast);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
    background: var(--color-primary-mid);
}

/* Orange CTA — used for the most important action per screen */
.btn-accent {
    background: var(--color-accent);
    color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.btn-accent:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-border-strong);
    color: var(--color-text-secondary);
}

.btn-outline:active {
    background: var(--color-surface-3);
    transform: scale(0.97);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.38;
    pointer-events: none;
    box-shadow: none;
}

.btn-full  { width: 100%; }
.btn-lg    { min-height: 60px; padding: var(--sp-4) var(--sp-10); font-size: var(--text-lg); }


/* ─ Cards ─ */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.card--interactive {
    cursor: pointer;
    touch-action: manipulation;
    transition:
        transform   var(--dur-fast) var(--ease-out),
        box-shadow  var(--dur-fast) var(--ease-out);
}

.card--interactive:active {
    transform: scale(0.985);
    box-shadow: none;
}

.card--selected {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(156,192,229,0.35);
}


/* ─ Theme badges ─
   Navy text on colour backgrounds for contrast.
   Exception: techniek uses navy background → white text.            */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--risico   { background: var(--theme-risico);   color: var(--color-primary); }
.badge--techniek { background: var(--theme-techniek); color: #fff; }
.badge--mensen   { background: var(--theme-mensen);   color: var(--color-primary); }
.badge--incident { background: var(--theme-incident); color: var(--color-primary); }
.badge--data     { background: var(--theme-data);     color: var(--color-primary); }

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 var(--sp-2);
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 700;
}


/* ─ Feedback messages ─ */

.msg {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
}

.msg--error   { background: var(--color-error-bg);   border: 1px solid var(--color-error-border);   color: var(--color-error); }
.msg--success { background: var(--color-success-bg); border: 1px solid var(--color-success-border); color: #276749; }
.msg--warning { background: var(--color-warning-bg); border: 1px solid var(--color-warning-border); color: var(--color-warning); }

.hidden { display: none !important; }

.divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--sp-5) 0;
}


/* ── 8. STEP 0 — UNLOCK SCREEN ────────────────────────────────────────── */

.unlock-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--sp-8) var(--sp-6);
    position: relative;
    /* Dark navy gradient using client palette primary */
    background: linear-gradient(160deg, var(--color-primary) 0%, #19205e 100%);
}

.unlock-logo {
    margin-bottom: var(--sp-12);
    text-align: center;
}

/* CS5 logotype — Anton for impact */
.unlock-logo__mark {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 400;
    color: #fff;
    letter-spacing: 2px;
    line-height: 1;
}

/* The "5" — bright yellow accent on dark background */
.unlock-logo__mark strong {
    color: var(--color-accent-yellow);
    font-style: normal;
}

.unlock-logo__tagline {
    font-size: var(--text-base);
    color: rgba(255,255,255,0.5);
    margin-top: var(--sp-3);
    letter-spacing: 0.5px;
}

/* Frosted-glass card */
.unlock-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-xl);
    padding: var(--sp-10) var(--sp-8);
    width: 100%;
    max-width: 420px;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.unlock-card__label {
    font-size: var(--text-md);
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    margin-bottom: var(--sp-5);
}

.unlock-input {
    width: 100%;
    min-height: 72px;
    background: rgba(255,255,255,0.10);
    border: 2px solid rgba(255,255,255,0.20);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: var(--text-3xl);
    font-weight: 700;
    text-align: center;
    letter-spacing: 10px;
    padding: var(--sp-4);
    margin-bottom: var(--sp-5);
    caret-color: var(--color-accent-yellow);
    transition: border-color var(--dur-base) var(--ease-out);
}

.unlock-input::placeholder {
    color: rgba(255,255,255,0.25);
    letter-spacing: 4px;
}

.unlock-input:focus {
    outline: none;
    border-color: var(--color-accent-yellow);
}

/* Applied by JS on wrong code — triggers shake animation */
.unlock-input--error {
    border-color: var(--color-error) !important;
    animation: shake 0.45s var(--ease-out);
}

/* Orange button with dark navy text — high contrast CTA */
.unlock-btn {
    width: 100%;
    min-height: 60px;
    background: var(--color-accent);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-lg);
    font-weight: 700;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--dur-fast), opacity var(--dur-fast);
}

.unlock-btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.unlock-error {
    color: #fc8181;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-top: var(--sp-4);
    min-height: 20px;
}

.unlock-footer-logo {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.unlock-logo-img {
    height: 32px;
    width: auto;
    display: block;
    opacity: 0.75;
}


/* ── 9. STEP 1 — DRAG & DROP THEME RANKING ────────────────────────────── */

.ranking-poles {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--sp-2);
}

.ranking-pole-label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ranking-pole-label--weak   { color: var(--color-accent); }
.ranking-pole-label--strong { color: var(--color-success); }

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-2) 0;
    user-select: none;
    -webkit-user-select: none;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    min-height: 68px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    touch-action: none;   /* JS handles all touch — required for drag */
    transition:
        box-shadow    var(--dur-fast) var(--ease-out),
        border-color  var(--dur-fast) var(--ease-out),
        opacity       var(--dur-fast);
}

.ranking-item:active { cursor: grabbing; }

/* Original item while its ghost clone is being dragged */
.ranking-item--dragging {
    opacity: 0.4;
    border-color: var(--color-primary-light);
}

/* Fixed-position ghost clone that follows the finger */
.ranking-item--ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.96;
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary-light);
    border-radius: var(--radius-md);
    cursor: grabbing;
}

/* Drop-zone highlight */
.ranking-item--over {
    border-color: var(--color-accent);
    background: rgba(245,134,67,0.06);
}

.ranking-item__pos {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-surface-3);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}

/* Thin vertical stripe matching the theme colour */
.ranking-item__bar {
    width: 5px;
    height: 36px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.ranking-item__bar--risico   { background: var(--theme-risico); }
.ranking-item__bar--techniek { background: var(--theme-techniek); }
.ranking-item__bar--mensen   { background: var(--theme-mensen); }
.ranking-item__bar--incident { background: var(--theme-incident); }
.ranking-item__bar--data     { background: var(--theme-data); }

.ranking-item__label {
    flex: 1;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-text-primary);
}

.ranking-item__handle {
    width: var(--tap-min);
    height: var(--tap-min);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: var(--text-xl);
    flex-shrink: 0;
}


/* ── 10. STEP 2 — THEME TABS + QUESTION SELECTION ──────────────────────── */

/* Pill-style tabs — wrap on narrow screens */
.theme-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.theme-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    background: transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 48px;
}

.theme-tab:active { transform: scale(0.96); }

.theme-tab .tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-tab .tab-label { letter-spacing: 0.2px; }

.theme-tab .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
}

.selection-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary-light);
    line-height: 1.5;
}

.selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    background: var(--color-surface-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-4);
    font-size: var(--text-sm);
}

.selection-summary__label { color: var(--color-text-secondary); }
.selection-summary__count { font-weight: 700; color: var(--color-primary); }

.question-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.question-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    min-height: var(--tap-min);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color  var(--dur-fast),
        background    var(--dur-fast);
}

.question-item--selected {
    border-color: var(--color-primary-light);
    background: rgba(46,49,146,0.04);
}

/* Custom checkbox */
.question-item__check {
    width: 26px;
    height: 26px;
    border: 2px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition:
        background      var(--dur-fast),
        border-color    var(--dur-fast);
}

.question-item--selected .question-item__check {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* SVG checkmark as data URI — no external image needed */
.question-item__check-icon {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity var(--dur-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.question-item--selected .question-item__check-icon { opacity: 1; }

.question-item__text {
    flex: 1;
    font-size: var(--text-base);
    color: var(--color-text-primary);
    line-height: 1.5;
}

.question-item__id {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-top: 3px;
}


/* Question card — 4-answer model (replaces old tap-select model) */
.q-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    transition:
        border-color var(--dur-fast),
        background   var(--dur-fast);
}

.q-card--answered {
    background: var(--color-surface-2);
}

.q-card__text {
    font-size: var(--text-base);
    color: var(--color-text-primary);
    line-height: 1.5;
    margin: 0 0 var(--sp-3) 0;
}

.q-card__answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
}

.answer-btn {
    display: block;
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    min-height: var(--tap-min);
    background: var(--color-surface-3);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        background   var(--dur-fast),
        border-color var(--dur-fast),
        color        var(--dur-fast);
}

.answer-btn:active { transform: scale(0.97); }

.answer-btn--selected {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}


/* ── 11. STEP 3 — TOP-3 PRIORITY SELECTION ────────────────────────────── */

/* Top slot indicators */
.priority-slots {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.priority-slot {
    flex: 1;
    min-height: 72px;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    transition: all 0.2s;
    overflow: hidden;
}

.priority-slot.filled { border-style: solid; }

.slot-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.slot-content {
    flex: 1;
    overflow: hidden;
}

.slot-theme {
    display: block;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-text {
    font-size: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slot-empty-text {
    font-size: 12px;
    color: var(--color-text-muted);
}

.slot-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Divider between slots and list */
.priority-divider {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 8px 0 16px;
    position: relative;
}

.priority-divider::before,
.priority-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--color-border);
}

.priority-divider::before { left: 0; }
.priority-divider::after  { right: 0; }

/* Priority list */
.priority-list {
    display: flex;
    flex-direction: column;
}

.priority-item {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--dur-fast), background var(--dur-fast);
    min-height: 56px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.priority-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.priority-theme-bar {
    width: 4px;
    align-self: stretch;
    flex-shrink: 0;
}

.priority-content {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.priority-theme-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.priority-text {
    font-size: 13px;
    line-height: 1.3;
    color: var(--color-text-primary);
}

.priority-rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 15px;
    color: #fff;
    margin-right: 12px;
    flex-shrink: 0;
}

.selection-count {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
}


/* ── 12. STEP 4 — COMPANY INFO FORM ───────────────────────────────────── */

.form-section { margin-bottom: var(--sp-6); }

.form-section-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--color-border);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    min-height: var(--tap-min);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color  var(--dur-fast),
        background    var(--dur-fast);
}

.radio-option:active { background: var(--color-surface-3); }

.radio-option--selected {
    border-color: var(--color-primary-light);
    background: rgba(46,49,146,0.04);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radio-circle {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--dur-fast);
}

.radio-option--selected .radio-circle { border-color: var(--color-primary); }

.radio-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0;
    transform: scale(0.5);
    transition:
        opacity    var(--dur-fast),
        transform  var(--dur-fast) var(--ease-out);
}

.radio-option--selected .radio-dot {
    opacity: 1;
    transform: scale(1);
}

.radio-label {
    flex: 1;
    font-size: var(--text-base);
    color: var(--color-text-primary);
}

/* Follow-up yes/no buttons — stacked vertically */
.followup-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1rem;
    width: 100%;
}
.followup-options .btn { width: 100%; }

/* Email opt-in */
.email-section { margin-top: var(--sp-6); }

.email-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    min-height: var(--tap-min);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: var(--sp-3);
    transition: border-color var(--dur-fast);
}

.email-toggle--active { border-color: var(--color-primary-light); }

.toggle-switch {
    width: 48px;
    height: 28px;
    background: var(--color-border-strong);
    border-radius: var(--radius-full);
    position: relative;
    flex-shrink: 0;
    transition: background var(--dur-base);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-base) var(--ease-out);
}

.email-toggle--active .toggle-switch            { background: var(--color-primary); }
.email-toggle--active .toggle-switch::after     { transform: translateX(20px); }

.email-toggle__label {
    flex: 1;
    font-size: var(--text-base);
    color: var(--color-text-primary);
}

.email-input-wrapper         { display: none; }
.email-input-wrapper--visible { display: block; }

.email-input {
    width: 100%;
    min-height: var(--tap-min);
    padding: var(--sp-3) var(--sp-4);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-surface);
    transition: border-color var(--dur-fast);
}

.email-input:focus {
    outline: none;
    border-color: var(--color-primary-light);
}

.email-input--error { border-color: var(--color-error); }

.field-error {
    font-size: var(--text-sm);
    color: var(--color-error);
    margin-top: var(--sp-1);
}


/* ── 13. STEP 5 — RESULT SCREEN ───────────────────────────────────────── */

.result-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-h));
    padding: 40px 20px;
}

.result-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 560px;
    width: 100%;
}

.result-icon {
    width: 96px;
    height: 96px;
    background: var(--color-success-bg);
    border: 3px solid var(--color-success-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-6);
    font-size: 48px;
    line-height: 1;
    animation: popIn var(--dur-slow) var(--ease-out) both;
}

.result-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-text-primary);
    margin-bottom: var(--sp-3);
}

.result-sub {
    font-size: var(--text-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.result-code-block {
    margin: 28px 0 16px;
    width: 100%;
}

.result-code-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

/* Horizontal digits row */
.result-code {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    animation: popIn var(--dur-slow) 120ms var(--ease-out) both;
}

.code-digit {
    width: 64px;
    height: 76px;
    background: var(--color-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--color-accent-yellow);
    box-shadow: 0 4px 12px rgba(46,49,146,0.2);
}

.result-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.result-countdown {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--sp-2);
}


/* ── 14. UTILITIES ────────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-small  { font-size: var(--text-sm); }
.text-bold   { font-weight: 700; }

.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }

.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2           { gap: var(--sp-2); }
.gap-4           { gap: var(--sp-4); }
.flex-1          { flex: 1; }
.w-full          { width: 100%; }

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}


/* ── 15. ANIMATIONS ───────────────────────────────────────────────────── */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-9px); }
    40%  { transform: translateX(9px); }
    60%  { transform: translateX(-6px); }
    80%  { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.65); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Applied by JS when a new step mounts */
.step-enter {
    animation: fadeSlideUp var(--dur-base) var(--ease-out) both;
}


/* ── RESPONSIVE — larger iPads (iPad Pro 11" / 12.9") ────────────────── */

@media (min-width: 1024px) {
    :root {
        --content-max-w: 800px;
        --text-base:     1.0625rem;
    }

    .ranking-item { min-height: 76px; }
}


/* ─────────────────────────────────────────────────────────────
   Step 2 — one-theme-at-a-time layout
   ───────────────────────────────────────────────────────────── */

/* Progress dots row */
.step2-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 auto 8px;
    width: 100%;
}
.step2-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: transparent;
    transition: all .2s;
}
.step2-progress-dot.active { transform: scale(1.3); }

/* "Thema X van 5" label */
.step2-theme-indicator {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* Alias for step-subtitle used in new step2 markup */
.step-sub {
    font-family: var(--font);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-top: var(--sp-2);
}

/* Question cards */
.question-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 8px;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.question-check {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid var(--color-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    font-weight: 700;
    transition: background .15s, border-color .15s;
}
.question-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.question-number {
    font-family: var(--font-display);
    font-size: 14px;
    flex-shrink: 0;
    min-width: 20px;
    padding-top: 2px;
    line-height: 1.4;
}
.question-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
}

/* Large button modifier */
.btn-large {
    padding: var(--sp-4) var(--sp-10);
    font-size: var(--text-md);
}
