I once had an issue like that but it was because of a very silly error. The button handling the signin function was tagged "type=submit" for some reason (I had probably just copied and pasted it from elsewhere), and this was clearing all the data - including the iframe popup almost immediately the button was clicked.
But also, go to the settings tab on the Authenticate section in firebase and add your domain name - preferably without any peripherals like www or https, just name and extension.
Edit- I just examined your html thoroughly for the first time and it is exactly the same error. You are using a form button that is refreshing the page. Use a button outside the "form" tag, and remove "type="submit".