.modal-overlay {
    display: none;
    position: fixed;
    /* Фиксированное положение относительно окна браузера */
    top: 0;
    left: 0;
    width: 100%;
    /* Полное покрытие экрана */
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Полупрозрачное затемнение */
    justify-content: center;
    /* Центрирование по горизонтали */
    align-items: center;
}

.modal {
    position: fixed;
    left: calc(50% - 584px/2);
    top: calc(50% - 720px/2);
    background: #FFFFFF;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    filter: drop-shadow(0px 2px 8px rgba(17, 17, 30, 0.15));
    padding: 24px 24px 52px 48px;
}

.modal-close {
    background: #FFFFFF;
    float: right;
    cursor: pointer;
}

.modal-content {
    margin-top: 64px;
}

.modal-heading1 {
    text-align: center;
    width: 440px;
}

.modal-heading2 {
    font-weight: 400;
    color: #3A3A3C;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 24px;
    width: 440px;
}

label {
    font-size: 15px;
    font-weight: 400;
    color: #3A3A3C;
}

.modal-item {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    gap: 4px;
}

input {
    border: 0.5px solid #A1A1A3;
    color: #1C1C1E;
    border-radius: 4px;
    height: 48px;
    max-height: 100px;
    width: 440px;
    padding: 12px;
    margin-right: 24px;
}

textarea {
    border: 0.5px solid #A1A1A3;
    color: #1C1C1E;
    border-radius: 4px;
    height: 100px;
    width: 440px;
    padding: 12px;
    margin-right: 24px;
    resize: none;
    box-sizing: border-box;
}

.submit-button {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 440px;
    height: 60px;
    color: #FFFFFF;
    background: #1047B0;
    box-shadow: 0px 2px 8px rgba(17, 17, 30, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: color 180ms ease-in-out;
}

.submit-button:hover {
    color: #FFFFFF;
    background: #1859D7;
}

.checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid #3A3A3C;
    border-radius: 2px;
    margin-right: 4px;
}

#checkbox-text {
    width: 420px;
}

#modal-item {
    display: flex;
    flex-direction: row;
    margin-top: 20px;
    margin-bottom: 24px;
}

#success-modal {
    padding: 40px;
}

#modal-content {
    margin-right: 24px;
}

#modal-heading1 {
    margin-top: 24px;
}

#modal-heading2 {
    margin: 20px 0 64px;
} 

.hidden {
    display: none;
}
.visible {
    display: block;
}

@media (max-width: 600px) {
    .modal-overlay {
        z-index: 100;
    }

    .modal {
        width: 100%;
        height: 100%;
        background: #FFFFFF;
        top: 0;
        left: 0;
        padding: 24px 20px 40px;
    }

    .modal .hidden {
        display: none;
    }

    .modal-close {
        background: #FFFFFF;
        float: right;
        cursor: pointer;
    }

    #close {
        width: 24px;
    }

    .modal-content {
        margin-top: 28px;
    }

    .modal-heading1 {
        text-align: center;
        width: 100%;
    }

    .modal-heading2 {
        font-weight: 400;
        color: #3A3A3C;
        text-align: center;
        margin-top: 12px;
        margin-bottom: 24px;
        width: 100%;
    }

    label {
        font-size: 13px;
        font-weight: 400;
        color: #3A3A3C;
    }

    .modal-item {
        margin-top: 12px;
        gap: 4px;
    }

    input {
        height: 40px;
        max-height: 100px;
        width: 100%;
        padding: 12px;
    }

    textarea {
        height: 100px;
        width: 100%;
        padding: 12px;
    }

    .submit-button {
        width: 100%;
        height: 44px;
    }

    .checkbox {
        width: 18px;
        height: 18px;
        border: 1.5px solid #3A3A3C;
        border-radius: 2px;
        margin-right: 4px;
    }

    #checkbox-text {
        width: 100%;
    }

    #modal-item {
        display: flex;
        flex-direction: row;
        margin-top: 20px;
        margin-bottom: 24px;
        align-items: flex-start;
        gap: 4px;
    }


    #success-modal .modal-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 160px;
    }

    #modal-heading2 {
        margin: 12px 0 40px;
    }
   
}