﻿/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue-dark: #0d2b6e;
    --blue-mid: #1557b0;
    --blue-light: #1ea1d7;
    --green: #2e7d32;
    --green-light: #e8f5e9;
    --red: #c62828;
    --gray-100: #f5f6f8;
    --gray-200: #e9ebee;
    --gray-400: #9aa0ab;
    --gray-600: #5f6672;
    --gray-800: #2c2f36;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,.10);
    --transition: .2s ease;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 16px;
    line-height: 1.5;
}

/* ── Layout ───────────────────────────────────────────── */
.page-header {
    background: var(--gray-100);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
    border-bottom: 1px solid var(--gray-200);
}

    .page-header img {
        height: 70px;
        width: auto;
    }

    .page-header .header-content {
        flex-grow: 1; /* Allows this container to take up available space */
        text-align: center; /* Centers inline content (like the ImageButton) */
    }

    .page-header .btn-cancel {
        margin-left: auto; /* Pushes the cancel button to the far right */
    }

    /* Adjustments for the logo image button itself */
    /* You might want to remove any extra styling previously added for the dark background */
    .page-header .logo-btn {
        background: none; /* Ensure no residual background color */
        border: none; /* Ensure no residual border */
        padding: 0; /* Ensure no residual padding */
        box-shadow: none; /* Ensure no residual shadow */
    }

.page-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

/* ── Card ─────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 40px;
}

@media (max-width: 600px) {
    .card {
        padding: 24px 18px;
    }
}

/* ── Heading ──────────────────────────────────────────── */
.form-title {
    color: var(--blue-dark);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-title {
    color: var(--blue-dark);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--blue-light);
}

/* ── Progress bar ─────────────────────────────────────── */
.progress-wrap {
    margin-bottom: 28px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.progress-bar-bg {
    height: 8px;
    background: var(--gray-200);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-mid), var(--blue-light));
    border-radius: 99px;
    transition: width .5s ease;
}

/* ── Form fields ──────────────────────────────────────── */
.field-group {
    margin-bottom: 20px;
}

    .field-group label {
        display: block;
        font-size: .875rem;
        font-weight: 600;
        color: var(--gray-600);
        margin-bottom: 6px;
    }

        .field-group label .req {
            color: var(--red);
            margin-left: 3px;
        }

    .field-group input[type=text],
    .field-group input[type=tel],
    .field-group input[type=email],
    .field-group textarea,
    .field-group select {
        width: 100%;
        padding: 11px 14px;
        border: 1.5px solid var(--gray-200);
        border-radius: var(--radius);
        font-size: 1rem;
        color: var(--gray-800);
        background: var(--white);
        transition: border-color var(--transition), box-shadow var(--transition);
        appearance: none;
    }

        .field-group input[type=text]:focus,
        .field-group input[type=email]:focus,
        .field-group input[type=tel]:focus,
        .field-group textarea:focus,
        .field-group select:focus {
            outline: none;
            border-color: var(--blue-light);
            box-shadow: 0 0 0 3px rgba(30,161,215,.15);
        }

    .field-group textarea {
        resize: vertical;
        min-height: 120px;
    }

/* ── Radio buttons ────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

    .radio-group label {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        font-weight: 400;
        color: var(--gray-800);
        font-size: 1rem;
    }

    .radio-group input[type=radio] {
        width: 18px;
        height: 18px;
        accent-color: var(--blue-mid);
    }

/* ── Inline edit row (Step 4 review) ──────────────────── */
.review-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

    .review-field .rf-label {
        flex: 0 0 38%;
        font-size: .85rem;
        color: var(--gray-600);
        padding-top: 10px;
    }

    .review-field .rf-value {
        flex: 1;
    }

        .review-field .rf-value input,
        .review-field .rf-value select,
        .review-field .rf-value textarea {
            width: 100%;
            padding: 9px 12px;
            border: 1.5px solid var(--gray-200);
            border-radius: var(--radius);
            font-size: .95rem;
            background: var(--gray-100);
            color: var(--gray-800);
        }

            .review-field .rf-value input:not([disabled]),
            .review-field .rf-value select:not([disabled]),
            .review-field .rf-value textarea:not([disabled]) {
                background: var(--white);
                border-color: var(--blue-light);
            }

    .review-field .edit-btn {
        flex: 0 0 24px;
        width: 24px;
        height: 34px;
        margin-top: 5px;
        border: none;
        background: var(--gray-100);
        border-radius: 5%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background var(--transition);
        padding: 0;
    }

        .review-field .edit-btn:hover {
            background: var(--gray-200);
        }

        .review-field .edit-btn img {
            width: 16px;
            height: 16px;
        }

@media (max-width: 600px) {
    .review-field {
        flex-wrap: wrap;
    }

        .review-field .rf-label {
            flex: 0 0 100%;
            padding-top: 0;
        }
}

/* ── Divider ──────────────────────────────────────────── */
.section-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 28px 0;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-row {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background var(--transition), opacity var(--transition), transform var(--transition);
    min-width: 160px;
}

.btn-primary {
    background: var(--blue-dark);
    color: var(--white);
}

    .btn-primary:hover {
        background: var(--blue-mid);
    }

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

    .btn-secondary:hover {
        background: var(--gray-400);
        color: var(--white);
    }

.btn-submit {
    background: var(--green);
    color: var(--white);
}

    .btn-submit:hover:not([disabled]) {
        background: #1b5e20;
    }

    a.btn-submit[disabled], a.btn-submit.disabled, .btn-submit[disabled], .btn-submit.disabled {
        background: var(--gray-400) !important;
        cursor: not-allowed !important;
        opacity: .7 !important;
        color: var(--white) !important;
        pointer-events: none;
    }

.btn-cancel {
    background: transparent;
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
    padding: 10px 20px;
    min-width: auto;
}

    .btn-cancel:hover {
        border-color: var(--gray-400);
        color: var(--gray-800);
    }

/* ── Language selector (Step 1) ───────────────────────── */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.lang-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 0;
}

    .lang-card:hover {
        border-color: var(--blue-light);
        box-shadow: 0 4px 16px rgba(30,161,215,.15);
    }

    .lang-card img {
        width: 100%;
        max-width: 160px;
        height: auto;
        border-radius: 4px;
        margin-bottom: 12px;
    }

    .lang-card .lang-name {
        font-size: 1rem;
        color: var(--gray-800);
        margin-bottom: 12px;
        white-space: nowrap; /* Keep text on one line */
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .lang-card .btn {
        min-width: 180px; /* Increased slightly to accommodate "Klik om verder te gaan" */
        width: 100%; /* Keep it filling the card width */
        padding-left: 10px; /* Adjust padding if necessary for internal button text */
        padding-right: 10px; /* Adjust padding if necessary for internal button text */
    }

@media (max-width: 500px) {
    .lang-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Disclaimer checkbox ──────────────────────────────── */
.disclaimer-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--green-light);
    border: 1.5px solid #a5d6a7;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
}

    .disclaimer-row input[type=checkbox] {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        margin-top: 2px;
        accent-color: var(--green);
        cursor: pointer;
    }

    .disclaimer-row label {
        color: var(--blue-dark);
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
    }

/* ── Error messages ───────────────────────────────────── */
.alert-error {
    background: #fff3f3;
    border: 1.5px solid #ffcdd2;
    color: var(--red);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .9rem;
    display: none;
}

    .alert-error.visible {
        display: block;
    }

/* ── Email hint ───────────────────────────────────────── */
.field-hint {
    font-size: .8rem;
    color: var(--gray-600);
    margin-top: 5px;
}

/* ── Step 5 success ───────────────────────────────────── */
.success-panel {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: popIn .4s ease;
}

    .success-icon svg {
        width: 36px;
        height: 36px;
        fill: none;
        stroke: #fff;
        stroke-width: 3;
    }

@keyframes popIn {
    from {
        transform: scale(.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-panel h2 {
    color: var(--blue-dark);
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.success-panel p {
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* ── Submit overlay / spinner ─────────────────────────── */
#submitOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.8);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

    #submitOverlay.active {
        display: flex;
    }

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--gray-200);
    border-top-color: var(--blue-mid);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#submitOverlay p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blue-dark);
}

/* ── Utility ──────────────────────────────────────────── */
.hidden {
    display: none !important;
}

.hidden-lang-tracker { /* NEW CLASS for visual hiding, but in DOM */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.mt-4 {
    margin-top: 16px;
}

.mb-0 {
    margin-bottom: 0;
}

/* ── Attachments (Step 3) ─────────────────────────────── */
.field-group input[type=file] {
    display: block;
    margin-bottom: 10px;
    font-size: .9rem;
}

.bijlage-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bijlage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .875rem;
}

.bijlage-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bijlage-size {
    color: var(--gray-600);
    flex-shrink: 0;
}

.bijlage-remove {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-weight: 700;
    flex-shrink: 0;
    padding: 2px 6px;
}

    .bijlage-remove:hover {
        text-decoration: underline;
    }