When entering a username and password on a web application I have always wondered why the username often equals personal email address (which is often known or easy to guess or find). A random username for login would be more secure in my opinion.
However, I also wonder why often we show the username field in plain text and don't protect it the same against shoulder surfing, screen grabbing et cetera, by hiding what the user types using a HTML password input field instead of text input field. The very same thing really applies on 2FA codes that are usually being typed into a visible text field.
Why don't we use HTML password input fields for usernames and 2FA codes in the front-end of web applications? Why is this not a common practice? Even with a 'preview eye' button next to it, it's likely safer than just showing it in plain text.
Also are there any described best practices that recommend web developers to not use an email address as username, and hide the username and 2FA codes in the front-end too?