/* Efeito de gradiente animado */
@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-bg {
    background: linear-gradient(270deg, #4f46e5, #9333ea, #f472b6);
    background-size: 200% 200%;
    animation: gradientBackground 10s ease infinite;
}

/* Efeito de hover nos cards */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Esconder seções inicialmente */
#simuladorAcrescimo, #simuladorDesconto, #escolhaMetodoPagamento {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#simuladorAcrescimo.active, #simuladorDesconto.active, #escolhaMetodoPagamento.active {
    opacity: 1;
    transform: translateY(0);
}

/* Estilos para o overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
}

/* Estilos para o pop-up */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 500px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.popup.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Estilos para o botão de fechar */
.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.popup-close:hover {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

/* Validação de entrada */
.input-error {
    border-color: #ef4444 !important;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Animações para o alerta */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Ajustes para dispositivos móveis */
@media (max-width: 768px) {
    .popup {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        overflow-y: auto;
    }

    .popup.active {
        transform: none;
    }

    .popup-content {
        padding-top: 48px;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .popup-close {
        position: fixed;
        top: 16px;
        right: 16px;
    }
}