/**
 * 📬 Contact Widget - Премиум кнопка "Оставить заявку" на hero-баннере
 * Стиль: Google/Apple/Telegram Premium
 */

/* === КНОПКА НА HERO === */
.contact-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: var(--contact-btn-color, var(--primary-color, #667eea));
    background: linear-gradient(135deg, var(--contact-btn-color, var(--primary-color, #667eea)) 0%, color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 70%, #000) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                0 0 30px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 30%, transparent);
    margin-top: 25px;
    z-index: 10;
}

.contact-hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.contact-hero-btn:hover::before {
    left: 100%;
}

.contact-hero-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
                0 0 40px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 50%, transparent);
}

.contact-hero-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Пульсация */
.contact-hero-btn.pulse {
    animation: contactBtnPulse 2s ease-in-out infinite;
}

@keyframes contactBtnPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                    0 0 30px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 30%, transparent);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
                    0 0 50px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 60%, transparent);
    }
}

/* Иконка */
.contact-hero-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* === МОДАЛЬНОЕ ОКНО === */
.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.contact-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.contact-modal {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.contact-modal-overlay.active .contact-modal {
    transform: scale(1) translateY(0);
}

.contact-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.contact-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.contact-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

.contact-modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.contact-modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--contact-btn-color, var(--primary-color, #667eea)), color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 70%, #000));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 40%, transparent);
}

.contact-modal-icon svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.contact-modal-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.contact-modal-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* === ФОРМА === */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form-group {
    position: relative;
}

.contact-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.contact-form-group label .required {
    color: #e53935;
}

.contact-form-group input,
.contact-form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.contact-form-group input:focus,
.contact-form-group textarea:focus {
    border-color: var(--contact-btn-color, var(--primary-color, #667eea));
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 15%, transparent);
}

.contact-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.contact-form-group input::placeholder,
.contact-form-group textarea::placeholder {
    color: #999;
}

/* Кнопка отправки */
.contact-form-submit {
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--contact-btn-color, var(--primary-color, #667eea)) 0%, color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 70%, #000) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.contact-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--contact-btn-color, var(--primary-color, #667eea)) 40%, transparent);
}

.contact-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Успех */
.contact-success {
    text-align: center;
    padding: 30px 20px;
}

.contact-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    animation: successBounce 0.5s ease;
}

@keyframes successBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.contact-success-icon svg {
    width: 40px;
    height: 40px;
    stroke: #fff;
    stroke-width: 3;
}

.contact-success h3 {
    font-size: 24px;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.contact-success p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .contact-hero-btn {
        padding: 14px 28px;
        font-size: 16px;
    }

    .contact-modal {
        padding: 30px 25px;
        border-radius: 20px;
    }

    .contact-modal-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .contact-hero-btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
        max-width: 280px;
    }

    .contact-modal {
        padding: 25px 20px;
        width: 95%;
    }
}
