:root {
    --apply-navy: #073b6f;
    --apply-navy-dark: #062b4f;
    --apply-teal: #0bb7b1;
    --apply-teal-dark: #078985;
    --apply-blue: #eaf4ff;
    --apply-mint: #e8f9f6;
    --apply-ink: #142338;
    --apply-muted: #65758b;
    --apply-line: #d8e5ef;
    --apply-bg: #f2f7fb;
    --apply-danger: #c4374b;
}

.apply-section {
    min-height: 70vh;
    padding: 34px 0 72px;
    background: linear-gradient(rgba(11,183,177,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(11,183,177,.035) 1px, transparent 1px), var(--apply-bg);
    background-size: 72px 72px;
}

.apply-shell { width: min(1120px, 92%); }
.apply-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--apply-navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.apply-back-link:hover { color: var(--apply-teal-dark); }

.apply-card {
    overflow: hidden;
    border: 1px solid rgba(7,59,111,.11);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(7,43,79,.09);
}

.apply-card-header {
    display: block;
    gap: 28px;
    align-items: center;
    padding: 28px 32px;
    border-bottom: 1px solid var(--apply-line);
    min-height: 176px;
    box-sizing: border-box;
    background:
        linear-gradient(90deg,rgba(4,43,77,.94) 0%,rgba(5,75,98,.84) 55%,rgba(5,160,157,.72) 100%),
        url('../images/hero/hero-5.png') center 38% / cover no-repeat;
}
.apply-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: #83eee7;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.apply-card-header h1 { margin: 0; color: #fff; font-size: 30px; line-height: 1.2; }
.apply-card-header > div > p { max-width: 620px; margin: 8px 0 0; color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.6; }

.apply-progress-wrap { padding: 20px 32px 18px; border-bottom: 1px solid var(--apply-line); background: #fbfdff; }
.apply-progress-copy { display: flex; justify-content: space-between; gap: 16px; color: var(--apply-muted); font-size: 12px; }
.apply-progress-copy > strong { color: var(--apply-navy); font-weight: 600; }
.progress-bar { height: 4px; margin: 10px 0 16px; overflow: hidden; border-radius: 4px; background: #dde7ef; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--apply-teal),#2b7bc0); transition: width .28s ease; }

.apply-stage-list { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.apply-stage-list li { display: flex; align-items: center; gap: 7px; min-width: 0; color: #8290a2; }
.apply-stage-list li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    border: 1px solid #cbd9e5;
    border-radius: 50%;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
}
.apply-stage-list li small { overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.apply-stage-list li.active,.apply-stage-list li.complete { color: var(--apply-navy); }
.apply-stage-list li.active > span,.apply-stage-list li.complete > span { border-color: var(--apply-teal); background: var(--apply-teal); color: #fff; }

.apply-form-error {
    display: none;
    margin: 18px 32px 0;
    padding: 12px 14px;
    border: 1px solid #f2bbc4;
    border-left: 3px solid var(--apply-danger);
    border-radius: 6px;
    background: #fff4f5;
    color: #9c2338;
    font-size: 12px;
    line-height: 1.5;
}
.apply-form-error.show { display: block; }
.apply-form { padding: 28px 32px 32px; }
.form-step { display: none; animation: applyFade .38s cubic-bezier(.22,.75,.28,1); }
.form-step.active { display: block; }
@keyframes applyFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.form-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.form-section-heading > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--apply-mint);
    color: var(--apply-teal-dark);
    font-size: 17px;
}
.form-section-heading h2 { margin: 0; color: var(--apply-navy); font-size: 19px; line-height: 1.25; }
.form-section-heading p { margin: 4px 0 0; color: var(--apply-muted); font-size: 12px; line-height: 1.45; }

.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 20px; }
.field-group { display: grid; gap: 7px; min-width: 0; margin: 0 0 18px; }
.form-grid .field-group { margin-bottom: 0; }
.field-group > span,.choice-fieldset > legend { color: var(--apply-navy); font-size: 11px; font-weight: 600; }
.field-group > span b,.choice-fieldset > legend b,.upload-field strong b { color: #df3e56; font-weight: 700; }
.field-group > span small { color: var(--apply-muted); font-weight: 400; }
.field-group > small { color: var(--apply-muted); font-size: 10px; line-height: 1.5; }

.apply-form input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),.apply-form select,.apply-form textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #cbdbe7;
    border-radius: 7px;
    background: #fff;
    color: var(--apply-ink);
    font-family: inherit;
    font-size: 13px;
    transition: border-color .18s ease,box-shadow .18s ease;
}
.apply-form input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),.apply-form select { min-height: 44px; padding: 0 13px; }
.apply-form textarea { min-height: 110px; padding: 12px 13px; resize: vertical; line-height: 1.55; }
.apply-form input::placeholder,.apply-form textarea::placeholder { color: #97a6b8; }
.apply-form input:focus,.apply-form select:focus,.apply-form textarea:focus { outline: none; border-color: var(--apply-teal); box-shadow: 0 0 0 3px rgba(11,183,177,.11); }
.field-group.has-error input,.choice-fieldset.has-error,.upload-field.has-error { border-color: var(--apply-danger) !important; }
.consent-option.has-error { border-color: var(--apply-danger); background: #fff4f5; }

.usa-form-note { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 13px 15px; border: 1px solid #cfe5f5; border-radius: 7px; background: var(--apply-blue); color: var(--apply-navy); }
.usa-form-note > i { font-size: 17px; }
.usa-form-note strong,.usa-form-note span { display: block; }
.usa-form-note strong { font-size: 12px; }
.usa-form-note span { margin-top: 2px; color: var(--apply-muted); font-size: 10px; line-height: 1.45; }

.choice-grid { margin-top: 20px; }
.choice-fieldset { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.choice-fieldset > legend { margin-bottom: 9px; }
.radio-group { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.role-options,.status-options { grid-template-columns: repeat(4,minmax(0,1fr)); }
.radio-option { position: relative; display: flex; align-items: center; min-width: 0; margin: 0; cursor: pointer; }
.radio-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.radio-option span {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    padding: 9px 11px 9px 34px;
    border: 1px solid #d4e1ea;
    border-radius: 7px;
    background: #fbfdff;
    color: #40546d;
    font-size: 11px;
    line-height: 1.35;
}
.radio-option span::before { position: absolute; left: 12px; width: 12px; height: 12px; border: 1px solid #9bb0c2; border-radius: 50%; background: #fff; content: ""; }
.radio-option input:checked + span { border-color: var(--apply-teal); background: var(--apply-mint); color: var(--apply-navy); }
.radio-option input:checked + span::before { box-sizing: border-box; border: 4px solid var(--apply-teal); }
.radio-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(11,183,177,.13); }

.application-licence-builder { margin: 4px 0 20px; padding: 17px; border: 1px solid #d6e7ec; border-radius: 8px; background: #f5fbfb; }
.application-licence-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.application-licence-head strong,.application-licence-head small { display: block; }
.application-licence-head strong { color: var(--apply-navy); font-size: 13px; }
.application-licence-head small { margin-top: 3px; color: var(--apply-muted); font-size: 10px; }
.application-licence-head button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--apply-teal);
    border-radius: 7px;
    background: #fff;
    color: var(--apply-teal-dark);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
[data-application-licences] { display: grid; gap: 10px; }
.application-licence-row { position: relative; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; padding: 13px 46px 13px 13px; border: 1px solid #dbe7ef; border-radius: 7px; background: #fff; }
.application-licence-row .field-group { margin: 0; }
.application-licence-row > button { position: absolute; top: 13px; right: 10px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: #fff0f2; color: var(--apply-danger); cursor: pointer; }
.field-group-half { max-width: calc(50% - 10px); }

.upload-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.upload-field { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 11px; align-items: center; min-width: 0; padding: 13px; border: 1px solid #d5e3ed; border-radius: 8px; background: #fbfdff; }
.upload-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 7px; background: var(--apply-mint); color: var(--apply-teal-dark); }
.upload-field strong,.upload-field small { display: block; }
.upload-field strong { color: var(--apply-navy); font-size: 11px; }
.upload-field small { margin-top: 3px; color: var(--apply-muted); font-size: 9px; line-height: 1.4; }
.upload-field input[type="file"] { grid-column: 1/-1; width: 100%; min-width: 0; color: var(--apply-muted); font: inherit; font-size: 10px; }
.upload-field input[type="file"]::file-selector-button { min-height: 32px; margin-right: 9px; padding: 0 11px; border: 1px solid #c9dce8; border-radius: 6px; background: #fff; color: var(--apply-navy); font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; }
.upload-selection-list { grid-column: 1/-1; display: grid; gap: 6px; min-width: 0; }
.upload-selection-item { display: grid; grid-template-columns: minmax(0,1fr) 26px; gap: 8px; align-items: center; min-width: 0; padding: 6px 7px 6px 10px; border: 1px solid #d9e7ef; border-radius: 6px; background: #fff; color: #52667d; font-size: 9px; }
.upload-selection-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-selection-item button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: #fff0f2; color: var(--apply-danger); cursor: pointer; }

.application-review-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--apply-line); border-radius: 8px; }
.application-review-summary > div { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--apply-line); border-bottom: 1px solid var(--apply-line); background: #fbfdff; }
.application-review-summary > div:nth-child(2n) { border-right: 0; }
.application-review-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
.application-review-summary span,.application-review-summary strong { display: block; }
.application-review-summary span { color: var(--apply-muted); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.application-review-summary strong { overflow: hidden; margin-top: 4px; color: var(--apply-navy); font-size: 11px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; }

.checkbox-option { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-option input { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; accent-color: var(--apply-teal); }
.consent-option { padding: 13px 14px; border: 1px solid #d5e5ec; border-radius: 7px; background: #f6fbfb; color: #4f6075; font-size: 10px; line-height: 1.55; }
.consent-option.has-error { animation: consentAttention .55s ease 2; box-shadow: 0 0 0 3px rgba(196,55,75,.1); }
.application-privacy-note { display: flex; align-items: center; gap: 10px; margin-top: 11px; color: #64758a; font-size: 10px; line-height: 1.5; }
.application-privacy-note i { color: var(--apply-teal-dark); font-size: 14px; }
.application-privacy-note strong { color: var(--apply-navy); font-weight: 600; }
@keyframes consentAttention { 50% { transform: translateY(-2px); box-shadow: 0 0 0 5px rgba(196,55,75,.12); } }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 19px; border-top: 1px solid #e4ecf2; }
.step-nav-end { justify-content: flex-end; }
.next-btn,.back-btn,.submit-btn,.close-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 17px; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.next-btn,.submit-btn,.close-btn { border: 1px solid var(--apply-teal); background: var(--apply-teal); color: #fff; }
.next-btn:hover,.submit-btn:hover,.close-btn:hover { border-color: var(--apply-teal-dark); background: var(--apply-teal-dark); }
.back-btn { border: 1px solid #cddbe6; background: #fff; color: var(--apply-navy); }
.back-btn:hover { background: #f4f8fb; }
.submit-btn .btn-loader { display: none; width: 16px; height: 16px; box-sizing: border-box; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: applySpin .65s linear infinite; }
.submit-btn.loading .btn-text { display: none; }
.submit-btn.loading .btn-loader { display: inline-block; }
@keyframes applySpin { to { transform: rotate(360deg); } }

.success-modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(5,28,51,.64); }
.success-modal.show { display: flex; }
.success-box { width: min(420px,100%); padding: 30px; border-radius: 8px; background: #fff; box-shadow: 0 28px 70px rgba(3,26,48,.24); text-align: center; }
.checkmark { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--apply-mint); color: var(--apply-teal-dark); font-size: 20px; }
.success-box h2 { margin: 16px 0 7px; color: var(--apply-navy); font-size: 21px; }
.success-box p { margin: 0; color: var(--apply-muted); font-size: 12px; line-height: 1.6; }
.success-box .close-btn { margin-top: 20px; }

@media (max-width: 900px) {
    .role-options,.status-options,.application-licence-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .apply-stage-list li { justify-content: center; }
    .apply-stage-list li small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .form-step,.progress-fill { animation: none; transition: none; }
    html { scroll-behavior: auto; }
}

@media (max-width: 680px) {
    .apply-section { padding: 20px 0 46px; background-size: 54px 54px; }
    .apply-shell { width: min(94%,560px); }
    .apply-card-header,.apply-progress-wrap,.apply-form { padding-left: 18px; padding-right: 18px; }
    .apply-card-header { min-height: 158px; padding-top: 28px; padding-bottom: 28px; background-position: 64% center; }
    .apply-card-header h1 { font-size: 25px; }
    .apply-progress-wrap { padding-top: 16px; padding-bottom: 15px; }
    .apply-form { padding-top: 22px; padding-bottom: 24px; }
    .form-grid,.radio-group,.role-options,.status-options,.application-licence-row,.upload-grid,.application-review-summary { grid-template-columns: 1fr; }
    .form-grid { gap: 15px; }
    .application-review-summary > div,.application-review-summary > div:nth-child(2n),.application-review-summary > div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--apply-line); }
    .application-review-summary > div:last-child { border-bottom: 0; }
    .field-group-half { max-width: none; }
    .application-licence-head { align-items: stretch; flex-direction: column; }
    .application-licence-head button { width: 100%; }
    .application-licence-row { padding-top: 45px; }
    .step-nav { flex-direction: column-reverse; }
    .step-nav-end { flex-direction: column; }
    .next-btn,.back-btn,.submit-btn { width: 100%; }
    .apply-form-error { margin-right: 18px; margin-left: 18px; }
    body.job-application-page .staff-request-widget { display: none !important; }
    body.job-application-page .support-chat-widget {
        right: 8px;
        bottom: 12px;
        transform: scale(.76);
        transform-origin: right bottom;
    }
}

@media (max-width: 420px) {
    .apply-stage-list { gap: 3px; }
    .apply-stage-list li > span { flex-basis: 23px; width: 23px; height: 23px; }
    .apply-progress-copy { align-items: flex-start; flex-direction: column; gap: 3px; }
    .form-section-heading { align-items: flex-start; }
    .form-section-heading h2 { font-size: 17px; }
}
