/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

/* Форма */
.consultation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #009846;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 152, 70, 0.1);
}

.form-group input:invalid:not(:focus) {
    border-color: #e31e24;
}

.form-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #009846, #007c3a);
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 152, 70, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.form-notice {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin: 0;
}

/* Сообщения об ошибках */
.error {
    color: #e31e24;
    font-size: 12px;
    margin-top: 5px;
}

/* Успешная отправка */
.form-success {
    text-align: center;
    padding: 40px 30px;
}

.form-success-icon {
    width: 60px;
    height: 60px;
    background: #009846;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: successScale 0.5s ease-out;
}

@keyframes successScale {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.form-success-icon i {
    color: white;
    font-size: 24px;
}

.form-success-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.form-success-text {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal {
        padding: 15px;
    }
    
    .modal-container {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px 25px 15px;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 15px 20px 12px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .consultation-form {
        gap: 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Глобальная ошибка */
.global-error {
    background: #e31e24 !important;
    color: white !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    font-size: 14px !important;
    border: none !important;
}

.modal.fade-out .modal-container {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s ease;
}

.modal.fade-out .modal-overlay {
    opacity: 0;
    transition: opacity 0.4s ease;
}
