/* Стили для фона */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px); /* Размытие только фона */
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000; /* Фон ниже модального окна */
}

/* Стили для модального окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Модалка выше фона */
    visibility: hidden;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative; /* Убеждаемся, что содержимое не размывается */
    z-index: 1001;
}

/* Секции */
.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Кнопка закрытия */
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #374151;
}

/* Кнопки */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-secondary {
    background: #e5e7eb;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-primary {
    background: #d99e5a;
    color: white;
}

.btn-primary:hover {
    background: #d99e5a;
    color: white;
}

/* Состояние открытого окна */
.modal.active {
    visibility: visible;
}

.modal.active .modal-backdrop {
    opacity: 1;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}