.modal {
    position: fixed;
    z-index: 999;
    inset: 0;

    visibility: hidden;
    overflow: hidden auto;

    opacity: 0;
    background-color: rgb(0, 0, 0, 50%);

    transform: scaleX(1.02) scaleY(1.02);
    transition: visibility 0s linear 0.2s, opacity 0.2s 0s, transform 0.2s;
}

.modal[aria-hidden="false"] {
    visibility: visible;

    opacity: 1;

    transform: scaleX(1) scaleY(1);
    transition: visibility 0s linear 0s, opacity 0.2s 0s, transform 0.2s;
}

.modal__box {
    max-width: var(--width-content);
    margin: var(--space-medium) auto var(--space-larger);

    background-color: var(--color-white);
    box-shadow: 0 0 10px var(--color-grey-7);

    scroll-margin-top: var(--space-medium);
}

@media (min-width: 800px) {
    .modal__box {
        margin-top: var(--space-larger);
    }
}

@media (min-width: 1000px) {
    .modal__box {
        border-radius: var(--radius);
    }
}

.modal__header {
    padding: var(--space-smaller);

    text-align: right;
}

.modal__body {
    overflow: hidden;

    min-height: 15rem;
    padding-right: var(--space-small);
    padding-bottom: var(--space-small);
    padding-left: var(--space-small);
}

@media (min-width: 800px) {
    .modal__body {
        padding-right: var(--space-medium);
        padding-bottom: var(--space-medium);
        padding-left: var(--space-medium);
    }
}

.modal__body > .section:last-child {
    margin-bottom: 0;
}

.modal__body .section__title {
    margin-top: 0;
}

.modal .no-modal,
.only-modal {
    display: none;
}

.modal .only-modal {
    display: initial;
}

body.modal-opened {
    overflow: hidden;
}
