/**
 * Contact Form & Thank You Popup Styles
 * Стилі для форми контактів та попапу подяки
 */

/* ============================================
   POPUP STYLES - ПОПАП ПОДЯКИ
   ============================================ */

.contact-thank-you-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.contact-thank-you-popup.active {
    display: flex;
}

/* Оверлей */
.contact-thank-you-popup .popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

/* Контент попапу */
.contact-thank-you-popup .popup-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-thank-you-popup .popup-content.show {
    transform: scale(1);
    opacity: 1;
}

/* Кнопка закриття */
.contact-thank-you-popup .popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
}

.contact-thank-you-popup .popup-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

/* Іконка успіху */
.contact-thank-you-popup .popup-icon {
    margin: 0 auto 20px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.contact-thank-you-popup .popup-icon svg {
    display: block;
}

/* Заголовок */
.contact-thank-you-popup .popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px;
    animation: slideUp 0.5s ease 0.3s both;
}

/* Повідомлення */
.contact-thank-you-popup .popup-message {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 30px;
    animation: slideUp 0.5s ease 0.4s both;
}

/* Кнопка */
.contact-thank-you-popup .popup-button {
    min-width: 150px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease 0.5s both;
}

.contact-thank-you-popup .popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   FORM ALERT - ПОВІДОМЛЕННЯ ПРО ПОМИЛКИ
   ============================================ */

.contact-form-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.contact-form-alert.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.contact-form-alert .alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.contact-form-alert .alert-message {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
}

.contact-form-alert .alert-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #c33;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.contact-form-alert .alert-close:hover {
    transform: scale(1.2);
}

/* ============================================
   FORM BUTTON LOADING STATE
   ============================================ */

.contact-form-section button[type="submit"].loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.contact-form-section button[type="submit"].loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================
   ANIMATIONS - АНІМАЦІЇ
   ============================================ */

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

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE - АДАПТИВНІСТЬ
   ============================================ */

@media (max-width: 768px) {
    .contact-thank-you-popup .popup-content {
        padding: 30px 20px;
        max-width: 90%;
    }

    .contact-thank-you-popup .popup-title {
        font-size: 24px;
    }

    .contact-thank-you-popup .popup-message {
        font-size: 15px;
    }

    .contact-thank-you-popup .popup-icon svg {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .contact-thank-you-popup .popup-content {
        padding: 25px 15px;
    }

    .contact-thank-you-popup .popup-title {
        font-size: 20px;
    }

    .contact-thank-you-popup .popup-message {
        font-size: 14px;
    }

    .contact-thank-you-popup .popup-button {
        width: 100%;
    }
}

/* ============================================
   FORM VALIDATION STYLES (ОПЦІОНАЛЬНО)
   ============================================ */

.contact-form-section input.error,
.contact-form-section textarea.error,
.contact-form-section select.error {
    border-color: #f44336;
    background-color: #fff5f5;
}

.contact-form-section .field-error {
    color: #f44336;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.contact-form-section .form-group.has-error .field-error {
    display: block;
}

/* ============================================
   ACCESSIBILITY - ДОСТУПНІСТЬ
   ============================================ */

.contact-thank-you-popup .popup-close:focus,
.contact-thank-you-popup .popup-button:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Редукція анімацій для користувачів з prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .contact-thank-you-popup .popup-content,
    .contact-thank-you-popup .popup-icon,
    .contact-thank-you-popup .popup-title,
    .contact-thank-you-popup .popup-message,
    .contact-thank-you-popup .popup-button,
    .contact-form-alert {
        animation: none;
        transition: none;
    }
}