/* ====================================
   ANIMATIONS - Tedulia
   Background animé avec formules mathématiques
   ==================================== */

/* ===== ANIMATED BACKGROUND ===== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 230, 109, 0.06) 0%, transparent 50%);
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Particules mathématiques individuelles (contrôlées par JavaScript) */
.math-particle {
    position: fixed;
    font-size: 20px;
    color: rgba(44, 62, 80, 0.06);
    pointer-events: none;
    user-select: none;
    will-change: transform;
    font-weight: 500;
    z-index: 1;
}

/* Création dynamique de particules via JavaScript (optionnel) */
/* On peut ajouter plus de particules avec des positions/timings aléatoires */

@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, -100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Effet de profondeur avec plusieurs couches */
.animated-bg .layer-1 {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(45deg, transparent 30%, rgba(255, 107, 53, 0.02) 30%, rgba(255, 107, 53, 0.02) 70%, transparent 70%);
    background-size: 100px 100px;
    animation: slide1 30s linear infinite;
}

.animated-bg .layer-2 {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(-45deg, transparent 30%, rgba(78, 205, 196, 0.02) 30%, rgba(78, 205, 196, 0.02) 70%, transparent 70%);
    background-size: 80px 80px;
    animation: slide2 25s linear infinite reverse;
}

@keyframes slide1 {
    from { transform: translateX(0); }
    to { transform: translateX(100px); }
}

@keyframes slide2 {
    from { transform: translateY(0); }
    to { transform: translateY(80px); }
}

/* Effet de lueur douce sur les éléments interactifs */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.2);
    }
}

.auth-card {
    animation: pulse-glow 4s ease-in-out infinite;
}

/* Animation d'entrée pour le logo */
@keyframes logo-entrance {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.logo-text {
    animation: logo-entrance 0.6s ease-out;
}

/* Animation pour la value proposition */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.value-proposition {
    animation: slide-up 0.8s ease-out 0.2s both;
}

.beta-badge {
    animation: slide-up 0.8s ease-out 0.4s both;
}

/* Effet de survol sur les inputs */
.form-input:hover {
    border-color: var(--color-primary-light);
}

/* Animation du bouton au chargement */
@keyframes button-entrance {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-primary {
    animation: button-entrance 0.6s ease-out 0.6s both;
}

/* Effet de particules sur le hover du bouton */
.btn-primary::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;
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Responsive: réduire l'intensité des animations sur mobile */
@media (max-width: 768px) {
    .animated-bg::after {
        font-size: 18px;
        letter-spacing: 20px;
    }

    .math-particle {
        font-size: 16px;
    }
}

/* Préférence utilisateur: réduire les animations */
@media (prefers-reduced-motion: reduce) {
    .animated-bg::before,
    .animated-bg::after,
    .math-particle,
    .animated-bg .layer-1,
    .animated-bg .layer-2 {
        animation: none;
    }

    .auth-card {
        animation: none;
    }
}
