/**
 * WhatsApp Popup Modal CSS
 * Agência Illuminare - Lead Tracking
 */

/* ============================================================================
   OVERLAY E CONTAINER
   ============================================================================ */

.whatsapp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    backdrop-filter: blur(2px);
}

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

.whatsapp-modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

/* ============================================================================
   HEADER
   ============================================================================ */

.whatsapp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.whatsapp-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-modal-header i {
    font-size: 24px;
}

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

.whatsapp-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.whatsapp-modal-close:active {
    transform: scale(0.95);
}

/* ============================================================================
   BODY
   ============================================================================ */

.whatsapp-modal-body {
    padding: 30px;
}

.whatsapp-modal-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* ============================================================================
   FORMULÁRIO
   ============================================================================ */

.whatsapp-popup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.whatsapp-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatsapp-form-group label i {
    color: #25d366;
    font-size: 14px;
}

.whatsapp-form-group input,
.whatsapp-form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.whatsapp-form-group input:focus,
.whatsapp-form-group textarea:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

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

.whatsapp-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* ============================================================================
   BOTÃO SUBMIT
   ============================================================================ */

.whatsapp-popup-submit {
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.whatsapp-popup-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-popup-submit:active:not(:disabled) {
    transform: translateY(0);
}

.whatsapp-popup-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.whatsapp-popup-submit i {
    font-size: 16px;
}

/* ============================================================================
   GARANTIA
   ============================================================================ */

.whatsapp-form-guarantee {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.whatsapp-form-guarantee i {
    color: #25d366;
    font-size: 14px;
}

/* ============================================================================
   MENSAGENS
   ============================================================================ */

.whatsapp-popup-message {
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 15px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-popup-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.whatsapp-popup-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.whatsapp-popup-info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

/* ============================================================================
   BOTÃO FLUTUANTE CORRIGIDO
   ============================================================================ */

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 998;
    animation: slideIn 0.5s ease-out;
}

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

.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
    color: white;
    border-radius: 50%;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    border: none;
    cursor: pointer;
    padding: 0;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-button:active {
    transform: scale(0.95);
}

.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    background: #25d366;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.whatsapp-button:hover .whatsapp-tooltip {
    opacity: 1;
}

/* ============================================================================
   RESPONSIVO
   ============================================================================ */

@media (max-width: 768px) {
    .whatsapp-modal-container {
        max-width: 95%;
    }

    .whatsapp-modal-body {
        padding: 20px;
    }

    .whatsapp-modal-header h2 {
        font-size: 18px;
    }

    .whatsapp-form-group input,
    .whatsapp-form-group textarea {
        font-size: 16px; /* Previne zoom em iOS */
    }

    .whatsapp-float {
        bottom: 20px;
        right: 20px;
    }

    .whatsapp-button {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }

    .whatsapp-tooltip {
        right: 70px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .whatsapp-modal-overlay {
        padding: 10px;
    }

    .whatsapp-modal-container {
        max-height: 95vh;
    }

    .whatsapp-modal-body {
        padding: 15px;
    }

    .whatsapp-modal-header h2 {
        font-size: 16px;
    }

    .whatsapp-modal-header {
        padding: 15px;
    }

    .whatsapp-popup-form {
        gap: 12px;
    }

    .whatsapp-form-group input,
    .whatsapp-form-group textarea {
        padding: 10px;
        font-size: 16px;
    }

    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .whatsapp-tooltip {
        display: none;
    }
}

/* ============================================================================
   ACESSIBILIDADE
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .whatsapp-modal-overlay,
    .whatsapp-modal-container,
    .whatsapp-button,
    .whatsapp-form-group input,
    .whatsapp-form-group textarea,
    .whatsapp-popup-message {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visível para navegação por teclado */
.whatsapp-modal-close:focus,
.whatsapp-popup-submit:focus,
.whatsapp-form-group input:focus,
.whatsapp-form-group textarea:focus,
.whatsapp-button:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}
