/* ═══════════════════════════════════════════════════════════════════════
   Atitex Portal — Complete Client Stylesheet
   Premium, hand-crafted design system. Mobile-first, fully responsive.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────────────────── */
:root {
    /* Brand palette */
    --navy: #1B3A5C;
    --gold: #C9A84C;
    --gold-light: #d4b965;
    --gold-dark: #b89a3e;
    --gold-subtle: rgba(201, 168, 76, 0.08);
    --muted-blue: #7A8FA6;
    --dark-navy: #112437;
    --soft-navy-bg: #EBF1F8;
    --cream: #F7F3EA;
    --white: #ffffff;

    /* Neutral scale — no pure black */
    --gray-50: #f8f9fb;
    --gray-100: #f1f3f6;
    --gray-200: #e2e6ec;
    --gray-300: #cdd3dc;
    --gray-400: #98a2b3;
    --gray-500: #6b7688;
    --gray-600: #4a5568;
    --gray-700: #364152;
    --gray-800: #1e293b;

    /* Semantic */
    --success: #0d9462;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #c27f0e;
    --warning-bg: #fefce8;
    --warning-border: #fde68a;
    --error: #c53030;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    /* Spacing scale (4px base) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Tinted shadows (navy-hue tinted, not grey) */
    --shadow-xs: 0 1px 2px rgba(17, 36, 55, 0.04);
    --shadow-sm: 0 1px 4px rgba(17, 36, 55, 0.06), 0 1px 2px rgba(17, 36, 55, 0.04);
    --shadow-md: 0 4px 12px rgba(17, 36, 55, 0.07), 0 1px 4px rgba(17, 36, 55, 0.04);
    --shadow-lg: 0 8px 24px rgba(17, 36, 55, 0.09), 0 2px 8px rgba(17, 36, 55, 0.04);
    --shadow-xl: 0 16px 40px rgba(17, 36, 55, 0.12), 0 4px 12px rgba(17, 36, 55, 0.05);
    --shadow-gold: 0 4px 16px rgba(201, 168, 76, 0.18);

    /* Typography */
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', 'Consolas', 'Monaco', 'Liberation Mono', monospace;

    /* Motion — design-eng spec */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 120ms;
    --duration-base: 160ms;
    --duration-moderate: 220ms;
    --duration-slow: 320ms;

    /* Layout */
    --container-max: 1200px;
    --container-narrow: 780px;
    --header-height: 60px;
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--dark-navy);
    background: var(--soft-navy-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; }
table { border-collapse: collapse; width: 100%; }

a {
    color: var(--navy);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--gold); }

/* ─── Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.25;
    color: var(--dark-navy);
    letter-spacing: -0.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

.text-muted { color: var(--muted-blue); }
.text-small { font-size: 0.8125rem; }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }

/* ─── Layout ────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--sp-4);
}
.container--narrow { max-width: var(--container-narrow); }

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.page-content {
    flex: 1;
    padding: var(--sp-6) 0 var(--sp-12);
}

@media (min-width: 640px) {
    .container { padding: 0 var(--sp-6); }
    .page-content { padding: var(--sp-8) 0 var(--sp-16); }
}
@media (min-width: 1024px) {
    .page-content { padding: var(--sp-10) 0 var(--sp-16); }
}

/* ─── Header ────────────────────────────────────────────────────────── */
.portal-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--duration-moderate) var(--ease-out);
}

.portal-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--sp-4);
}

.portal-header__logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    flex-shrink: 0;
}
.portal-header__logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-navy);
    letter-spacing: -0.02em;
}
.portal-header__logo-text span { color: var(--gold); }
.portal-header__logo .badge { margin-left: var(--sp-2); }

/* Nav links */
.portal-header__nav {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}
.portal-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}
.portal-header__nav-link:hover {
    background: var(--soft-navy-bg);
    color: var(--navy);
}
.portal-header__nav-link--active {
    background: var(--soft-navy-bg);
    color: var(--navy);
    font-weight: 600;
}
/* FIX 4: Logout knop — subtiel, niet knalrood */
.portal-header__nav-link--logout {
    color: var(--muted-blue);
    font-weight: 500;
    margin-left: var(--sp-2);
    background: none;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8125rem;
    padding: var(--sp-2) var(--sp-3);
    transition: all var(--duration-fast) var(--ease-out);
}
.portal-header__nav-link--logout:hover {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error-border);
    opacity: 1;
}

/* Mobile hamburger toggle */
.portal-header__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--dark-navy);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}
.portal-header__toggle:hover { background: var(--gray-100); }
.portal-header__toggle svg { width: 22px; height: 22px; }

/* Mobile nav */
@media (max-width: 767px) {
    .portal-header__toggle { display: flex; }
    .portal-header__nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: var(--sp-3) var(--sp-4);
        gap: var(--sp-1);
        z-index: 99;
    }
    .portal-header__nav--open { display: flex; }
    .portal-header__nav-link {
        width: 100%;
        padding: var(--sp-3) var(--sp-4);
        border-radius: var(--radius-md);
        font-size: 0.9375rem;
    }
    .portal-header__nav-link--logout { margin-left: 0; }
}

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--sp-6);
    transition: box-shadow var(--duration-moderate) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card--flat {
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}
.card--flat:hover { box-shadow: var(--shadow-md); border-color: var(--gray-200); }

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--gray-100);
    gap: var(--sp-4);
}
.card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--dark-navy);
}
.card__subtitle {
    color: var(--muted-blue);
    font-size: 0.8125rem;
    margin-top: var(--sp-1);
    line-height: 1.4;
}

@media (max-width: 639px) {
    .card { padding: var(--sp-4); border-radius: var(--radius-md); }
    .card__header { margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); }
}

/* ─── Login Page ────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--dark-navy) 0%, #1a3556 40%, var(--navy) 100%);
    padding: var(--sp-4);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(122, 143, 166, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--sp-8) var(--sp-6);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}
/* Gold accent line at top */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: var(--gold);
    border-radius: 0 0 var(--radius-xs) var(--radius-xs);
}

.login-card__logo { text-align: center; margin-bottom: var(--sp-6); }
.login-card__logo-text {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--dark-navy);
}
.login-card__logo-text span { color: var(--gold); }
.login-card__tagline {
    color: var(--muted-blue);
    font-size: 0.8125rem;
    margin-top: var(--sp-1);
    text-align: center;
    font-weight: 500;
}

.login-card__title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--sp-2);
    color: var(--dark-navy);
}
.login-card__desc {
    text-align: center;
    color: var(--muted-blue);
    font-size: 0.8125rem;
    margin-bottom: var(--sp-6);
    line-height: 1.5;
}

.login-card__form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.login-card__input {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
    color: var(--dark-navy);
    background: var(--gray-50);
    transition: all var(--duration-fast) var(--ease-out);
}
.login-card__input::placeholder {
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 400;
    color: var(--gray-400);
    font-size: 0.875rem;
}
.login-card__input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

@media (min-width: 640px) {
    .login-card { padding: var(--sp-10) var(--sp-8); }
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-5);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.btn--primary {
    background: var(--navy);
    color: var(--white);
}
.btn--primary:hover:not(:disabled) { background: var(--dark-navy); color: var(--white); }

.btn--gold {
    background: var(--gold);
    color: var(--white);
}
.btn--gold:hover:not(:disabled) {
    background: var(--gold-dark);
    color: var(--white);
    box-shadow: var(--shadow-gold);
}

.btn--outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--gray-200);
}
.btn--outline:hover:not(:disabled) {
    border-color: var(--navy);
    background: var(--soft-navy-bg);
    color: var(--navy);
}

.btn--ghost {
    background: transparent;
    color: var(--muted-blue);
    padding: var(--sp-2) var(--sp-3);
}
.btn--ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--navy);
}

.btn--danger {
    background: transparent;
    color: var(--error);
    border: 1.5px solid var(--error-border);
}
.btn--danger:hover:not(:disabled) { background: var(--error-bg); }

.btn--sm { padding: var(--sp-2) var(--sp-3); font-size: 0.8125rem; }
.btn--lg { padding: var(--sp-3) var(--sp-6); font-size: 0.9375rem; }
.btn--full { width: 100%; }
.btn--icon { padding: var(--sp-2); border-radius: var(--radius-sm); }
.btn--gold-ghost {
    background: transparent;
    color: var(--gold);
    padding: var(--sp-2) var(--sp-3);
    margin-left: var(--sp-1);
}
.btn--gold-ghost:hover:not(:disabled) {
    background: var(--cream);
    color: var(--gold-dark);
}

/* ─── Alerts ────────────────────────────────────────────────────────── */
.alert {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    line-height: 1.5;
    animation: alertSlideIn var(--duration-slow) var(--ease-out) both;
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert--error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }
.alert--success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.alert--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.alert--info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

/* ─── Status Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 3px var(--sp-2);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge--not-started { background: var(--gray-100); color: var(--gray-600); }
.badge--in-progress { background: var(--info-bg); color: var(--info); }
.badge--completed { background: var(--success-bg); color: var(--success); }
.badge--active { background: var(--success-bg); color: var(--success); }
.badge--archived { background: var(--gray-100); color: var(--gray-500); }
.badge--admin { background: var(--cream); color: var(--gold-dark); }
.badge--client { background: var(--soft-navy-bg); color: var(--navy); }

/* ─── Dashboard ─────────────────────────────────────────────────────── */
.dashboard-welcome {
    margin-bottom: var(--sp-6);
}
.dashboard-welcome__greeting {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-navy);
    margin-bottom: var(--sp-1);
    letter-spacing: -0.015em;
}
.dashboard-welcome__sub {
    color: var(--muted-blue);
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .dashboard-welcome__greeting { font-size: 1.75rem; }
    .dashboard-welcome { margin-bottom: var(--sp-8); }
}

/* Dashboard stats row */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}
.dashboard-stat {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    transition: border-color var(--duration-fast) var(--ease-out);
}
.dashboard-stat:hover { border-color: var(--gray-200); }
.dashboard-stat__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: var(--sp-3);
}
.dashboard-stat__icon--navy { background: var(--soft-navy-bg); color: var(--navy); }
.dashboard-stat__icon--gold { background: var(--cream); color: var(--gold-dark); }
.dashboard-stat__icon--success { background: var(--success-bg); color: var(--success); }
.dashboard-stat__value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-navy);
    line-height: 1.1;
    margin-bottom: 2px;
}
.dashboard-stat__label {
    font-size: 0.75rem;
    color: var(--muted-blue);
    font-weight: 500;
}

@media (min-width: 640px) {
    .dashboard-stats { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    gap: var(--sp-6);
}
.dashboard-grid--2col {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .dashboard-grid--2col { grid-template-columns: 5fr 3fr; }
}
@media (min-width: 1024px) {
    .dashboard-grid--2col { grid-template-columns: 3fr 2fr; }
}

/* ─── Questionnaire Cards (dashboard) ───────────────────────────────── */
.questionnaire-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}
.questionnaire-item {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
    transition: all var(--duration-fast) var(--ease-out);
}
.questionnaire-item:hover {
    background: var(--soft-navy-bg);
    border-color: var(--gray-200);
}

.questionnaire-item__icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}
.questionnaire-item__icon--pending {
    background: var(--soft-navy-bg);
    color: var(--navy);
}
.questionnaire-item__icon--progress {
    background: var(--info-bg);
    color: var(--info);
}
.questionnaire-item__icon--done {
    background: var(--success-bg);
    color: var(--success);
}
.questionnaire-item__icon--paused {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* Paused questionnaire item */
.questionnaire-item--paused {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}
.questionnaire-item--paused .questionnaire-item__name {
    color: var(--gray-500);
}
.questionnaire-item--paused .questionnaire-item__actions {
    pointer-events: auto;
}
.questionnaire-item__paused-text {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-style: italic;
    margin-top: var(--sp-1);
}
.badge--paused {
    background: var(--gray-100);
    color: var(--gray-500);
}
.btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.questionnaire-item__info {
    flex: 1;
    min-width: 0;
}
.questionnaire-item__name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark-navy);
    margin-bottom: var(--sp-1);
    line-height: 1.3;
}
.questionnaire-item__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-2);
}
.questionnaire-item__date {
    font-size: 0.75rem;
    color: var(--gray-400);
}
.questionnaire-item__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

@media (max-width: 639px) {
    .questionnaire-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-3);
    }
    .questionnaire-item__icon {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    .questionnaire-item__actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-2);
        margin-top: var(--sp-3);
    }
    .questionnaire-item__actions .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

/* ─── Progress Bar ──────────────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 5px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar--lg { height: 7px; border-radius: 4px; }

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy) 0%, var(--gold) 100%);
    border-radius: inherit;
    transition: width var(--duration-slow) var(--ease-out);
    min-width: 0;
}
.progress-bar__fill--complete {
    background: var(--success);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--gray-400);
    margin-top: var(--sp-1);
}

/* ─── File List ─────────────────────────────────────────────────────── */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}
.file-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
    transition: all var(--duration-fast) var(--ease-out);
}
.file-item:hover {
    background: var(--soft-navy-bg);
    border-color: var(--gray-200);
}

.file-item__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.file-item__icon--pdf { background: #fef2f2; color: #c53030; }
.file-item__icon--image { background: #ecfdf5; color: #0d9462; }
.file-item__icon--doc { background: #eff6ff; color: #2563eb; }
.file-item__icon--sheet { background: #ecfdf5; color: #0d9462; }
.file-item__icon--other { background: var(--gray-100); color: var(--gray-500); }

.file-item__info { flex: 1; min-width: 0; }
.file-item__name {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--dark-navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.file-item__meta {
    font-size: 0.6875rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}
.file-item__actions {
    display: flex;
    gap: var(--sp-1);
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .file-item { flex-wrap: wrap; padding: var(--sp-3); }
    .file-item__actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: var(--sp-2);
        border-top: 1px solid var(--gray-100);
        margin-top: var(--sp-1);
    }
}

/* ─── Empty States ──────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--sp-12) var(--sp-6);
    color: var(--muted-blue);
}
.empty-state__icon {
    font-size: 2rem;
    margin-bottom: var(--sp-4);
    opacity: 0.6;
    line-height: 1;
}
.empty-state__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: var(--sp-2);
}
.empty-state__text {
    font-size: 0.8125rem;
    color: var(--gray-400);
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ─── Questionnaire Wizard ──────────────────────────────────────────── */
.wizard {
    max-width: 780px;
    margin: 0 auto;
}

/* Progress bar */
.wizard-progress { margin-bottom: var(--sp-6); }
.wizard-progress__bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--sp-3);
}
.wizard-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--gold));
    border-radius: inherit;
    transition: width var(--duration-slow) var(--ease-out);
}
.wizard-progress__text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted-blue);
    font-weight: 500;
}

/* Step dots */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-6);
}
.wizard-step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-200);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    padding: 0;
}
.wizard-step:hover { background: var(--muted-blue); transform: scale(1.15); }
.wizard-step--active { background: var(--navy); transform: scale(1.3); }
.wizard-step--completed { background: var(--gold); }

@media (max-width: 479px) {
    .wizard-steps { gap: 6px; }
    .wizard-step { width: 8px; height: 8px; }
}

/* Save indicator */
.save-indicator {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 200;
    transition: all var(--duration-moderate) var(--ease-out);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    box-shadow: var(--shadow-md);
}
.save-indicator--visible { opacity: 1; transform: translateY(0); }
.save-indicator--saving { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.save-indicator--saved { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.save-indicator--error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }

/* FIX 2: Save indicator + wizard nav mobiel */
@media (max-width: 639px) {
    .save-indicator {
        bottom: var(--sp-3);
        right: var(--sp-3);
        left: auto;
        max-width: calc(100vw - 2rem);
        font-size: 0.75rem;
        padding: var(--sp-2) var(--sp-3);
        text-align: center;
    }
}

/* Wizard sections */
.wizard-section {
    display: none;
    animation: sectionFadeIn var(--duration-slow) var(--ease-out);
}
.wizard-section--active { display: block; }

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-section__header {
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-4);
    border-bottom: 2px solid var(--soft-navy-bg);
}
.wizard-section__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-navy);
    margin-bottom: var(--sp-1);
}
.wizard-section__desc {
    color: var(--muted-blue);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Question blocks */
.question-block {
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--gray-100);
}
.question-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.question-label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark-navy);
    margin-bottom: var(--sp-1);
    line-height: 1.5;
}
.question-helper {
    color: var(--muted-blue);
    font-size: 0.8125rem;
    margin-bottom: var(--sp-3);
    font-style: italic;
    line-height: 1.4;
}

/* Info text block (non-question informational element) */
.question-block--info {
    background: var(--soft-navy-bg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-5);
    border-bottom: none;
}
.question-label--info {
    color: var(--navy);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    margin-bottom: var(--sp-2);
}
.info-text-block {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.7;
}

/* Textarea large variant */
.form-textarea--lg {
    min-height: 140px;
}

/* Wizard nav */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 2px solid var(--gray-100);
    gap: var(--sp-4);
}
.wizard-nav__left,
.wizard-nav__right {
    display: flex;
    gap: var(--sp-3);
}

/* FIX 2: Wizard nav knoppen mobiel — grotere touch targets */
@media (max-width: 639px) {
    .wizard-nav {
        flex-direction: column-reverse;
        gap: var(--sp-2);
        padding: var(--sp-3) 0;
    }
    .wizard-nav__left,
    .wizard-nav__right { width: 100%; }
    .wizard-nav__left .btn,
    .wizard-nav__right .btn {
        flex: 1;
        justify-content: center;
        padding: var(--sp-3) var(--sp-4);
        font-size: 0.875rem;
        min-height: 44px;
    }
}

/* ─── Form Elements ─────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-4); }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--dark-navy);
    margin-bottom: var(--sp-2);
    letter-spacing: 0.01em;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--dark-navy);
    background: var(--white);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.08);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}
.form-textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.6;
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7688' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-4) center;
    padding-right: var(--sp-10);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    cursor: pointer;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-out);
    min-height: 44px;
}
.checkbox-item:hover { background: var(--gray-50); }

.checkbox-item input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1.5px solid var(--gray-300);
    border-radius: 5px;
    margin-top: 2px;
    cursor: pointer;
    position: relative;
    transition: all var(--duration-fast) var(--ease-out);
    background: var(--white);
}
.checkbox-item input[type="checkbox"]:checked {
    background: var(--navy);
    border-color: var(--navy);
}
.checkbox-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-item input[type="checkbox"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.12);
}

.checkbox-text {
    font-size: 0.875rem;
    color: var(--dark-navy);
    line-height: 1.5;
    padding-top: 1px;
}
.checkbox-anders-input {
    margin-top: var(--sp-2);
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    transition: all var(--duration-fast) var(--ease-out);
    display: none;
}
.checkbox-anders-input--visible { display: block; }
.checkbox-anders-input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.08);
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}
.radio-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    cursor: pointer;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-out);
    min-height: 44px;
}
.radio-item:hover { background: var(--gray-50); }

.radio-item input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1.5px solid var(--gray-300);
    border-radius: 50%;
    margin-top: 2px;
    cursor: pointer;
    position: relative;
    transition: all var(--duration-fast) var(--ease-out);
    background: var(--white);
}
.radio-item input[type="radio"]:checked { border-color: var(--navy); }
.radio-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--navy);
}
.radio-item input[type="radio"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.12);
}
.radio-text {
    font-size: 0.875rem;
    color: var(--dark-navy);
    line-height: 1.5;
    padding-top: 1px;
}

/* Three words */
.three-words {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-3);
}
.three-words__input {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
    color: var(--dark-navy);
    transition: all var(--duration-fast) var(--ease-out);
}
.three-words__input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}
.three-words__input::placeholder { color: var(--gray-400); font-size: 0.8125rem; }

@media (max-width: 639px) {
    .three-words { grid-template-columns: 1fr; }
}

/* Rating grid */
.rating-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.rating-grid__header {
    display: grid;
    grid-template-columns: 1fr repeat(5, 44px);
    align-items: center;
    padding: var(--sp-2) var(--sp-4);
    background: var(--soft-navy-bg);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--muted-blue);
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}
.rating-grid__row {
    display: grid;
    grid-template-columns: 1fr repeat(5, 44px);
    align-items: center;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--duration-fast) var(--ease-out);
}
.rating-grid__row:last-child { border-bottom: none; }
.rating-grid__row:hover { background: var(--gray-50); }
.rating-grid__label {
    font-size: 0.8125rem;
    color: var(--dark-navy);
    line-height: 1.4;
    padding-right: var(--sp-3);
}
.rating-grid__cell {
    display: flex;
    align-items: center;
    justify-content: center;
}
.rating-grid__cell input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-300);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}
.rating-grid__cell input[type="radio"]:checked { border-color: var(--gold); }
.rating-grid__cell input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
}
.rating-grid__cell input[type="radio"]:hover { border-color: var(--gold-light); }

/* FIX 1: Rating grid mobiel — labels zichtbaar per radio */
@media (max-width: 639px) {
    .rating-grid__header { display: none; }
    .rating-grid__row {
        display: flex;
        flex-direction: column;
        gap: var(--sp-3);
        padding: var(--sp-4);
    }
    .rating-grid__label {
        padding-right: 0;
        font-weight: 600;
        margin-bottom: var(--sp-1);
    }
    .rating-grid__cell {
        display: flex;
        align-items: center;
        gap: var(--sp-3);
        justify-content: flex-start;
    }
    .rating-grid__cell::before {
        content: attr(data-label);
        font-size: 0.75rem;
        color: var(--muted-blue);
        min-width: 20px;
        font-weight: 600;
    }
    .rating-grid__cell input[type="radio"] {
        width: 22px;
        height: 22px;
    }
    .rating-grid__cell input[type="radio"]:checked::after {
        width: 12px;
        height: 12px;
        top: 3px;
        left: 3px;
    }
}

/* Scale grid */
.scale-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.scale-grid__item {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    border: 1px solid var(--gray-100);
}
.scale-grid__labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--sp-3);
}
.scale-grid__label-left,
.scale-grid__label-right {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dark-navy);
    max-width: 40%;
}
.scale-grid__label-left { text-align: left; }
.scale-grid__label-right { text-align: right; }
.scale-grid__radios {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--sp-2);
}
.scale-grid__radio-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
}
.scale-grid__radio-num {
    font-size: 0.625rem;
    color: var(--gray-400);
    font-weight: 600;
}
.scale-grid__radios input[type="radio"] {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--gray-300);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    background: var(--white);
}
.scale-grid__radios input[type="radio"]:checked {
    border-color: var(--navy);
    background: var(--navy);
}
.scale-grid__radios input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--white);
    transform: translate(-50%, -50%);
}
.scale-grid__radios input[type="radio"]:hover { border-color: var(--navy); }

@media (max-width: 639px) {
    .scale-grid__labels { flex-direction: column; gap: var(--sp-1); }
    .scale-grid__label-left,
    .scale-grid__label-right { max-width: 100%; text-align: left; }
    .scale-grid__radios input[type="radio"] { width: 20px; height: 20px; }
}

/* ─── Upload Zone ───────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-moderate) var(--ease-out);
    background: var(--gray-50);
    position: relative;
}
.upload-zone:hover {
    border-color: var(--navy);
    background: var(--soft-navy-bg);
}
.upload-zone--dragover {
    border-color: var(--gold);
    background: var(--cream);
    border-style: solid;
    transform: scale(1.005);
}
.upload-zone__icon {
    font-size: 2rem;
    margin-bottom: var(--sp-3);
    color: var(--muted-blue);
    opacity: 0.7;
}
.upload-zone__text {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark-navy);
    margin-bottom: var(--sp-1);
}
.upload-zone__hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    line-height: 1.5;
}
/* FIX 3: File input bedekt hele zone zodat klikken werkt op mobiel */
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-progress { margin-top: var(--sp-4); display: none; }
.upload-progress--active { display: block; }
.upload-progress__bar {
    width: 100%;
    height: 5px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.upload-progress__fill {
    height: 100%;
    background: var(--gold);
    border-radius: inherit;
    transition: width var(--duration-fast);
    width: 0%;
}
.upload-progress__text {
    font-size: 0.6875rem;
    color: var(--muted-blue);
    margin-top: var(--sp-2);
    text-align: center;
    font-weight: 500;
}

/* ─── Data Tables ───────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--soft-navy-bg); }
.data-table th {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-blue);
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.data-table td {
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.8125rem;
    color: var(--dark-navy);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.data-table tbody tr { transition: background var(--duration-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--sp-4));
    padding: 0 var(--sp-4);
}
@media (min-width: 768px) {
    .table-responsive { margin: 0; padding: 0; }
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.portal-footer {
    padding: var(--sp-6) 0;
    text-align: center;
    font-size: 0.6875rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ─── Re-Edit Warning Banner ────────────────────────────────────────── */
.reedit-warning {
    background: var(--cream);
    border: 1px solid #F0E4C8;
    border-left: 3px solid var(--gold);
    color: var(--dark-navy);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    line-height: 1.5;
    animation: alertSlideIn var(--duration-slow) var(--ease-out) both;
}

#btn-reedit {
    transition: all var(--duration-base) var(--ease-out);
}
#btn-reedit:active { transform: scale(0.97); }
#wizard-nav-reedit { justify-content: space-between; }
#wizard-complete-reedit:active { transform: scale(0.97); }

/* ─── Utility Classes ───────────────────────────────────────────────── */
.mt-1 { margin-top: var(--sp-2); }
.mt-2 { margin-top: var(--sp-4); }
.mt-3 { margin-top: var(--sp-6); }
.mt-4 { margin-top: var(--sp-8); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--sp-2); }
.mb-2 { margin-bottom: var(--sp-4); }
.mb-3 { margin-bottom: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-8); }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: var(--sp-2); }
.gap-2 { gap: var(--sp-4); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }

/* Inline SVG in nav/text */
.icon-inline {
    display: inline;
    vertical-align: -2px;
}
.icon-empty {
    display: inline;
    opacity: 0.4;
    color: var(--muted-blue);
}

.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;
}

/* ─── Animations ────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-fade-in { animation: fadeIn var(--duration-slow) var(--ease-out); }
.animate-slide-up { animation: slideUp var(--duration-slow) var(--ease-out); }
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ─── Responsive Typography ─────────────────────────────────────────── */
@media (min-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}
@media (min-width: 1024px) {
    h1 { font-size: 2.25rem; }
}

/* ─── Mobile: Rating Grid & Scale Grid scroll wrappers ─────────────── */
@media (max-width: 640px) {
    /* Rating grid: horizontal scroll on mobile as fallback */
    .question-rating-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .question-rating-grid table {
        min-width: 400px;
    }

    /* Scale grid: horizontal scroll on mobile */
    .question-scale-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Scale radios: prevent squishing on narrow screens */
    .scale-grid__radios {
        min-width: 280px;
    }
}

/* ─── Print ─────────────────────────────────────────────────────────── */
@media print {
    .portal-header,
    .portal-footer,
    .wizard-nav,
    .save-indicator,
    .btn {
        display: none !important;
    }
    body { background: white; color: #112437; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    .wizard-section { display: block !important; page-break-inside: avoid; }
}