:root {
    --primary-900: #0c2d5e;
    --primary-800: #0f3a72;
    --primary-700: #1e40af;
    --primary-600: #1d4ed8;
    --accent-600: #0369a1;
    --accent-500: #0284c7;
    --success-600: #047857;
    --success-500: #059669;
    --warning-500: #d97706;
    --danger-500: #dc2626;
    --bg-50: #fafbfc;
    --bg-100: #f4f6f9;
    --bg-200: #e8edf3;
    --surface-100: rgba(255, 255, 255, 0.9);
    --surface-200: rgba(255, 255, 255, 0.98);
    --surface-solid: #ffffff;
    --text-900: #0a1628;
    --text-800: #1e293b;
    --text-700: #334155;
    --text-500: #64748b;
    --text-400: #94a3b8;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-serif: "Source Serif 4", serif;
    --field-border: #a9d3b3;
    --field-border-strong: #7db78a;
    --field-ring: rgba(125, 183, 138, 0.2);
    --line-300: #cbd5e1;
    --line-200: #e2e8f0;
    --line-100: #f1f5f9;
    --focus-ring: rgba(29, 78, 216, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.mobile-phone-field {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.mobile-phone-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border, var(--field-border));
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: #edf3f7;
    color: var(--navy, var(--text-700));
    font-weight: 600;
}

.mobile-phone-field .mobile-phone-number {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 9px;
}

.mobile-phone-field .mobile-phone-number.mobile-phone-with-country-code {
    border-radius: 0 9px 9px 0;
}

.mobile-phone-code[hidden] {
    display: none;
}

/* Read by screen readers but not shown, e.g. the membership route status and "(opens in a new tab)" */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-phone-field .mobile-phone-number[aria-invalid="true"] {
    border-color: var(--danger-500);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text-900);
    background: #f3f5f7;
    font-size: 15px;
    line-height: 1.5;
}

.modal-overlay {
    backdrop-filter: blur(5px);
}

.header-banner {
    background: #ffffff;
    border-bottom: 3px solid #0f766e;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    padding: 0.65rem 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.2rem 0;
    gap: 0.12rem;
}

.logo-container {
    margin-bottom: 0.1rem;
}

.header-text h1 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.25;
    font-weight: 700;
    font-family: var(--font-serif);
    letter-spacing: 0;
    color: var(--text-900);
}

.header-text p {
    margin: 0.2rem 0 0;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text-700);
}

.form-container {
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 2.5rem;
    margin-top: 0.75rem;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.1rem;
    margin: 0.75rem 0 1.35rem;
    padding: 1rem 1.25rem;
    background: #f7f9fa;
    border: 1px solid var(--line-200);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.step-number {
    width: 2.72rem;
    height: 2.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1.03rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-number.active {
    color: #ffffff;
    background: #0f766e;
    box-shadow: 0 5px 14px rgba(15, 118, 110, 0.24);
}

.step-number.inactive {
    color: var(--text-500);
    background: var(--bg-200);
    border: 1px solid var(--line-300);
}

.step-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-700);
}

.section-title {
    margin: 0 0 1.65rem;
    padding-left: 1rem;
    border-left: 4px solid #0f766e;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--text-900);
}

.form-group label {
    display: inline-block;
    margin-bottom: 0.46rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-700);
    letter-spacing: 0;
}

.required-star {
    color: var(--danger-500);
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 50px;
    padding: 0.82rem 0.95rem;
    border: 1px solid #aeb9c5;
    border-radius: 5px;
    background: #ffffff;
    color: var(--text-900);
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 400;
}

select.form-control {
    cursor: pointer;
    padding-right: 2.8rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
            linear-gradient(45deg, transparent 50%, var(--field-border-strong) 50%),
            linear-gradient(135deg, var(--field-border-strong) 50%, transparent 50%),
            linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    background-position:
            calc(100% - 18px) calc(50% - 2px),
            calc(100% - 12px) calc(50% - 2px),
            0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
}

.form-control::placeholder {
    color: var(--text-500);
}

.form-control:hover {
    border-color: #64748b;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

input.form-control:hover,
textarea.form-control:hover {
    background: var(--surface-solid);
}

select.form-control:hover {
    background-image:
            linear-gradient(45deg, transparent 50%, var(--field-border-strong) 50%),
            linear-gradient(135deg, var(--field-border-strong) 50%, transparent 50%),
            linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
}

.form-control:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.ethnicity-fields {
    margin: 0;
    padding: 0;
    border: 0;
}

.date-of-birth-field {
    max-width: 42rem;
}

.ethnicity-iwi-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.ethnicity-iwi-layout.has-iwi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.demographic-panel {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid #d8e1e7;
    border-top: 3px solid #0f766e;
    border-radius: 7px;
    background: #fbfcfc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.ethnicity-fields > legend {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-700);
}

.panel-heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.panel-heading-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #0f766e;
    background: #e7f4f1;
}

.panel-heading h3 {
    margin: 0;
    color: var(--text-800);
    font-size: 0.92rem;
    font-weight: 700;
}

.panel-heading-title {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.panel-heading p {
    margin: 0.08rem 0 0;
    color: var(--text-500);
    font-size: 0.78rem;
}

.ethnicity-row {
    display: grid;
    grid-template-columns: minmax(8rem, 0.75fr) minmax(12rem, 1.35fr) 42px;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.55rem;
}

.ethnicity-row[hidden],
.add-ethnicity-button[hidden] {
    display: none;
}

.ethnicity-row label {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 500;
    color: #475569;
}

.ethnicity-row:first-of-type label::before {
    content: "*";
    margin-right: 0.25rem;
    color: var(--danger-500);
    font-weight: 700;
}

.ethnicity-row .form-control {
    min-height: 42px;
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
}

.add-ethnicity-button,
.delete-ethnicity-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 38px;
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.add-ethnicity-button {
    width: fit-content;
    margin-top: 0.2rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #0f766e;
    color: #0f766e;
    background: #ffffff;
}

.add-ethnicity-button:hover {
    color: #ffffff;
    background: #0f766e;
}

.delete-ethnicity-button {
    width: 42px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #d5dde5;
    color: #b42318;
    background: #ffffff;
}

.delete-ethnicity-button:hover {
    border-color: #f0b4ae;
    background: #fff5f4;
}

.field-error {
    margin: 0.35rem 0 0;
    color: var(--danger-500);
    font-size: 0.82rem;
}

.submission-error {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid #f1a7a0;
    border-radius: 6px;
    color: #8f1d14;
    background: #fff4f2;
}

.submission-error p {
    margin: 0;
}

.validation-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid #f0a29b;
    border-left: 4px solid #b42318;
    border-radius: 6px;
    color: #7a271a;
    background: #fff4f2;
}

.validation-summary > i {
    margin-top: 0.1rem;
    color: #b54708;
}

.validation-summary h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.validation-summary ul {
    margin: 0.65rem 0 0;
    padding-left: 1.25rem;
}

.validation-summary li + li {
    margin-top: 0.35rem;
}

.validation-summary:focus {
    outline: 3px solid rgba(0, 127, 112, 0.25);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.application-route {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
    overflow: visible;
    border: 1px solid #bdd8d1;
    border-top: 5px solid #0f766e;
    border-radius: 0.85rem;
    background:
            radial-gradient(circle at 92% 8%, rgba(195, 148, 61, 0.16), transparent 11rem),
            linear-gradient(145deg, #f2faf8 0%, #ffffff 72%);
    box-shadow: 0 10px 24px rgba(23, 63, 54, 0.08);
}

#route-questions,
.route-summary {
    padding: 1.6rem;
}

.route-intro {
    max-width: 46rem;
}

.route-intro h2,
.route-intro p,
.route-summary h2 {
    margin: 0;
}

.route-intro h2,
.route-summary h2 {
    color: #173f36;
    font-family: var(--font-serif);
    font-size: 1.45rem;
    line-height: 1.25;
}

.route-intro p {
    margin-top: 0.4rem;
    color: #526861;
}

.route-eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    color: #087467;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.decision-step {
    min-width: 0;
    margin: 1.35rem 0 0;
    padding: 1.25rem 0 0;
    border: 0;
    border-top: 1px solid #d7e5e1;
    animation: route-step-in 220ms ease-out both;
}

.decision-step legend {
    width: 100%;
    padding: 0;
    color: #193a32;
    font-size: 1.03rem;
    font-weight: 750;
}

.decision-hint {
    margin: 0.25rem 0 0.8rem;
    color: #60736d;
    font-size: 0.86rem;
}

.decision-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.8rem;
}

#occupation-entry-options {
    margin-bottom: 1rem;
}

.decision-options-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.decision-options-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.decision-option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-height: 4.8rem;
    padding: 0.85rem;
    border: 1px solid #bfcfc9;
    border-radius: 0.65rem;
    color: #29473f;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.decision-option:hover {
    border-color: #4e998c;
    transform: translateY(-1px);
}

.decision-option:has(input:checked) {
    border-color: #0f766e;
    background: #eaf7f3;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14);
}

.decision-option:has(input:focus-visible) {
    outline: 3px solid rgba(29, 78, 216, 0.24);
    outline-offset: 2px;
}

.decision-option input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.12rem;
    accent-color: #0f766e;
}

.decision-option span,
.decision-option strong,
.decision-option small {
    display: block;
}

.decision-option strong {
    color: #173f36;
    line-height: 1.25;
}

.decision-option small {
    margin-top: 0.25rem;
    color: #60736d;
    font-size: 0.78rem;
    line-height: 1.3;
}

/* Membership choice cards: each lists what that membership includes. */
.membership-card strong {
    font-size: 1rem;
}

.membership-benefits {
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
    list-style: disc;
    color: #3f5751;
    font-size: 0.82rem;
    line-height: 1.45;
}

.membership-benefits li + li {
    margin-top: 0.15rem;
}

.decision-option-compact {
    min-height: 4.2rem;
}

.route-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    animation: route-step-in 240ms ease-out both;
}

.route-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 2rem;
    margin: 0.85rem 0 0;
}

.route-summary-list div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem;
}

.route-summary-list dt {
    color: #60736d;
    font-size: 0.84rem;
    font-weight: 650;
}

.route-summary-list dt::after {
    content: ':';
}

.route-summary-list dd {
    margin: 0;
    color: #173f36;
    font-size: 0.88rem;
    font-weight: 700;
}

.change-route-button {
    flex: 0 0 auto;
    padding: 0.65rem 0.9rem;
    border: 1px solid #0f766e;
    border-radius: 0.45rem;
    color: #0b675f;
    font-weight: 700;
    background: #ffffff;
    cursor: pointer;
}

.change-route-button:hover,
.change-route-button:focus-visible {
    color: #ffffff;
    background: #0f766e;
}

.route-error {
    margin-top: 1rem;
}

.route-help {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e3ad6e;
    border-left: 4px solid #c56d16;
    border-radius: 0.55rem;
    color: #743b0b;
    background: #fff8ed;
}

.reference-search {
    position: relative;
}

.reference-suggestions {
    position: absolute;
    z-index: 70;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    max-height: 15rem;
    overflow-y: auto;
    border: 1px solid #bfcfc9;
    border-radius: 0.55rem;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(23, 63, 54, 0.14);
}

.reference-suggestions button {
    display: block;
    width: 100%;
    padding: 0.72rem 0.85rem;
    border: 0;
    border-bottom: 1px solid #e2ebe8;
    color: #29473f;
    text-align: left;
    background: #ffffff;
    cursor: pointer;
}

.reference-suggestions button:last-child {
    border-bottom: 0;
}

.reference-suggestions button:hover,
.reference-suggestions button:focus-visible {
    color: #0b675f;
    background: #eaf7f3;
}

.reference-suggestions [role="option"].is-active,
#workplace-suggestions [role="option"].is-active {
    color: #0b675f;
    background: #eaf7f3;
}

.lookup-status {
    min-height: 1.25rem;
    margin: 0.35rem 0 0;
    color: var(--text-500);
    font-size: 0.8rem;
    line-height: 1.4;
}

.lookup-status.lookup-error {
    color: var(--danger-500);
}

.icon-help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    cursor: pointer;
}

.icon-help-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.field-label {
    display: block;
    margin-bottom: 0.46rem;
    color: var(--text-700);
    font-size: 0.9rem;
    font-weight: 600;
}

.membership-result {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.7rem 0.85rem;
    border: 1px solid #b7d5cd;
    border-radius: 0 0.45rem 0.45rem 0;
    color: #175a4e;
    font-weight: 700;
    background: #edf8f5;
}

#membership-application:not([hidden]) {
    animation: application-in 280ms ease-out both;
}

@keyframes route-step-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes application-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .decision-step,
    .route-summary,
    #membership-application:not([hidden]) {
        animation: none;
    }
}

.payment-section {
    padding: 1.5rem;
    border: 1px solid #c7ddd8;
    border-radius: 0.85rem;
    background: linear-gradient(145deg, #f4fbf9, #ffffff 65%);
}

.payment-section-heading p {
    margin: -0.55rem 0 1.25rem;
    color: #596b66;
    font-size: 0.85rem;
}

.field-hint {
    display: block;
    margin: 0.4rem 0 0;
    color: #596b66;
    font-size: 0.85rem;
    line-height: 1.45;
}

.membership-result-hint {
    margin: 0.35rem 0 0;
}

.payment-method-step {
    margin-bottom: 1.5rem;
    padding: 1.35rem;
    border: 1px solid #bdd8d1;
    border-radius: 0.85rem;
    background: linear-gradient(145deg, #f2faf8, #ffffff 72%);
}

.payment-method-step legend {
    color: #173f36;
    font-family: var(--font-serif);
    font-size: 1.2rem;
}

.payment-availability {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.8rem;
    border-left: 3px solid #c3943d;
    color: #4f5f59;
    font-size: 0.86rem;
    line-height: 1.45;
    background: #fff9ec;
}

.payment-availability a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.payment-step {
    display: inline-block;
    margin-bottom: 0.4rem;
    color: #007f70;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stripe-field {
    min-height: 46px;
    margin-top: 0.25rem;
    padding: 0.78rem 0.85rem;
    border: 1px solid #cbd5d1;
    border-radius: 0.45rem;
    background: #fff;
}

.stripe-field.StripeElement--focus {
    border-color: #007f70;
    box-shadow: 0 0 0 3px rgba(0, 127, 112, 0.13);
}

.stripe-field.StripeElement--invalid { border-color: #c2413b; }

.server-field-error {
    margin-top: 0.35rem;
    color: #b42318;
    font-size: 0.82rem;
}

.authority-terms {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #c7ddd8;
    color: #334b44;
    font-size: 0.86rem;
    line-height: 1.6;
}

.authority-terms h3 { margin: 0 0 0.65rem; color: #173b33; font-size: 1rem; }
.authority-terms p { margin: 0.45rem 0; }
.authority-terms ol { margin: 0.65rem 0 0; padding-left: 1.25rem; }
.authority-terms li { margin: 0.35rem 0; }

.additional-iwi-list {
    display: grid;
    gap: 0.7rem;
}

.iwi-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
}

.iwi-entry .form-control {
    margin: 0;
}

.add-iwi-button,
.delete-iwi-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 38px;
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.add-iwi-button {
    padding: 0.55rem 0.85rem;
    border: 1px solid #0f766e;
    color: #0f766e;
    background: #ffffff;
}

.add-iwi-button:hover {
    color: #ffffff;
    background: #0f766e;
}

.delete-iwi-button {
    padding: 0.55rem 0.7rem;
    border: 1px solid #d5dde5;
    color: #b42318;
    background: #ffffff;
}

.delete-iwi-button:hover {
    border-color: #f0b4ae;
    background: #fff5f4;
}

@media (max-width: 640px) {
    .form-container {
        padding: 1.25rem;
    }

    .ethnicity-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        margin-bottom: 0.9rem;
    }

    .ethnicity-additional-row {
        grid-template-columns: 1fr auto;
    }

    .ethnicity-additional-row label {
        grid-column: 1 / -1;
    }

    .ethnicity-iwi-layout,
    .ethnicity-iwi-layout.has-iwi {
        grid-template-columns: 1fr;
    }

    .demographic-panel {
        padding: 1rem;
    }

    .delete-iwi-button span {
        display: none;
    }
}

input.form-control:focus,
textarea.form-control:focus {
    background: var(--surface-solid);
}

select.form-control:focus {
    background-image:
            linear-gradient(45deg, transparent 50%, var(--field-border-strong) 50%),
            linear-gradient(135deg, var(--field-border-strong) 50%, transparent 50%),
            linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.form-control:disabled,
.form-control[readonly] {
    background: #f3f7fb;
}

.input-icon {
    background: linear-gradient(180deg, #edf4f9 0%, #e3edf7 100%);
    color: #35506b;
    border-color: #b8c6d8;
}

.info-box {
    background: #f7faf9;
    border: 1px solid var(--line-200);
    border-left: 4px solid #0f766e;
    border-radius: 8px;
    padding: 1.18rem 1.22rem;
    margin-bottom: 1.05rem;
    box-shadow: var(--shadow-sm);
}

.info-box h3 {
    margin: 0;
    font-weight: 700;
    color: var(--text-900);
}

.btn-primary {
    border: 0;
    border-radius: 6px;
    padding: 0.96rem 2.45rem;
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0;
    background: #0f766e;
    box-shadow: 0 5px 16px rgba(15, 118, 110, 0.25);
    transition: all 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #115e59;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.3);
}

.btn-secondary {
    border: 0;
    border-radius: 6px;
    padding: 0.73rem 1.36rem;
    color: #ffffff;
    font-weight: 600;
    background: #334155;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.2);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    background: #1e293b;
    box-shadow: 0 6px 16px rgba(51, 65, 85, 0.26);
}

.modal-content {
    border-radius: 8px;
    border: 1px solid var(--line-200);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: #0f766e;
    color: #ffffff;
    border-radius: 8px 8px 0 0;
    padding: 1.2rem 1.35rem;
}

.spinner-container {
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(8px);
}

.spinner-box {
    background: #ffffff;
    border: 1px solid var(--line-200);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.submission-progress-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(calc(100% - 2rem), 32rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 2rem;
    gap: 1rem;
    text-align: center;
}

.submission-progress-box > * {
    flex-shrink: 0;
    max-width: 100%;
}

.submission-progress-box h2 {
    margin: 0 0 0.75rem;
    color: var(--navy);
    font-size: 1.35rem;
    font-weight: 700;
}

.submission-progress-box p {
    margin: 0;
    line-height: 1.6;
}

.submission-progress-guidance {
    padding: 0.85rem;
    border-radius: 6px;
    background: #f1f5f9;
    font-weight: 600;
}

.submission-progress-elapsed,
.submission-progress-confirmation {
    font-size: 0.875rem;
}

.spinner-icon {
    color: var(--primary-700);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-800) 0%, var(--primary-600) 100%);
}

.address-autocomplete-wrapper {
    position: relative;
}

.address-suggestions,
#workplace-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--line-200);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 60;
}

.address-suggestion-item,
#workplace-suggestions > * {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0.68rem 0.82rem;
    border-bottom: 1px solid var(--line-200);
    transition: background 0.15s ease;
}

.address-suggestion-item:last-child,
#workplace-suggestions > *:last-child {
    border-bottom: 0;
}

.address-suggestion-item:hover,
.address-suggestion-item:focus,
#workplace-suggestions > *:hover,
#workplace-suggestions > *:focus {
    background: rgba(30, 64, 175, 0.06);
    outline: none;
}

.address-suggestion-main {
    color: var(--text-900);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2rem;
}

.address-suggestion-secondary {
    color: var(--text-500);
    font-size: 0.82rem;
    line-height: 1.1rem;
    margin-top: 0.12rem;
}

.address-manual-toggle {
    border: 1px solid var(--line-300);
    border-radius: 6px;
    padding: 0.48rem 0.76rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-700);
    background: var(--bg-100);
    transition: all 0.2s ease;
}

.address-manual-toggle:hover {
    background: var(--bg-200);
    border-color: var(--primary-700);
    color: var(--primary-700);
}

.autofill-locked {
    background: var(--bg-200) !important;
    color: var(--text-500);
    border-color: var(--line-300) !important;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    #route-questions,
    .route-summary {
        padding: 1.05rem;
    }

    .decision-options,
    .decision-options-three {
        grid-template-columns: 1fr;
    }

    .decision-options-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .route-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .route-summary-list {
        display: grid;
        gap: 0.45rem;
    }

    .change-route-button {
        width: 100%;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.2rem;
    }

    .header-text h1 {
        font-size: 1.2rem;
        line-height: 1.35;
    }

    .header-text p {
        font-size: 0.82rem;
    }

    .step-indicator {
        gap: 0.5rem;
        padding: 0.82rem;
    }

    .form-container {
        border-radius: 8px;
        padding: 1.02rem 0.86rem;
        margin-top: 0.38rem;
    }
}

/* Typography system */
:root {
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --font-serif: var(--font-sans);
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-sans);
}

body {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.header-text p {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
}

.section-title,
.route-intro h2,
.route-summary h2 {
    font-family: var(--font-sans);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.012em;
}

.information-panel-heading h3,
.panel-heading h3,
.ethnicity-fields > legend,
.payment-method-step legend {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
}

.form-group label,
.field-label,
.decision-step legend {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.form-control,
#workplace-input,
#worksite-dropdown,
.stripe-field {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.45;
}

.information-panel-heading p,
.panel-heading p,
.field-hint,
.decision-hint,
.decision-option small,
.payment-availability {
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.45;
}

.step-label,
.route-summary-list dt,
.route-summary-list dd {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.route-eyebrow,
.payment-step {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.1em;
}

.btn-primary,
.btn-secondary,
.add-ethnicity-button,
.add-iwi-button,
.change-route-button,
.address-manual-toggle {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Kahikatea visual system */
:root {
    --navy: #344a5e;
    --navy-dark: #273c50;
    --page-bg: #f3f7fa;
    --card-bg: #ffffff;
    --border: #d7e1ea;
    --text: #182a3d;
    --text-muted: #71849a;
    --input-focus: #2f80d9;
    --orange: #d86a00;
    --orange-hover: #bf5c00;
    --primary-900: var(--navy-dark);
    --primary-800: var(--navy);
    --primary-700: var(--navy);
    --primary-600: var(--input-focus);
    --accent-600: var(--navy);
    --accent-500: var(--input-focus);
    --bg-50: #f8fafc;
    --bg-100: var(--page-bg);
    --bg-200: #e8eef4;
    --surface-100: #ffffff;
    --surface-200: #ffffff;
    --surface-solid: var(--card-bg);
    --text-900: var(--text);
    --text-800: #263b50;
    --text-700: #40566c;
    --text-500: var(--text-muted);
    --text-400: #91a1b2;
    --field-border: var(--border);
    --field-border-strong: #8193a5;
    --field-ring: rgba(47, 128, 217, 0.12);
    --line-300: #c8d4df;
    --line-200: var(--border);
    --line-100: #edf2f6;
    --focus-ring: rgba(47, 128, 217, 0.12);
}

body {
    color: var(--text);
    background: var(--page-bg);
}

.header-banner {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--navy);
    box-shadow: 0 3px 12px rgba(24, 42, 61, 0.12);
}

.logo-container img {
    display: block;
    width: 190px;
    height: 88px;
    object-fit: cover;
    object-position: center;
    filter: invert(1);
    mix-blend-mode: screen;
}

.header-text h1 {
    color: #ffffff;
}

.header-text p {
    color: #dce5ec;
}

.form-container {
    border: 1px solid rgba(215, 225, 234, 0.9);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: 0 12px 30px rgba(39, 60, 80, 0.07);
}

.step-indicator {
    gap: 0;
    margin: 0.25rem 0 2rem;
    padding: 0.85rem 1.25rem 1rem;
    border: 0;
    border-bottom: 1px solid #e8eef4;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
}

.step {
    position: relative;
    flex: 1;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: 1.32rem;
    left: calc(50% + 1.65rem);
    width: calc(100% - 3.3rem);
    height: 2px;
    background: #e1e8ef;
}

.step-number {
    position: relative;
    z-index: 1;
}

.step-number.active {
    background: var(--navy);
    box-shadow: 0 4px 12px rgba(52, 74, 94, 0.2);
}

.step-number.inactive {
    border-color: #d8e1ea;
    background: #e7edf3;
}

.section-title {
    border-left-color: var(--navy);
    color: var(--text);
}

.ethnicity-iwi-layout {
    grid-template-columns: minmax(0, 1fr);
}

.information-panel,
.demographic-panel {
    margin-bottom: 1.25rem;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
}

.information-panel-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.information-panel-heading h3,
.information-panel-heading p {
    margin: 0;
}

.information-panel-heading h3 {
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 700;
}

.information-panel-heading p {
    margin-top: 0.12rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.information-panel > .grid:last-child {
    margin-bottom: 0;
}

.panel-heading-icon {
    color: var(--navy);
    background: #e9f0f5;
}

.form-control,
#workplace-input,
#worksite-dropdown {
    min-height: 46px;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    border-color: var(--border);
    border-radius: 9px;
    color: var(--text);
    background-color: #ffffff;
    box-shadow: none;
}

.form-control::placeholder,
#workplace-input::placeholder {
    color: var(--text-muted);
}

.form-control:hover,
#workplace-input:hover,
#worksite-dropdown:hover {
    border-color: #aebdcc;
    box-shadow: none;
}

.form-control:focus,
#workplace-input:focus,
#worksite-dropdown:focus,
.stripe-field.StripeElement--focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(47, 128, 217, 0.12);
}

.input-icon {
    border-color: var(--border);
    color: var(--navy);
    background: #edf3f7;
}

.application-route,
.payment-section,
.payment-method-step {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
}

.application-route {
    border-top: 4px solid var(--navy);
}

.route-intro h2,
.route-summary h2,
.payment-method-step legend,
.decision-step legend,
.decision-option,
.decision-option strong,
.route-summary-list dd {
    color: var(--text);
}

.route-intro p,
.decision-hint,
.decision-option small,
.field-hint,
.payment-section-heading p {
    color: var(--text-muted);
}

.route-eyebrow,
.payment-step {
    color: var(--navy);
}

.decision-step {
    border-top-color: #e3eaf0;
}

.decision-option {
    border-color: var(--border);
    border-radius: 10px;
    background: #ffffff;
}

.decision-option:hover {
    border-color: #9aacbd;
}

.decision-option:has(input:checked) {
    border-color: var(--navy);
    background: #eef3f7;
    box-shadow: 0 0 0 2px rgba(52, 74, 94, 0.1);
}

.decision-option input {
    accent-color: var(--navy);
}

.reference-suggestions {
    border-color: var(--border);
    box-shadow: 0 12px 28px rgba(39, 60, 80, 0.12);
}

.reference-suggestions button {
    border-bottom-color: #e5ebf0;
    color: var(--text);
}

.reference-suggestions button:hover,
.reference-suggestions button:focus-visible {
    color: var(--navy-dark);
    background: #eef3f7;
}

.membership-result {
    border-color: #c7d4df;
    color: var(--navy-dark);
    background: #eef3f7;
}

.authority-terms {
    border-top-color: var(--border);
    color: var(--text-700);
}

.authority-terms h3 {
    color: var(--text);
}

.payment-availability {
    border-left-color: var(--navy);
    color: var(--text-700);
    background: #f4f7fa;
}

.add-ethnicity-button,
.add-iwi-button,
.change-route-button {
    border-color: var(--navy);
    border-radius: 9px;
    color: var(--navy);
}

.add-ethnicity-button:hover,
.add-iwi-button:hover,
.change-route-button:hover,
.change-route-button:focus-visible {
    color: #ffffff;
    background: var(--navy);
}

.btn-primary {
    border-radius: 10px;
    background: var(--orange);
    box-shadow: 0 4px 12px rgba(216, 106, 0, 0.18);
}

.btn-primary:hover {
    background: var(--orange-hover);
    box-shadow: 0 6px 14px rgba(191, 92, 0, 0.22);
}

.btn-primary:focus-visible {
    outline: 3px solid rgba(47, 128, 217, 0.2);
    outline-offset: 2px;
}

.btn-secondary {
    border: 1px solid #c7d3de;
    border-radius: 10px;
    color: #ffffff;
    background: var(--navy);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--navy-dark);
    box-shadow: none;
}

.info-box {
    border-color: var(--border);
    border-left-color: var(--navy);
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: none;
}

#final-consent-section input[type="checkbox"] {
    flex-shrink: 0;
}

.contribution-question {
    margin: 0.5rem 0 0.8rem;
    color: var(--text);
    font-weight: 600;
}

.confirmation-box > label,
.confirmation-box > div > label {
    margin-top: 0.9rem;
}

.confirmation-links {
    margin: 0.5rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* The Terms links must look like links: the applicant has to be able to find and read them before agreeing. */
.confirmation-links a,
.confirmation-box label a {
    color: var(--primary-700);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.confirmation-links a:hover,
.confirmation-box label a:hover {
    color: var(--primary-900);
}

.confirmation-links a:focus-visible,
.confirmation-box label a:focus-visible {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}

.political-choice {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #edf3f7;
}

/* The political-purposes choice now opens the final section, straight after the payment method. */
#final-consent-section > .political-choice {
    margin: 0 0 1.5rem;
}

.political-choice h3 {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.political-choice p {
    margin: 0.6rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.join-message {
    max-width: 42rem;
    margin: 0 auto 0.8rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.join-message-emphasis {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-weight: 700;
}

.modal-header {
    background: var(--navy);
}

.spinner-icon {
    color: var(--navy);
}

.spinner-box p {
    color: var(--navy);
}

.progress-bar {
    background: var(--navy);
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    main {
        width: 100%;
        box-sizing: border-box;
    }

    .form-container {
        border-radius: 14px;
    }

    .information-panel,
    .demographic-panel {
        padding: 1rem;
    }

    .header-text p {
        padding: 0 1rem;
    }

    .step-label {
        max-width: 6.5rem;
        text-align: center;
        line-height: 1.25;
    }

    #birthDay,
    #birthMonth,
    #birthYear {
        min-width: 0;
        padding-left: 0.6rem;
        padding-right: 1.65rem;
    }
}

/* ===== Design v3: crisp, fluid layout =====
   Same palette as above. The header and the page share one width and gutters; parts sit on the page
   background as white cards; text is at least 14px; option cards and consent checkboxes show a clear
   selected state. Only the look changes: no field, wording or behaviour depends on these rules. */
:root {
    --v3-gutter: clamp(16px, 4vw, 56px);
    --v3-content: 1200px;
    --v3-muted: #4f6377;
    --v3-border: #d7e1ea;
    --v3-border-hover: #9aacbd;
    --v3-selected: #eef3f7;
    --v3-error: #b42318;
    --v3-shadow: 0 1px 2px rgba(24, 42, 61, 0.06);
    --text-muted: var(--v3-muted);
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.page-width {
    width: 100%;
    max-width: calc(var(--v3-content) + 2 * var(--v3-gutter));
    margin-left: auto;
    margin-right: auto;
    padding-left: max(var(--v3-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--v3-gutter), env(safe-area-inset-right, 0px));
}

/* Header band: the 1080px logo shown well below its natural size, so it stays sharp */
.header-banner {
    padding: clamp(18px, 2.4vw, 28px) 0;
    box-shadow: none;
}

.header-banner .header-content {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: clamp(16px, 2.5vw, 32px);
}

.header-banner .logo-container {
    flex: none;
    position: relative;
    width: 122px;
    height: 64px;
    margin: 0;
    overflow: hidden;
}

.header-banner .logo-container img {
    position: absolute;
    left: -13px;
    top: -40px;
    width: 145px;
    height: 145px;
    max-width: none;
    object-fit: fill;
    filter: none;
    mix-blend-mode: screen;
}

.header-banner .header-text {
    display: grid;
    gap: 6px;
    min-width: 0;
    flex: 1;
    padding-left: clamp(16px, 2.5vw, 32px);
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.header-banner .header-text h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.header-banner .header-text p {
    margin: 0;
    color: #dce5ec;
    font-size: 16px;
    max-width: 46ch;
}

/* Page: parts on the page background, each sub-section a white card */
.page-main {
    padding-top: clamp(20px, 3vw, 36px);
    padding-bottom: 64px;
}

.form-container {
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.section-title {
    margin: 8px 0 14px;
    padding-left: 12px;
    border-left: 3px solid var(--navy);
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.information-panel,
.demographic-panel,
.application-route,
.payment-section,
.payment-method-step {
    padding: 20px;
    border: 1px solid var(--v3-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--v3-shadow);
}

.application-route {
    border-top: 1px solid var(--v3-border);
}

.information-panel,
.demographic-panel {
    margin-bottom: 16px;
}

.information-panel-heading {
    margin-bottom: 18px;
}

.information-panel-heading h3 {
    font-size: 17px;
    line-height: 1.35;
}

.information-panel-heading p {
    font-size: 15px;
}

/* Text: labels 15px, hints and small print at least 14px in a darker grey */
#form label,
.field-label {
    color: var(--text);
}

#form label.block,
.field-label {
    font-size: 15px;
    font-weight: 600;
}

.route-intro p,
.decision-hint,
.decision-option small,
.field-hint,
.payment-section-heading p,
.membership-benefits,
.political-choice p,
#form .text-sm,
#form .text-xs {
    color: var(--v3-muted);
    font-size: 14px;
}

#form .text-red-500,
.field-error,
.server-field-error {
    color: var(--v3-error);
    font-size: 14px;
    font-weight: 500;
}

/* Fields */
.form-control,
#workplace-input,
#worksite-dropdown {
    min-height: 48px;
    font-size: 16px;
    border: 1px solid var(--v3-border);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.form-control:hover,
#workplace-input:hover,
#worksite-dropdown:hover {
    border-color: var(--v3-border-hover);
}

.form-control.border-red-500,
#workplace-input.border-red-500,
#worksite-dropdown.border-red-500,
.form-control[aria-invalid="true"] {
    border-color: var(--v3-error);
    box-shadow: 0 0 0 1px var(--v3-error) inset;
}

/* Three-field rows reflow 3, 2, 1 columns with the available width */
#form .grid.md\:grid-cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 16px 20px;
}

#form .grid.md\:grid-cols-2 {
    gap: 16px 20px;
}

/* Option cards: hover, press and a high-contrast selected state */
.decision-option {
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    transition: border-color 0.12s, background-color 0.12s, box-shadow 0.12s, transform 0.08s;
}

.decision-option:hover {
    border-color: var(--v3-border-hover);
    box-shadow: 0 1px 3px rgba(24, 42, 61, 0.08);
}

.decision-option:active {
    transform: scale(0.99);
}

.decision-option:has(input:checked) {
    border-color: var(--navy);
    background: var(--v3-selected);
    box-shadow: 0 0 0 1px var(--navy) inset;
}

.decision-option:has(input:focus-visible) {
    outline: 3px solid rgba(47, 128, 217, 0.18);
    outline-offset: 2px;
}

.decision-option strong {
    font-size: 16px;
    font-weight: 600;
}

/* Consent and political-purposes checkboxes as clear, clickable rows */
#final-consent-section label.flex {
    padding: 14px 16px;
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    background: #ffffff;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.12s, background-color 0.12s;
}

#final-consent-section label.flex:hover {
    border-color: var(--v3-border-hover);
}

#final-consent-section label.flex:has(input:checked) {
    border-color: var(--navy);
    background: var(--v3-selected);
}

#final-consent-section input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--navy);
}

.btn-primary {
    min-height: 52px;
    border-radius: 10px;
    font-size: 17px;
    transition: background-color 0.12s, transform 0.08s;
}

.btn-primary:active {
    transform: scale(0.985);
}

@media (max-width: 640px) {
    .header-banner .header-content {
        flex-direction: row;
        text-align: left;
        gap: 14px;
    }

    .header-banner .logo-container {
        width: 92px;
        height: 48px;
    }

    .header-banner .logo-container img {
        left: -10px;
        top: -30px;
        width: 109px;
        height: 109px;
    }

    .header-banner .header-text {
        padding-left: 14px;
    }

    .header-banner .header-text h1 {
        font-size: 22px;
    }

    .header-banner .header-text p {
        font-size: 15px;
    }

    .information-panel,
    .demographic-panel,
    .application-route,
    .payment-section,
    .payment-method-step {
        padding: 16px;
    }

    .form-container {
        padding: 0;
    }
}

/* What is still missing before the application can be submitted, in place of the submit button */
.missing-step-notice {
    max-width: 42rem;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--v3-border);
    border-left: 4px solid var(--warning-500);
    border-radius: 8px;
    background: var(--surface-solid);
    text-align: center;
}

.missing-step-notice p {
    margin: 0 0 0.75rem;
    color: var(--text-800);
    font-weight: 600;
}

.missing-step-notice p:last-child {
    margin-bottom: 0;
}

/* The question the notice took the applicant to, outlined for a moment */
.missing-step-highlight {
    outline: 3px solid var(--warning-500);
    outline-offset: 6px;
    border-radius: 8px;
    transition: outline-color 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .decision-option,
    .btn-primary,
    #final-consent-section label.flex,
    .missing-step-highlight {
        transition: none;
    }
}

/* ===== Design v3: saving overlay ===== */
.spinner-container {
    background: rgba(24, 42, 61, 0.45);
    backdrop-filter: blur(2px);
}

.spinner-box.submission-progress-box {
    align-items: flex-start;
    width: min(calc(100% - 32px), 460px);
    padding: 28px;
    gap: 12px;
    text-align: left;
    border: 1px solid var(--v3-border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(24, 42, 61, 0.18);
}

.submission-progress-box .spinner-icon {
    width: 36px;
    height: 36px;
    margin: 0 0 4px;
    color: var(--navy);
}

.submission-progress-box .spinner-track {
    opacity: 0.18;
}

.submission-progress-box h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 20px;
    line-height: 1.3;
}

.submission-progress-box #submission-progress-status {
    color: var(--text);
    font-size: 16px;
}

.submission-progress-guidance {
    padding: 2px 0 2px 12px;
    border-left: 3px solid var(--navy);
    border-radius: 0;
    background: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.submission-progress-elapsed,
.submission-progress-confirmation {
    color: var(--v3-muted);
    font-size: 14px;
}

/* ===== Design v3: info buttons inside the field, no box ===== */
.has-info {
    position: relative;
}

.has-info > .info-slot {
    position: absolute;
    top: 0;
    right: 6px;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.has-info > .info-slot .icon-help-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--navy);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.12s, color 0.12s;
}

.has-info > .info-slot .icon-help-button:hover {
    background: var(--v3-selected);
    color: #2f80d9;
}

.has-info > .info-slot .icon-help-button:focus-visible {
    outline: 3px solid rgba(47, 128, 217, 0.3);
    outline-offset: 1px;
}

.has-info > input,
.has-info > select,
.has-info > .membership-result {
    width: 100%;
    border-radius: 9px !important;
}

.has-info > input[type="text"] {
    padding-right: 46px;
}

/* On a select the button sits just left of the arrow */
.has-info:has(> select) > .info-slot {
    right: 36px;
}

.has-info > select {
    padding-right: 78px;
}

.has-info > .membership-result {
    padding-right: 46px;
}
