body.modal-open {
    overflow: hidden;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 24, 35, 0.34);
}

.modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(760px, 100%);
    max-height: min(92vh, 760px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d4e0ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 22px 54px rgba(15, 38, 59, 0.24);
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
}

.modal--sm .modal__panel {
    width: min(520px, 100%);
}

.modal--lg .modal__panel {
    width: min(980px, 100%);
}

.modal--xl .modal__panel {
    width: min(1180px, 100%);
    max-height: min(92vh, 860px);
}

.modal__panel:focus-visible {
    outline: 3px solid #f2b84b;
    outline-offset: 3px;
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px 12px;
}

.modal__title {
    margin: 0;
    color: #0f263b;
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

.modal__description {
    margin: 12px 0 0;
    color: #0f263b;
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
}

.modal__close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #0f263b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal .modal__close:hover {
    background: #edf4fb;
    color: #0f263b;
}

.modal__close:focus-visible {
    outline: 3px solid #f2b84b;
    outline-offset: 2px;
}

.modal__content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding: 20px 32px 28px;
    border-top: 1px solid #e6edf4;
}

.ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 32px;
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.ui-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px #fafafa, 0 0 0 4px #7f9fc5;
}

.ui-button--secondary {
    border: 1px solid #00539b;
    background: #ffffff;
    color: #00539b;
}

.ui-button--secondary:hover {
    background: #e4f1ff;
    border-color: #004488;
    color: #004488;
}

.ui-button--secondary:active {
    background: #9dbee0;
    border-color: #004488;
    color: #004488;
}

.ui-button--secondary:disabled,
.ui-button--secondary[aria-disabled="true"] {
    background: #ffffff;
    border-color: #578bc0;
    color: #578bc0;
    cursor: not-allowed;
}

.ui-button--primary {
    border: 1px solid #00539b;
    background: #00539b;
    color: #ffffff;
}

.ui-button--primary:hover {
    border-color: #578bc0;
    background: #578bc0;
}

.ui-button--primary:active {
    border-color: #223954;
    background: #223954;
}

.ui-button--primary:disabled,
.ui-button--primary[aria-disabled="true"] {
    border-color: #578bc0;
    background: #578bc0;
    color: #ffffff;
    cursor: not-allowed;
}

.ui-button--primary img {
    filter: brightness(0) invert(1);
}

.ui-button--ghost {
    border: 0;
    background: rgba(251, 251, 251, 0.01);
    color: #004488;
}

.ui-button--ghost:hover {
    color: #00376e;
}

.ui-button--ghost:active {
    color: #002d5a;
}

.ui-button--ghost:disabled,
.ui-button--ghost[aria-disabled="true"] {
    color: #578bc0;
    cursor: not-allowed;
}

.ui-button img {
    width: 24px;
    height: 24px;
}

@media (max-width: 1160px) {
    .modal--xl .modal__panel {
        width: min(980px, 100%);
        max-height: min(86vh, 720px);
    }

    .modal--xl .modal__content {
        overflow: auto;
    }
}

@media (max-width: 900px) {
    .modal {
        align-items: stretch;
        padding: 14px;
    }

    .modal__panel {
        max-height: calc(100vh - 28px);
    }

    .modal__header,
    .modal__content,
    .modal__footer {
        padding-right: 20px;
        padding-left: 20px;
    }
}
