html:has(.modalWrapper) {
    overflow: hidden;
}

.modalWrapper {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
    padding: 20px 0;
    scrollbar-gutter: stable;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.modalBackdrop {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.modal {
    border: 1px solid #cbcbcb;
    width: 100%;
    max-width: 460px;
    margin: auto;
    background-color: #fff;
    position: relative;
    z-index: 5;
}

.modalHeader {
    background-color: #f9f9f9;
    border-bottom: 1px solid #cbcbcb;
    position: relative;
    padding: 28px 60px 28px 20px;
}

.modalHeader-title {
    display: flex;
}

.modalHeader-text {
    font-size: 23px;
    line-height: 1;
    font-family: var(--main-font-family-2);
    color: #585858;
    font-weight: normal;
    margin: 0;
}

.modalCloseButton {
    display: block;
    position: absolute;
    width: 21px;
    height: 21px;
    border: none;
    background-color: #791a12;
    border-radius: 50%;
    top: 29px;
    right: 18px;
    cursor: pointer;

    &:before,
    &:after {
        content: '';
        display: block;
        width: 1px;
        height: 1px;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        margin: auto;
        background-color: #fff;
        scale: 14.24 2.54;
    }

    &:before {
        rotate: -45deg;
    }

    &:after {
        rotate: 45deg;
    }
}

.modalContent {
    padding: 20px;
}

.formNote {
    margin: auto 0 auto auto;
}

.formNoteMobile {
    display: none;
}

.formAsterisk {
    color: #e65450;
}

.formSection {
    margin-bottom: 26px;
}

.formSection-header {
    margin-bottom: 12px;

    &:after {
        content: '';
        display: table;
        clear: both;
    }
}

.formSection-title {
    font-family: var(--main-font-family-3);
    font-size: 16px;
    line-height: 20px;
    font-weight: normal;
    margin: 0 0 6px 0;
    color: #323232;

    &:last-child {
        margin-bottom: 4px;
    }
}

.formSection-para {
    margin: 0;
    color: #666;
}

.formRowsGrid {
    display: grid;
    grid-template-columns: minmax(max-content, 87px) 1fr;
    gap: 20px 19px;
}

.formRow {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / 3;
}

.formLabel {
    display: block;
    text-align: right;
    margin-top: 4px;
    align-self: flex-start;
}

.formRow-content {
    grid-column: 2 / -1;
}

.formButton {
    font-size: 22px;
    line-height: 24px;
    padding: 7px 19px;
}

.formError {
    display: block;
    color: #7a190c;
    font-size: 11px;
    line-height: 14px;
    font-style: italic;
    padding-left: 20px;
    position: relative;
    margin-top: 5px;
    letter-spacing: -0.01em;

    &:before {
        content: '';
        display: block;
        width: 14px;
        height: 14px;
        background-color: #7a190c;
        position: absolute;
        top: 0;
        left: 0;
    }

    &:after {
        content: '';
        display: block;
        background-color: transparent;
        position: absolute;
        top: 2px;
        left: 6px;
        width: 2px;
        height: 10px;
        border-top: 6px solid white;
        border-bottom: 2px solid white;
    }
}

@media (max-width: 1039px) {

}

@media (max-width: 767px) {
    .modalWrapper {
        padding: 0;
    }

    .formNote {
        display: none;
    }

    .formRowsGrid {
        grid-template-columns: 1fr;
    }

    .formLabel {
        text-align: left;
    }

    .formRow {
        grid-column: 1 / -1;
        gap: 5px;
    }

    .formRow-content {
        grid-column: 1 / -1;
    }

    .formNoteMobile {
        display: block;
        text-align: right;
    }
}