.modal-background,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 1050 !important;
    background: rgba(0, 0, 0, 0.45);
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.custom-modalcontent {
    position: relative;
    width: min(480px, 90vw);
    background-color: var(--neutrals-10);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(3, 14, 35, 0.35);
    z-index: 1051;
    padding: 32px;
    overflow: hidden;
    overflow-y: auto;
    text-align: center;
    height: fit-content;
    max-height: calc(100vh - 64px);
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--textcolor-fullcontrast);
}

.custom-modalheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(3, 14, 35, 0.1);
}

.custom-modaltitle,
.modal-title {
    flex-grow: 1;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.modal-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--textcolor-80contrast);
    font-style: italic;
}

.custom-modaltext {
    color: var(--textcolor-80contrast);
    line-height: 1.5;
}

.custom-modalfooter {
    border-top: 1px solid rgba(3, 14, 35, 0.1);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.custom-modalclosebutton,
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--textcolor-50contrast);
    transition: color 0.2s ease;
}

.custom-modalclosebutton:hover,
.custom-modalclosebutton:focus,
.modal-close:hover,
.modal-close:focus {
    color: var(--textcolor-fullcontrast);
}

.custom-modalbody {
    text-align: left;
    padding-top: 0;
}

.modal-actions,
.modal-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.modal-action-button,
.modal-buttons button {
    min-width: 140px;
    padding: 12px 28px;
    border-radius: 14px;
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: white;
}

.modal-action-button:hover,
.modal-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(3, 14, 35, 0.18);
}

.modal-action-button:focus,
.modal-buttons button:focus {
    outline: 3px solid rgba(14, 65, 148, 0.35);
    outline-offset: 2px;
}

.modal-action-button--cancel,
.modal-buttons .cancel-button {
    background-color: var(--accent-color);
}

.modal-action-button--cancel:hover,
.modal-buttons .cancel-button:hover {
    background-color: var(--hoveraccent-color);
}

.modal-action-button--confirm,
.modal-buttons .confirm-button {
    background-color: var(--signals-activecolor);
}

.modal-action-button--confirm:hover,
.modal-buttons .confirm-button:hover {
    background-color: var(--hoversignals-activecolor);
}

.modal-action-button--primary {
    background-color: var(--primary-color);
}

.modal-action-button--primary:hover {
    background-color: var(--hoverprimary-color);
}

.modal-action-button--neutral {
    background-color: var(--textcolor-50contrast);
}

.modal-action-button--neutral:hover {
    background-color: var(--textcolor-fullcontrast);
}

.custom-bigmodal {
    width: min(1040px, 95vw);
    max-height: calc(100vh - 64px);
    text-align: left;
    padding: 28px 32px;
}

.modal-scroll-area {
    overflow-y: auto;
    max-height: 50vh;
    padding-right: 4px;
}

.modal-list-card {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    border: 1px solid rgba(3, 14, 35, 0.08);
    padding: 16px 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-list-card + .modal-list-card {
    margin-top: 12px;
}

.modal-list-card .modal-action-button {
    align-self: flex-start;
}

.modal-card--list {
    text-align: center;
}

.modal-card--list .custom-modaltext {
    text-align: left;
}

.modal-card--list img {
    margin: 0 auto;
    border-radius: 12px;
}
