/* ===== POPUP STYLES - VERSÃO MELHORADA ===== */

:root {
    --primary-green: #566347;
    --bg-cream: #FAF8F3;
    --accent-beige: #D6D3C5;
    --text-gray: #888888;
    --white: #ffffff;
    --dark-text: #333333;
    --red-offer: #ff6b6b;
    --security-green: #28a745;
    --timer-red: #dc3545;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(86, 99, 71, 0.85);
    z-index: 10000;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.popup-overlay.popup-show {
    display: flex !important;
    opacity: 1 !important;
}

.popup-container {
    background: white;
    border-radius: 25px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
    border: 3px solid var(--primary-green);
    visibility: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    display: block;
}

.popup-overlay.popup-show .popup-container {
    visibility: visible !important;
    opacity: 1 !important;
    transform: scale(1) !important;
    display: block !important;
}

.popup-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, #4a5a3d 100%);
    color: var(--white);
    padding: 25px;
    border-radius: 22px 22px 0 0;
    text-align: center;
    position: relative;
}

.popup-header h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.popup-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: block;
    animation: bounce 2s infinite;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.popup-content {
    padding: 30px 25px;
}

.popup-subtitle {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.popup-motivation {
    background: linear-gradient(135deg, rgba(86, 99, 71, 0.1) 0%, rgba(214, 211, 197, 0.2) 100%);
    border-radius: 15px;
    margin: 20px 0;
    border-left: 4px solid var(--primary-green);
}

.popup-motivation p {
    font-size: 1rem;
    color: var(--primary-green);
    font-weight: 600;
    margin: 0;
    padding: 15px;
    text-align: center;
}

/* ===== TIMER NO POPUP ===== */
.popup-timer {
    background: linear-gradient(135deg, var(--timer-red) 0%, #c82333 100%);
    color: var(--white);
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.popup-timer-text {
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.popup-timer-display {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* ===== FORMULÁRIO ===== */
.lead-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--accent-beige);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(86, 99, 71, 0.1);
    transform: translateY(-2px);
}

/* ===== CTA BUTTON COM PULSO MELHORADO ===== */
.popup-cta-button {
    width: 100%;
    padding: 18px 25px;
    background: linear-gradient(135deg, var(--primary-green) 0%, #4a5a3d 100%);
    color: var(--white);
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    
    /* EFEITO DE PULSO CONTÍNUO */
    animation: popup-cta-pulse 2s infinite;
    box-shadow: 0 6px 20px rgba(86, 99, 71, 0.4);
}

.popup-cta-button:hover {
    background: linear-gradient(135deg, #4a5a3d 0%, var(--primary-green) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(86, 99, 71, 0.5);
}

.popup-cta-button:active {
    transform: translateY(-1px);
}

/* Efeito de brilho no botão */
.popup-cta-button::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;
}

.popup-cta-button:hover::before {
    left: 100%;
}

/* ===== ITENS DE SEGURANÇA MELHORADOS ===== */
.popup-security {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.1) 100%);
    border-radius: 15px;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.security-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.security-item:last-child {
    margin-bottom: 0;
}

.security-item:hover {
    transform: translateX(5px);
}

.security-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    min-width: 24px;
    text-align: center;
}

.security-text {
    font-size: 0.95rem;
    color: var(--security-green);
    font-weight: 600;
    line-height: 1.3;
}

/* Tamanhos diferentes para hierarquia visual */
.security-item:nth-child(1) .security-text {
    font-size: 1rem;
    font-weight: 700;
}

.security-item:nth-child(2) .security-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.security-item:nth-child(3) .security-text {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== ANIMAÇÕES MELHORADAS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes popup-cta-pulse {
    0% {
        box-shadow: 0 6px 20px rgba(86, 99, 71, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(86, 99, 71, 0.6), 0 0 0 10px rgba(86, 99, 71, 0.1);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 6px 20px rgba(86, 99, 71, 0.4);
        transform: scale(1);
    }
}

/* ===== VARIAÇÕES POR PLANO ===== */
.popup-basico .popup-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, #4a5a3d 100%);
}

.popup-basico .popup-cta-button {
    background: linear-gradient(135deg, var(--primary-green) 0%, #4a5a3d 100%);
    animation: popup-cta-pulse-basico 2s infinite;
}

@keyframes popup-cta-pulse-basico {
    0% {
        box-shadow: 0 6px 20px rgba(86, 99, 71, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(86, 99, 71, 0.6), 0 0 0 10px rgba(86, 99, 71, 0.1);
    }
    100% {
        box-shadow: 0 6px 20px rgba(86, 99, 71, 0.4);
    }
}

.popup-essencial .popup-header {
    background: linear-gradient(135deg, var(--red-offer) 0%, #ff5252 100%);
}

.popup-essencial .popup-cta-button {
    background: linear-gradient(135deg, var(--red-offer) 0%, #ff5252 100%);
    animation: popup-cta-pulse-essencial 2s infinite;
}

@keyframes popup-cta-pulse-essencial {
    0% {
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6), 0 0 0 10px rgba(255, 107, 107, 0.1);
    }
    100% {
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    }
}

.popup-premium .popup-header {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.popup-premium .popup-cta-button {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    animation: popup-cta-pulse-premium 2s infinite;
}

@keyframes popup-cta-pulse-premium {
    0% {
        box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(111, 66, 193, 0.6), 0 0 0 10px rgba(111, 66, 193, 0.1);
    }
    100% {
        box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    }
}

/* ===== OTIMIZAÇÕES PARA MOBILE ===== */

/* Tablets e dispositivos médios */
@media (max-width: 768px) {
    .popup-container {
        max-width: 95%;
        width: 95%;
        margin: 10px;
        border-radius: 20px;
        max-height: 95vh;
    }
    
    .popup-header {
        padding: 20px 15px;
        border-radius: 17px 17px 0 0;
    }
    
    .popup-header h3 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .popup-content {
        padding: 20px 15px;
    }
    
    .popup-subtitle {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .popup-motivation p {
        font-size: 0.95rem;
        padding: 12px;
    }
    
    .popup-timer {
        padding: 12px;
        margin: 12px 0;
    }
    
    .popup-timer-text {
        font-size: 0.85rem;
    }
    
    .popup-timer-display {
        font-size: 1.2rem;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 12px 15px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .popup-cta-button {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: 12px;
        margin-top: 15px;
    }
    
    .popup-security {
        margin-top: 20px;
        padding: 15px;
    }
    
    .security-item {
        margin-bottom: 10px;
        padding: 6px 0;
    }
    
    .security-text {
        font-size: 0.9rem;
    }
    
    .security-item:nth-child(1) .security-text {
        font-size: 0.95rem;
    }
    
    .security-item:nth-child(2) .security-text {
        font-size: 0.9rem;
    }
    
    .security-item:nth-child(3) .security-text {
        font-size: 0.85rem;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    .popup-overlay {
        padding: 5px;
    }
    
    .popup-container {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 15px;
        max-height: 98vh;
        min-height: auto;
    }
    
    .popup-header {
        padding: 18px 12px;
        border-radius: 12px 12px 0 0;
    }
    
    .popup-header h3 {
        font-size: 1.2rem;
        line-height: 1.2;
        margin-bottom: 6px;
    }
    
    .popup-icon {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .popup-close {
        top: 8px;
        right: 8px;
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .popup-content {
        padding: 18px 12px;
    }
    
    .popup-subtitle {
        font-size: 0.95rem;
        margin-bottom: 12px;
        line-height: 1.3;
    }
    
    .popup-motivation {
        margin: 12px 0;
    }
    
    .popup-motivation p {
        font-size: 0.9rem;
        padding: 10px;
        border-radius: 8px;
    }
    
    .popup-timer {
        padding: 10px;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .popup-timer-text {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .popup-timer-display {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .lead-form {
        margin-top: 15px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 5px;
        font-weight: 600;
    }
    
    .form-group input {
        padding: 14px 12px;
        font-size: 1rem;
        border-radius: 8px;
        border: 2px solid var(--accent-beige);
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-group input:focus {
        border-color: var(--primary-green);
        outline: none;
        box-shadow: 0 0 0 3px rgba(86, 99, 71, 0.1);
    }
    
    .popup-cta-button {
        padding: 16px 20px;
        font-size: 1.1rem;
        border-radius: 10px;
        margin-top: 18px;
        width: 100%;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .popup-cta-button:active {
        transform: translateY(1px);
    }
    
    .popup-security {
        margin-top: 15px;
        padding: 12px;
        border-radius: 10px;
    }
    
    .security-item {
        margin-bottom: 8px;
        padding: 4px 0;
    }
    
    .security-icon {
        font-size: 1.1rem;
        margin-right: 10px;
        min-width: 20px;
    }
    
    .security-text {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .security-item:nth-child(1) .security-text {
        font-size: 0.9rem;
        font-weight: 700;
    }
    
    .security-item:nth-child(2) .security-text {
        font-size: 0.85rem;
        font-weight: 600;
    }
    
    .security-item:nth-child(3) .security-text {
        font-size: 0.8rem;
        font-weight: 500;
    }
}

/* Smartphones pequenos */
@media (max-width: 360px) {
    .popup-container {
        border-radius: 12px;
    }
    
    .popup-header {
        padding: 15px 10px;
        border-radius: 9px 9px 0 0;
    }
    
    .popup-header h3 {
        font-size: 1.1rem;
    }
    
    .popup-content {
        padding: 15px 10px;
    }
    
    .form-group input {
        padding: 12px 10px;
        font-size: 0.95rem;
    }
    
    .popup-cta-button {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .popup-timer-display {
        font-size: 1rem;
    }
}

/* Melhorias para touch */
@media (hover: none) and (pointer: coarse) {
    .popup-cta-button {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .popup-close {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .form-group input {
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Efeito de pulso para os triggers */
.popup-trigger-pulse {
    animation: pulse-trigger 2.5s infinite;
}

@keyframes pulse-trigger {
    0% {
        box-shadow: 0 4px 15px rgba(86, 99, 71, 0.3);
    }
    50% {
        box-shadow: 0 4px 15px rgba(86, 99, 71, 0.6), 0 0 0 15px rgba(86, 99, 71, 0.1);
    }
    100% {
        box-shadow: 0 4px 15px rgba(86, 99, 71, 0.3);
    }
}


/* ===== LOADING SPINNER ===== */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== MENSAGENS DO POPUP ===== */
.popup-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.popup-message-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.2) 100%);
    color: var(--security-green);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.popup-message-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.2) 100%);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.popup-message-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.2) 100%);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}



/* ===== ESTILOS PARA ESTADO DE CARREGAMENTO DO BOTÃO ===== */
.popup-cta-button.loading {
    background: linear-gradient(135deg, #cccccc 0%, #b8b8b8 100%) !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    animation: none;
    position: relative;
    color: transparent !important; /* Esconde o texto original */
    pointer-events: none; /* Impede cliques durante o carregamento */
}

.popup-cta-button.loading::before {
    content: 'Processando...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666666; /* Cor do texto 'Processando' */
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 1;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-cta-button.loading .spinner {
    display: inline-block !important;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(102, 102, 102, 0.3);
    border-radius: 50%;
    border-top-color: #666666; /* Cor do spinner */
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    right: 20%;
    transform: translateY(-50%);
    z-index: 2;
}

/* Animação do spinner */
@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Esconder o spinner por padrão */
.popup-cta-button .spinner {
    display: none;
}

/* Melhorias adicionais para elegância */
.popup-cta-button {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(86, 99, 71, 0.3);
}

.popup-cta-button:hover {
    box-shadow: 0 12px 35px rgba(86, 99, 71, 0.4);
    transform: translateY(-2px);
}

/* Melhorias para os diferentes planos */
.popup-essencial .popup-cta-button:hover {
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

.popup-premium .popup-cta-button:hover {
    box-shadow: 0 12px 35px rgba(111, 66, 193, 0.4);
}

/* Melhorias no formulário */
.form-group input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--accent-beige);
}

.form-group input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(86, 99, 71, 0.1);
    transform: translateY(-1px);
}

/* Melhorias na motivação */
.popup-motivation {
    background: linear-gradient(135deg, rgba(86, 99, 71, 0.08) 0%, rgba(214, 211, 197, 0.15) 100%);
    border-radius: 15px;
    margin: 20px 0;
    border-left: 4px solid var(--primary-green);
    box-shadow: 0 2px 10px rgba(86, 99, 71, 0.1);
}

/* Melhorias no timer */
.popup-timer {
    background: linear-gradient(135deg, var(--timer-red) 0%, #c82333 100%);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.25);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.popup-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: timer-shine 3s infinite;
}

@keyframes timer-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Melhorias nos itens de segurança */
.security-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    padding: 10px 8px;
}

.security-item:hover {
    background: rgba(40, 167, 69, 0.05);
    transform: translateX(8px);
}

/* Melhorias no container do popup */
.popup-container {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

/* Melhorias no header */
.popup-header {
    position: relative;
    overflow: hidden;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: header-shine 4s infinite;
}

@keyframes header-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}


