/* Стили для попап-формы заявок */

/* Overlay (фон попапа) */
.contact-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Основной контейнер попапа */
.contact-popup {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(20px);
    animation: popupSlideIn 0.3s ease forwards;
}

@keyframes popupSlideIn {
    to {
        transform: scale(1) translateY(0);
    }
}

/* Заголовок попапа */
.contact-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.contact-popup-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.contact-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.contact-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Тело попапа */
.contact-popup-body {
    padding: 32px;
}

/* Форма */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.form-group input {
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #2d3748;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #a0aec0;
}

/* Кнопки */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-submit {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-cancel {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

/* Состояние загрузки */
.contact-popup-loading {
    padding: 48px 32px;
    text-align: center;
    color: #4a5568;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.contact-popup-loading p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

/* Состояние успеха */
.contact-popup-success {
    padding: 48px 32px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    color: white;
    font-weight: bold;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.contact-popup-success h4 {
    margin: 0 0 12px;
    font-size: 24px;
    color: #2d3748;
    font-weight: 600;
}

.contact-popup-success p {
    margin: 0 0 32px;
    color: #4a5568;
    font-size: 16px;
    line-height: 1.5;
}

.btn-ok {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

/* Адаптивность */
@media (max-width: 640px) {
    .contact-popup {
        width: 95%;
        margin: 20px;
    }
    
    .contact-popup-header {
        padding: 20px 24px;
    }
    
    .contact-popup-header h3 {
        font-size: 20px;
    }
    
    .contact-popup-body {
        padding: 24px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancel {
        order: 2;
    }
    
    .contact-popup-loading,
    .contact-popup-success {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .contact-popup-header {
        padding: 16px 20px;
    }
    
    .contact-popup-body {
        padding: 20px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .btn-submit,
    .btn-cancel,
    .btn-ok {
        padding: 14px 20px;
    }
}

/* Анимация для кнопок с data-contact-popup */
[data-contact-popup] {
    transition: all 0.2s ease;
    cursor: pointer;
}

[data-contact-popup]:hover {
    transform: translateY(-2px);
}

/* Дополнительные утилитарные классы */
.contact-popup-overlay.closing {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

.contact-popup.closing {
    animation: popupSlideOut 0.2s ease forwards;
}

@keyframes popupSlideOut {
    to {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
}