/* MotoFlasher Login Styles */
/* Additional customizations for the login page */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Apply animations */
#loginform,
#lostpasswordform,
#registerform {
    animation: fadeIn 0.5s ease-out;
}

#login h1 {
    animation: fadeIn 0.4s ease-out;
}

.mf-subtitle {
    animation: fadeIn 0.45s ease-out;
}

/* Button hover effect */
#wp-submit {
    position: relative;
    overflow: hidden;
}

#wp-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

#wp-submit:hover::before {
    left: 100%;
}

/* Focus states */
#loginform input:focus,
#lostpasswordform input:focus,
#registerform input:focus {
    animation: pulse 0.3s ease;
}

/* Loading state */
.mf-loading {
    pointer-events: none;
    opacity: 0.7;
}

.mf-loading #wp-submit {
    background: linear-gradient(
        90deg,
        var(--mf-accent),
        var(--mf-accent-hover),
        var(--mf-accent)
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Forgot password styling */
#nav {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

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

.login #login_error {
    animation: shake 0.5s ease, fadeIn 0.3s ease;
}

/* Success message */
.login .message.success {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Mobile optimizations */
@media screen and (max-width: 480px) {
    #login {
        padding: 15px;
    }
    
    #loginform,
    #lostpasswordform,
    #registerform {
        padding: 20px;
        border-radius: 12px;
    }
    
    #loginform input[type="text"],
    #loginform input[type="password"] {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    #wp-submit {
        padding: 12px 20px;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but ensure consistency */
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #loginform,
    #lostpasswordform,
    #registerform {
        border-width: 2px;
    }
    
    #loginform input[type="text"],
    #loginform input[type="password"] {
        border-width: 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;
    }
}
