.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none; /* Скрываем окно по умолчанию */
    z-index: 1000;
}

.modal.active {
    display: block; /* Отображаем активное окно */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--primary-color);
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    font-size: 1rem;
    color: var(--primary-color);
}

/* Затенение фона */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
    z-index: 999;
    display: none; /* Скрываем затенение */
}

.overlay.active {
    display: block; /* Отображаем затенение */
}

.modal-form {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color); /* Прозрачный чёрный фон */
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow-y: auto; /* Прокрутка при необходимости */
}

.modal-content {
    position: relative;
    background-color: var(--background-color);
    width: 90%; /* Адаптивная ширина */
    max-width: 700px; /* Максимальная ширина */
    max-height: 90vh; /* Ограничиваем высоту до 90% высоты окна */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* Убираем лишний контент */
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем содержимое */
    box-sizing: border-box; /* Учитываем отступы */
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
}

.close:hover {
    color: var(--primary-darker-color);
}

.iframe-container {
    width: 100%; /* Занимает всю ширину модального окна */
    height: 100%; /* Занимает всю высоту доступного пространства */
    flex-grow: 1; /* Расширяется на доступное пространство */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* Включаем прокрутку */
    box-sizing: border-box; /* Учитываем отступы */
    padding: 10px; /* Добавляем отступы вокруг формы */
}

.iframe-container iframe {
    width: 100%; /* Занимает всю ширину контейнера */
    height: auto; /* Высота определяется содержимым */
    border: none; /* Убираем границы */
    display: block; /* Гарантируем, что iframe ведёт себя как блок */
    box-sizing: border-box; /* Учитываем отступы */
    min-height: 700px; /* Минимальная высота iframe */
    margin-top: 20px; /* Отступ сверху, чтобы форма не была обрезана */
}

