:root {
    --navy: #12334a;
    --navy-dark: #092235;
    --green: #78b928;
    --green-dark: #5c941e;
    --blue: #1876bd;
    --ink: #1f2933;
    --muted: #61707c;
    --line: #dfe6ea;
    --surface: #ffffff;
    --background: #eef5f4;
    --danger: #a32424;
    --danger-bg: #fff1f1;
    --shadow: 0 22px 60px rgba(13, 42, 59, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(120, 185, 40, 0.14), transparent 34rem),
        linear-gradient(180deg, #f7fbfa 0%, var(--background) 100%);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(1180px, calc(100% - 32px));
    min-height: 100px;
    margin: 0 auto;
    padding: 14px 0;
}

.brand img {
    display: block;
    width: 185px;
    max-width: 46vw;
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-link,
.home-link {
    border: 1px solid rgba(18, 51, 74, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--navy);
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(8px);
}

.language-link:hover,
.home-link:hover {
    border-color: var(--green);
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 8px auto 56px;
}

.page-shell-centered {
    display: grid;
    min-height: calc(100vh - 140px);
    place-items: center;
}

.form-card,
.thank-you-card {
    overflow: hidden;
    border: 1px solid rgba(18, 51, 74, 0.1);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-card {
    padding: clamp(24px, 5vw, 52px);
}

.form-intro {
    max-width: 820px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--green-dark);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    color: var(--navy-dark);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.08;
}

h2 {
    margin-bottom: 24px;
    color: var(--navy);
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.form-intro > p {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.05rem;
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    border: 1px solid #cfe2d8;
    border-radius: 14px;
    background: #f1faf5;
    padding: 14px 16px;
    color: #305747;
    font-size: 0.95rem;
}

.error-summary {
    margin: 24px 0;
    border: 1px solid #efc2c2;
    border-radius: 14px;
    background: var(--danger-bg);
    padding: 16px 20px;
    color: var(--danger);
}

.error-summary ul {
    margin: 8px 0 0;
    padding-left: 22px;
}

.progress-wrap {
    margin: 34px 0 18px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef0;
}

.progress-bar {
    width: 25%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--blue));
    transition: width 0.25s ease;
}

.step-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 30px;
}

.step-tab {
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8fafb;
    color: var(--muted);
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
}

.step-tab.is-active {
    border-color: var(--green);
    background: #f1f9e8;
    color: var(--navy-dark);
}

.required-note {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 0.87rem;
}

.form-step {
    display: none;
}

.form-step.is-active {
    display: block;
    animation: stepIn 0.23s ease;
}

@keyframes stepIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 21px 24px;
}

.field,
.field-group {
    min-width: 0;
}

.field-wide {
    grid-column: 1 / -1;
}

.field > span,
.field-group legend {
    display: block;
    margin-bottom: 8px;
    color: #263b49;
    font-size: 0.94rem;
    font-weight: 700;
}

.field-group {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 15px 17px 17px;
}

.field-group legend {
    max-width: 96%;
    margin: 0;
    padding: 0 6px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    display: block;
    width: 100%;
    border: 1px solid #cbd6dc;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--ink);
    padding: 13px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(24, 118, 189, 0.12);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid,
.field-group.is-invalid {
    border-color: #c93838;
}

.choice-row,
.checkbox-grid {
    display: flex;
    align-items: center;
    gap: 12px 22px;
}

.choice-row-wrap {
    flex-wrap: wrap;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checkbox-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    cursor: pointer;
}

.choice input,
.certification-box input {
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: var(--green-dark);
}

.subsection-title {
    margin-top: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 9px;
    color: var(--navy);
    font-size: 1.08rem;
    font-weight: 800;
}

.certification-box {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    border: 1px solid #cddac1;
    border-radius: 15px;
    background: #f8fbf5;
    padding: 17px;
    cursor: pointer;
}

.certification-box input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 34px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary,
.button-submit {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(92, 148, 30, 0.22);
}

.button-secondary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
}

.button-submit {
    display: none;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.thank-you-card {
    width: min(680px, 100%);
    padding: clamp(30px, 7vw, 62px);
    text-align: center;
}

.success-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    place-items: center;
    border-radius: 50%;
    background: #eaf7dc;
    color: var(--green-dark);
    font-size: 2.2rem;
    font-weight: 900;
}

.thank-lead {
    color: var(--muted);
    font-size: 1.1rem;
}

.application-number {
    margin: 28px 0;
    border: 1px dashed #b5c6cf;
    border-radius: 14px;
    background: #f8fafb;
    padding: 17px;
}

.application-number span,
.application-number strong {
    display: block;
}

.application-number span {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.application-number strong {
    margin-top: 5px;
    color: var(--navy);
    font-size: 1.35rem;
}

.thank-you-card .button {
    margin-top: 14px;
}

@media (max-width: 860px) {
    .step-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .site-header {
        align-items: flex-start;
        min-height: 90px;
    }

    .brand img {
        width: 150px;
    }

    .header-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 7px;
    }

    .language-link,
    .home-link {
        padding: 7px 12px;
        font-size: 0.84rem;
    }

    .page-shell {
        width: min(100% - 20px, 1120px);
        margin-top: 0;
    }

    .form-card {
        border-radius: 19px;
        padding: 22px 17px 25px;
    }

    .step-tabs {
        display: flex;
        overflow-x: auto;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
    }

    .step-tab {
        flex: 0 0 185px;
        min-height: 54px;
        scroll-snap-align: start;
    }

    .field-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .field-wide {
        grid-column: auto;
    }

    .checkbox-grid,
    .checkbox-grid-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 4;
        margin: 28px -17px -25px;
        background: rgba(255, 255, 255, 0.96);
        padding: 14px 17px;
        backdrop-filter: blur(12px);
    }

    .form-actions .button {
        flex: 1;
        padding-inline: 14px;
    }
}

@media (max-width: 390px) {
    .checkbox-grid,
    .checkbox-grid-four {
        grid-template-columns: 1fr;
    }
}

/* Secure document upload */
.page-shell-narrow { max-width: 860px; }
.document-card { max-width: 860px; margin: 0 auto; }
.document-identity-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}
.document-identity-summary > div {
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafb;
}
.document-identity-summary span,
.document-identity-summary strong { display: block; }
.document-identity-summary span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.document-upload-grid { margin-top: 10px; }
.upload-field {
    display: grid;
    gap: 10px;
    min-width: 0;
    min-height: 175px;
    align-content: center;
    padding: 18px;
    border: 2px dashed #bfd0d8;
    border-radius: 16px;
    background: #f8fbfc;
}
.upload-field > span { color: #263b49; font-size: .94rem; font-weight: 800; }
.upload-field input[type="file"] { width: 100%; }
.file-help { margin: 16px 0 20px; color: var(--muted); font-size: .9rem; }
.certification-choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid #cddac1;
    border-radius: 14px;
    background: #f8fbf5;
    cursor: pointer;
}
.certification-choice input { flex: 0 0 auto; margin-top: 4px; }
.document-submit-button {
    display: inline-flex;
    width: 100%;
    min-height: 54px;
    margin-top: 22px;
    border: 0;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}
.document-thank-card { max-width: 700px; }
.application-code-box {
    margin: 24px 0;
    padding: 16px;
    border: 1px dashed #b5c6cf;
    border-radius: 14px;
    background: #f8fafb;
}
.application-code-box span,
.application-code-box strong { display: block; }
.application-code-box span { color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.application-code-box strong { margin-top: 4px; color: var(--navy); font-size: 1.3rem; }
.thank-home-button { display: inline-flex; }
@media (max-width: 650px) {
    .document-identity-summary { grid-template-columns: 1fr; }
    .upload-field { min-height: 145px; }
}
