/**
 * Animações e transições
 */

/* ============================================
   PRELOADER
   ============================================ */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--branco);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#preloader.active {
    opacity: 1;
    visibility: visible;
}

#preloader.fade-out {
    opacity: 0;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-logo .logo-gov {
    color: var(--azul-gov);
}

.loader-logo .logo-br {
    color: #FFC72C;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cinza-claro);
    border-top-color: var(--azul-gov);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ANIMAÇÕES DE ENTRADA
   ============================================ */

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ANIMAÇÕES DE ELEMENTOS
   ============================================ */

.info-list li,
.benefits-list li {
    opacity: 0;
    transform: translateY(20px);
}

.info-list li.animate,
.benefits-list li.animate {
    animation: slideInItem 0.5s ease-out forwards;
}

@keyframes slideInItem {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay para animação sequencial */
.info-list li:nth-child(1) { animation-delay: 0.1s; }
.info-list li:nth-child(2) { animation-delay: 0.2s; }
.info-list li:nth-child(3) { animation-delay: 0.3s; }
.info-list li:nth-child(4) { animation-delay: 0.4s; }

.benefits-list li:nth-child(1) { animation-delay: 0.1s; }
.benefits-list li:nth-child(2) { animation-delay: 0.2s; }
.benefits-list li:nth-child(3) { animation-delay: 0.3s; }
.benefits-list li:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   TRANSIÇÕES DE PÁGINA
   ============================================ */

.page {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
    animation: pageFadeIn 0.4s ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 81, 180, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-1px);
}

.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--azul-gov);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
    left: 0;
}

/* ============================================
   FOCUS STATES
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--azul-gov);
    outline-offset: 2px;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
