.form-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.form-modal.active {
    display: block;
}

/* overlay на весь экран */
.form-modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* центрируем через flex */
.form-modal_content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 100%;
    max-width: 640px;

    background: #fff;
    padding: 64px;
    border-radius: 30px;
    z-index: 2;
}

@media (max-width: 600px) {
    .form-modal_content {
        padding: 30px;
        width: 96%;
    }
}
/* крестик */
.form-modal_close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.form-modal_close::before,
.form-modal_close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: #333;
    transform-origin: center;
}

.form-modal_close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.form-modal_close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ошибки */
.form-error {
    display: block;
    font-size: 12px !important;
    color: red !important;
    margin-top: 4px;
}

input.error {
    border: 1px solid red;
}

.success-modal,
.error-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.success-modal.active,
.error-modal.active {
    display: flex;
}

.success-modal_overlay,
.error-modal_overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.success-modal_content,
.error-modal_content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    height: 673px;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    padding: 64px 64px 0;
}

.success-modal_close,
.error-modal_close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.success-modal_close::before,
.error-modal_close::before,
.success-modal_close::after,
.error-modal_close::after {
    content: "";
    position: absolute;
    width: 23px;
    height: 1px;
    background: #595959;
    left: 0;
    top: 11px;
}

.success-modal_close::before,
.error-modal_close::before {
    transform: rotate(45deg);
}

.success-modal_close::after,
.error-modal_close::after {
    transform: rotate(-45deg);
}

.success-modal_title,
.error-modal_title {
    margin: 0;
    font-family: "Gilroy", sans-serif;
    font-size: 46px;
    line-height: 1.15;
    font-weight: 600;
    color: #333;
}

.success-modal_subtitle,
.error-modal_subtitle {
    max-width: 512px;
    font-family: "Gilroy", sans-serif;
    font-weight: 400;
    font-size: 16px;
    text-align: center;
    margin: 16px auto 0;
    line-height: 1.4;
    color: #595959;
}

.success-modal_image,
.error-modal_image {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 666px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.success-modal_image img,
.error-modal_image img {
    display: block;
    width: auto;
    max-width: 90%;
    height: 666px;
    object-fit: contain;
    object-position: bottom center;
}

@media (max-width: 600px) {
    .success-modal,
    .error-modal {
        padding: 10px;
    }

    .success-modal_content,
    .error-modal_content {
        height: 500px;
        border-radius: 22px;
        padding: 45px 20px 0;
    }

    .success-modal_title,
    .error-modal_title {
        font-size: 28px;
    }

    .success-modal_subtitle,
    .error-modal_subtitle {
        font-size: 13px;
    }

    .success-modal_image,
    .error-modal_image {
        height: 280px;
    }

    .success-modal_image img,
    .error-modal_image img {
        height: 280px;
        max-width: 100%;
    }

    .success-modal_close,
    .error-modal_close {
        top: 20px;
        right: 20px;
    }
}