Where does the period go in an MLA in-text citation?

I've always been confused when citing like:

"The windows misted over from the heat and the smoke inside.” (Hemingway 1)

Does the period go inside the quotes (as above)? Or after the citation (as below)?

"The windows misted over from the heat and the smoke inside” (Hemingway 1).


Solution 1:

The second is correct, the period goes after the citation.

Solution 2:

"The period goes after the complete citation because the citation is considered part of the sentence" (me 34).