/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.modal.exist {
    display: block;
}

.modal.show {
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 1200px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.modal.show .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
    transition: all 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
    text-decoration: none;
    transform: scale(1.1);
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
    text-decoration: none;
}

.modal-content h2 {
    color: #333;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-content p {
    color: #666;
    line-height: 1.6;
    text-align: justify;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(calc(-50% - 50px));
    }
    to {
        opacity: 1;
        transform: translateY(calc(-50% - 0px));
    }
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 90%;
    }

    .modal-content h2 {
        font-size: 1.5em;
    }

    .modal-content p {
        font-size: 0.9em;
    }
}
