/* Стили для модальных окон и форм */
.modal {
    position: fixed; /* Меняем на fixed! */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Меняем на 100%! */
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute; /* Оставляем absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Меняем на 100%! */
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 2001;
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    padding: 40px 30px 30px;
    z-index: 2002;
    animation: modalAppear 0.3s ease-out;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 2003;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.modal-close:hover {
    background: var(--light);
    transform: scale(1.1);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
}

/* Убираем скролл у body когда модальное окно открыто */
body.modal-open {
    overflow: hidden;
}

/* Остальные стили форм остаются без изменений */
.callback-form,
.request-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--white);
    width: 100%;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    cursor: pointer;
}

/* Секция формы заявки */
.request-form-section {
    padding: 80px 0;
    background: var(--light);
}

.request-form-card {
    background: var(--white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.request-form-card h2 {
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--primary);
}

.request-form-card p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* Сообщения форм */
.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.field-error {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 5px;
}

/* Адаптивность форм */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
        align-items: flex-start; /* На мобильных начинаем с верха */
    }
    
    .modal-content {
        margin: 20px;
        padding: 30px 20px 20px;
        max-height: calc(100vh - 40px);
    }
    
    .request-form-card {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .request-form-card h2 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 5px;
    }
    
    .request-form-section {
        padding: 60px 0;
    }
    
    .request-form-card {
        padding: 25px 15px;
    }
    
    .modal-content {
        padding: 25px 15px;
        border-radius: 12px;
    }
}

