:root {
    --purple: #37286f;
    --blue: #0069a2;
    --cyan: #46b5d8;
    --pale-blue: #d2e9f9;
    --panel: #f4f4f4;
    --line: #d2d2d2;
    --text: #555;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 12px;
}

body {
    width: 100%;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: #fff;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.legacy-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.legacy-header {
    width: 100%;
    overflow: hidden;
    background: var(--purple);
}

.legacy-header img {
    width: 100%;
    height: auto;
    display: block;
}

.legacy-content {
    min-height: 497px;
    flex: 1 0 auto;
    background: var(--panel);
}

.form-banner {
    width: min(900px, calc(100% - 32px));
    height: clamp(150px, 17vw, 220px);
    margin: 24px auto 0;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(25, 24, 63, 0.18);
}

.form-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.login-area {
    height: 315px;
    padding-top: 24px;
    display: grid;
    grid-template-columns: 44.5% 55.5%;
}

.login-box {
    grid-column: 2;
    width: 390px;
    min-height: 270px;
    margin: 0 auto;
    padding: 22px 12px 14px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}

.login-heading {
    margin-bottom: 16px;
    text-align: center;
    padding: 0 8px;
}

.login-heading h1 {
    margin: 0;
    color: #37286f;
    font-size: 20px;
    line-height: 1.2;
}

.login-heading p {
    margin: 5px 0 0;
    color: #777;
    font-size: 14px;
    line-height: 1.4;
}

.legacy-field {
    min-height: 52px;
    display: grid;
    grid-template-columns: 105px 1fr;
    align-items: start;
}

.legacy-field label {
    padding: 10px 5px 0 0;
    color: var(--cyan);
    font-weight: bold;
    text-align: right;
}

.legacy-field input {
    width: 260px;
    max-width: 100%;
    height: 38px;
    padding: 5px 8px;
    border: 1px solid #b9c0c5;
    border-radius: 5px;
    outline: none;
    color: #111;
    background: linear-gradient(#f8fbff, #e6effc);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
    font-size: 14px;
}

.legacy-field input::placeholder {
    color: #7a8791;
    opacity: 1;
}

.legacy-field .iti {
    width: 260px;
    max-width: 100%;
    display: block;
}

.legacy-field .iti input {
    width: 100%;
}

.legacy-field .iti__selected-country {
    border-radius: 5px 0 0 5px;
}

.legacy-field .iti__country-container {
    color: #222;
}

.legacy-field .iti__dropdown-content {
    z-index: 20;
    font-size: 12px;
}

.legacy-field input:focus {
    border-color: #74a7c6;
    box-shadow: 0 0 0 2px rgba(70, 181, 216, 0.16), inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.legacy-field input[aria-invalid="true"] {
    border-color: #b42318;
}

.field-error {
    min-height: 13px;
    display: block;
    padding-top: 2px;
    color: #b42318;
    font-size: 10px;
}

.legacy-primary-button,
.primary-button {
    display: block;
    padding: 7px 17px;
    border: 0;
    border-radius: 5px;
    color: white;
    background: var(--blue);
    font-weight: bold;
}

.legacy-primary-button:hover,
.primary-button:hover {
    background: #248ec5;
}

.login-box .legacy-primary-button {
    margin: 1px auto 0;
}

.forgot-link {
    display: block;
    margin: 5px auto 0;
    padding: 0;
    border: 0;
    color: var(--cyan);
    background: transparent;
}

.forgot-link:hover,
.survey-link:hover {
    text-decoration: underline;
}

.form-message {
    max-width: 340px;
    min-height: 12px;
    margin: 4px auto 0;
    color: #666;
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
}

.legacy-alerts {
    height: 66px;
    padding: 6px 5px;
    background: var(--pale-blue);
}

.survey-link {
    max-width: 100%;
    display: block;
    overflow: hidden;
    padding: 0;
    border: 0;
    color: var(--cyan);
    background: transparent;
    white-space: nowrap;
    text-align: left;
    text-overflow: ellipsis;
}

.agreements-button {
    margin: 11px auto 0;
    padding: 7px 16px;
}

.copyright {
    min-height: 31px;
    padding: 7px 4px 3px;
    color: #666;
    font-size: 10px;
    text-align: center;
}

.copyright a {
    color: #666;
    text-decoration: none;
}

.legacy-footer {
    width: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: white;
}

.legacy-footer img {
    width: 100%;
    height: auto;
    display: block;
}

.footer-brand {
    min-height: 105px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-bottom: 2px solid #08749b;
    color: #26324c;
}

.crest {
    width: 58px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 4px double #c39a2e;
    border-radius: 50% 50% 44% 44%;
    color: white;
    background:
        linear-gradient(90deg, #f4d21d 0 33%, #176fb2 33% 66%, #d92d3b 66%);
    font-size: 15px;
    font-weight: bold;
}

.footer-brand > strong {
    font-family: Arial, sans-serif;
    font-size: 25px;
    line-height: 0.9;
    font-weight: 500;
}

.footer-ministry {
    margin-left: 75px;
    color: #37286f;
    font-size: 16px;
    font-weight: bold;
}

.modal {
    width: min(610px, calc(100% - 32px));
    max-height: min(760px, calc(100dvh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid #aaa;
    border-radius: 6px;
    color: #333;
    background: white;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.3);
}

.modal-wide {
    width: min(720px, calc(100% - 32px));
}

.modal-compact {
    width: min(480px, calc(100% - 32px));
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.58);
}

.modal-header {
    min-height: 48px;
    margin: 0;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #bbb;
    background: #e9f3fb;
}

.modal-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--blue);
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.modal-header h2 {
    margin: 0;
    color: #222;
    font-size: 15px;
}

.close-button {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 1px solid #aaa;
    border-radius: 50%;
    color: #333;
    background: white;
    font-size: 20px;
    line-height: 1;
}

.modal-body {
    max-height: calc(100dvh - 130px);
    padding: 18px;
    overflow-y: auto;
}

.modal-body > :first-child {
    margin-top: 0;
}

.modal-body > :last-child {
    margin-bottom: 0;
}

.prose {
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.55;
}

.prose a {
    color: var(--blue);
}

.prose li + li {
    margin-top: 8px;
}

.prose blockquote {
    margin: 15px 0;
    padding: 10px 13px;
    border-left: 3px solid var(--blue);
    background: #eff7fc;
    font-style: italic;
}

.modal-footer {
    margin: 0;
    padding: 10px 14px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #ccc;
}

.modal .field {
    margin: 15px 0;
}

.modal .field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.modal .field input {
    width: 100%;
    height: 34px;
    padding: 5px 8px;
    border: 1px solid #aaa;
    border-radius: 4px;
}

.link-list,
.document-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.link-list li + li,
.document-list li + li {
    border-top: 1px solid #ddd;
}

.link-list a,
.document-list li {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.link-list a {
    color: var(--blue);
    font-weight: bold;
    text-decoration: none;
}

.document-list li {
    padding: 9px 0;
}

.document-list a {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid #8dbbd3;
    border-radius: 4px;
    color: var(--blue);
    background: #eff7fc;
    font-size: 10px;
    font-weight: bold;
    text-decoration: none;
}

@media (max-width: 720px) {
    .legacy-content {
        min-height: 480px;
    }

    .form-banner {
        width: calc(100% - 24px);
        height: 130px;
        margin-top: 14px;
        border-radius: 5px;
    }

    .login-area {
        height: 350px;
        padding: 24px 12px 48px;
        display: block;
    }

    .login-box {
        width: min(390px, 100%);
        margin: auto;
        padding-left: 8px;
        padding-right: 8px;
    }

    .legacy-field {
        grid-template-columns: 86px 1fr;
    }

    .legacy-alerts {
        height: auto;
        min-height: 78px;
    }

    .survey-link {
        white-space: normal;
        line-height: 1.35;
        text-align: center;
    }

    .copyright {
        padding-right: 12px;
        padding-left: 12px;
        line-height: 1.45;
    }

    .legacy-footer {
        width: 100%;
        min-height: 0;
        padding: 0;
    }

    .footer-brand {
        min-height: 105px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .footer-brand > strong {
        font-size: 21px;
    }

    .footer-ministry {
        width: 100%;
        margin: -6px 0 0;
        font-size: 14px;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .login-box {
        height: auto;
        min-height: 305px;
        padding-top: 22px;
    }

    .legacy-field {
        grid-template-columns: 1fr;
    }

    .legacy-field label {
        padding: 0 0 4px;
        text-align: left;
    }

    .legacy-field input {
        width: 100%;
    }

    .legacy-field .iti {
        width: 100%;
    }

    .footer-brand > strong {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
