The two words have more or less a Latin origin ; using the Latin words can help us understand the basic difference.
stupid [stupidus, stupidare,...] first means "disconcerted, speechless because you have been struck by some piece of news, an event..., stunned". It refers to a person that stands still and doesn't react to a particular event.
By extension, you could even say that stupid refers to a person who is rapturous or into ecstasies (not the drug ) when looking at someone or something (but this meaning doesn't really exist in English)
That's why a second meaning of the word is a not very intelligent person
idiot has two original Latin meaning :
- Ignorant, that doesn't know anything about a particular subject, or just have a general idea about it ( nothing more).
- Particular, special, specific. This is the meaning you can find nowadays in the words 'idiom' (ie a phrase that is specific to one language) and 'idiosyncrasy' (=peculiarity). That second meaning is no longer connected to the word idiot in English (and very very rarely in French)
To conclude with, when you fall in love with a person, you could say you are stupid (as a state of being), meaning you are stunned, speechless. But be careful, for people could not understand you