/* ===== LOGIN ANIMATIONS ===== */

/* Keyframes */
@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loginFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

@keyframes loginPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes loginGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

@keyframes loginShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes loginBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes loginShakeError {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

/* Background Orbs Animation */
.login-gradient-orb {
    animation: loginFloat 8s ease-in-out infinite;
}

.login-orb-1 {
    animation-delay: 0s;
    animation-duration: 10s;
}

.login-orb-2 {
    animation-delay: 2s;
    animation-duration: 12s;
}

.login-orb-3 {
    animation-delay: 4s;
    animation-duration: 14s;
}

/* Page Load Animations */
.login-container {
    animation: loginScaleIn 0.8s ease-out;
}

.login-card {
    animation: loginFadeIn 1s ease-out 0.2s both;
}

/* Logo Animations */
.login-logo-container {
    animation: loginBounce 1.5s ease-out 0.4s both;
}

.login-logo-icon {
    animation: loginPulse 2s infinite;
}

.login-logo-text {
    animation: loginSlideIn 0.8s ease-out 0.6s both;
}

/* Header Animations */
.login-header {
    animation: loginFadeIn 0.8s ease-out 0.8s both;
}

.login-title {
    animation: loginSlideIn 0.6s ease-out 1s both;
}

.login-subtitle {
    animation: loginSlideIn 0.6s ease-out 1.2s both;
}

/* Form Animations */
.login-form {
    animation: loginFadeIn 0.8s ease-out 1.4s both;
}

.login-form-group:nth-child(1) {
    animation: loginSlideIn 0.6s ease-out 1.6s both;
}

.login-form-group:nth-child(2) {
    animation: loginSlideIn 0.6s ease-out 1.8s both;
}

/* Input Focus Animations */
.login-form-control:focus {
    animation: loginGlow 0.3s ease-out;
}

.login-input-icon {
    transition: all 0.3s ease;
}

.login-form-control:focus ~ .login-input-icon {
    animation: loginBounce 0.6s ease-out;
}

/* Button Animations */
.login-btn {
    animation: loginFadeIn 0.8s ease-out 2s both;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    animation: loginShine 0.5s ease-out;
}

.login-btn:hover {
    animation: loginPulse 0.6s ease-out;
}

.login-btn:active {
    animation: loginBounce 0.3s ease-out;
}

/* Loading Animation */
.login-btn.loading::after {
    animation: loginRotate 1s linear infinite;
}

/* Alert Animations */
.login-alert {
    animation: loginSlideIn 0.5s ease-out;
}

.login-alert-danger {
    animation: loginShakeError 0.5s ease-out;
}

.login-alert-success {
    animation: loginBounce 0.8s ease-out;
}

/* Footer Animation */
.login-footer {
    animation: loginFadeIn 0.8s ease-out 2.2s both;
}

.login-footer-text {
    animation: loginSlideIn 0.6s ease-out 2.4s both;
}

/* Hover Effects */
.login-card:hover {
    animation: loginGlow 0.3s ease-out;
}

.login-form-control:hover {
    transform: translateY(-1px);
    transition: var(--transition-all);
}

.login-input-container:hover .login-input-icon {
    animation: loginPulse 0.6s ease-out;
}

/* Interactive Animations */
.login-form-group {
    transition: var(--transition-all);
}

.login-form-group:hover {
    transform: translateY(-2px);
}

/* Error State Animations */
.login-form-control.error {
    animation: loginShakeError 0.5s ease-out;
    border-color: #f44336;
}

.login-form-control.error ~ .login-input-icon {
    color: #f44336;
    animation: loginShakeError 0.5s ease-out;
}

/* Success State Animations */
.login-form-control.success {
    animation: loginGlow 0.3s ease-out;
    border-color: #4caf50;
}

.login-form-control.success ~ .login-input-icon {
    color: #4caf50;
    animation: loginBounce 0.6s ease-out;
}

/* Typing Animation for Placeholders */
@keyframes loginTyping {
    from { width: 0; }
    to { width: 100%; }
}

.login-form-control:focus::placeholder {
    animation: loginTyping 0.3s ease-out;
}

/* Card Entrance Sequence */
.login-card::before {
    animation: loginSlideIn 1s ease-out 0.5s both;
}

/* Staggered Form Element Animation */
.login-input-container:nth-child(1) {
    animation-delay: 1.6s;
}

.login-input-container:nth-child(2) {
    animation-delay: 1.8s;
}

/* Background Gradient Animation */
.login-background {
    animation: loginFadeIn 2s ease-out;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(102, 126, 234, 0.1), 
        rgba(118, 75, 162, 0.1), 
        rgba(102, 126, 234, 0.1));
    animation: loginFloat 20s ease-in-out infinite;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .login-container {
        animation-duration: 0.6s;
    }
    
    .login-card {
        animation-duration: 0.8s;
    }
    
    .login-logo-container {
        animation-duration: 1s;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .login-gradient-orb {
        animation: none;
    }
    
    .login-logo-icon {
        animation: none;
    }
    
    .login-card,
    .login-container,
    .login-form,
    .login-header {
        animation: loginFadeIn 0.3s ease-out both;
    }
    
    .login-btn:hover {
        animation: none;
        transform: none;
    }
    
    .login-background::before {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid var(--text-primary);
    }
    
    .login-form-control {
        border: 2px solid var(--text-primary);
    }
    
    .login-btn {
        border: 2px solid var(--text-primary);
    }
}

/* Print Styles */
@media print {
    .login-gradient-orb,
    .login-background {
        display: none;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid #000;
    }
} 