No — the Prophet ﷺ said that Allah has pardoned this ummah for what their souls whisper to them, so long as they do not act on it or speak it (Sahih al-Bukhari 5269). In fact, in the hadith of Ibn 'Abbas about how Allah records deeds, whoever intends an evil deed and then does not do it has a full good deed written for him (Sahih al-Bukhari 6491). What is blameworthy is not the passing thought but settling into it — nurturing the desire, seeking out what feeds it, or carrying it out with the limbs. "Allah does not place on any soul a burden greater than it can bear" (Quran 2:286), so meet such whispers with istighfar and by turning your attention away, not with anxiety that you have already sinned.
Q&A · Repentance & Sin
Am I sinful for sinful thoughts and desires that I never act on?
Evidence — the daleel
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.