/* Animações avançadas para a tela de login */

/* Animação de partículas flutuantes */
@keyframes float1 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
        opacity: 1;
    }
    66% {
        transform: translateY(-10px) rotate(240deg);
        opacity: 0.8;
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translateX(0px) translateY(0px) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translateX(15px) translateY(-25px) scale(1.1);
        opacity: 1;
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-15px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translateY(-5px) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translateY(-10px) rotate(270deg) scale(1.05);
    }
}

/* Aplicar animações diferentes aos elementos flutuantes */
.floating-element:nth-child(1) {
    animation: float1 12s ease-in-out infinite;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    animation: float2 15s ease-in-out infinite;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    animation: float3 18s ease-in-out infinite;
    animation-delay: 4s;
}

.floating-element:nth-child(4) {
    animation: float1 20s ease-in-out infinite reverse;
    animation-delay: 6s;
}

.floating-element:nth-child(5) {
    animation: float2 14s ease-in-out infinite reverse;
    animation-delay: 8s;
}

/* Animação do logo */
@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(104, 122, 228, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(104, 122, 228, 0.5);
    }
}

.logo-icon {
    animation: logoPulse 4s ease-in-out infinite;
}

/* Animação de texto digitando */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #687ae4; }
}

.typing-text {
    overflow: hidden;
    border-right: 2px solid #687ae4;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Efeito de ondas no fundo */
.wave-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 70%);
    animation: wave 15s linear infinite;
}

.wave:nth-child(2) {
    animation-delay: -7.5s;
    animation-duration: 20s;
}

@keyframes wave {
    0% {
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) translateY(-50%) rotate(360deg);
    }
}

/* Animação de glow nos inputs focados */
@keyframes inputGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(104, 122, 228, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(104, 122, 228, 0.6);
    }
}

.input-group.focused input {
    animation: inputGlow 2s ease-in-out infinite;
}

/* Animação de sucesso no botão */
@keyframes successPulse {
    0% {
        transform: scale(1);
        background: var(--gradient-primary);
    }
    50% {
        transform: scale(1.05);
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    }
    100% {
        transform: scale(1);
        background: var(--gradient-primary);
    }
}

.btn-login.success {
    animation: successPulse 0.6s ease-in-out;
}

/* Animação de erro */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-form.error {
    animation: shake 0.6s ease-in-out;
}

.error {
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animação de carregamento avançada */
@keyframes loadingDots {
    0%, 20% {
        color: rgba(255, 255, 255, 0.4);
        transform: scale(1);
    }
    50% {
        color: white;
        transform: scale(1.2);
    }
    100% {
        color: rgba(255, 255, 255, 0.4);
        transform: scale(1);
    }
}

.loading-text .dot {
    animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-text .dot:nth-child(1) { animation-delay: 0s; }
.loading-text .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-text .dot:nth-child(3) { animation-delay: 0.4s; }

/* Efeito parallax sutil */
@keyframes parallax {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-20px);
    }
}

.parallax-element {
    animation: parallax 10s ease-in-out infinite alternate;
}

/* Animação de abertura do modal/card */
@keyframes modalOpen {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(100px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-content-box.opening {
    animation: modalOpen 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Efeitos de hover melhorados */
.feature-item:hover {
    transform: translateX(10px) scale(1.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover i {
    transform: scale(1.2) rotate(5deg);
    transition: all 0.3s ease;
}

/* Animação de progresso */
@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-bar {
    animation: progressFill 2s ease-out;
}

/* Responsividade das animações */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .floating-element {
        display: none; /* Esconder elementos flutuantes em mobile */
    }
    
    .wave {
        animation-duration: 10s; /* Animações mais rápidas em mobile */
    }
    
    .logo-icon {
        animation-duration: 2s;
    }
}