Love
Question

If a girl loves a boy from afar, has she committed a sin?.
Praise be to Allah.Islam came to close the doors that lead to evil and sin, and is keen to block all the means that may lead to corruption of hearts and minds. Love and infatuation between the sexes are among the worst of problems. 
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said in Majmoo’ al-Fatawa (10/129): 
Love is a psychological sickness, and if it grows strong it affects the body, and becomes a physical sickness, either as diseases of the brain, which are said to be diseases caused by waswaas, or diseases of the body such as weakness, emaciation and so on. End quote. 
And he (may Allah have mercy on him) said in Majmoo’ al-Fatawa (10/132): 
Loving a non-mahram woman leads to many negative consequences, the full extent of which is known only to the Lord of people. It is a sickness that affects the religious commitment of the sufferer, then it may also affect his mind and body. End quote. 
It is sufficient to note that one of the effects of love of a member of the opposite sex is enslavement of the heart which is held captive to the loved one. So love is a door that leads to humiliation and servility. That is sufficient to put one off this sickness. 
Ibn Taymiyah (may Allah have mercy on him) said in Majmoo’ al-Fatawa (10/185): 
If a man is in love with a woman, even if she is permissible for him, his heart remains enslaved to her, and she can control him as she wishes, even though outwardly he appears to be her master, because he is her husband; but in fact he is her prisoner and slave, especially if she is aware of his need and love for her. In that case, she will control him like a harsh and oppressive master controls his abject slave who cannot free himself from him. Rather he is worse off than that, because enslavement of the heart is worse than enslavement of the body. End quote. 
Attachment to the opposite sex will not happen to a heart that is filled with love of Allah; it only affects a heart that is empty and weak, so it is able to gain control of it, then when it becomes strong and powerful it is able to defeat the love of Allah and lead the person into shirk. Hence it is said: Love is the action of an empty heart. 
If the heart is devoid of the love and remembrance of the Most Merciful, and is a stranger to speaking to Him, it will be filled with love of women, images and listening to music. 
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said in Majmoo’ al-Fatawa (10/135): 
If the heart loves Allah alone and is sincerely devoted to Him, it will not even think of loving anyone else in the first place, let alone falling in love. When a heart falls in love, that is due to the lack of love for Allah alone. Hence because Yoosuf loved Allah and was sincerely devoted to Him, he did not fall into the trap of love, rather Allah says (interpretation of the meaning): 
“Thus it was, that We might turn away from him evil and illegal sexual intercourse. Surely, he was one of Our chosen, (guided) slaves” [Yoosuf 12:24]
As for the wife of al-‘Azeez, she was a mushrik as were her people, hence she fell into this trap. End quote. 
The Muslim must save himself from this fate and not fall short in guarding against it and ridding himself of it. If he falls short in that regard and follows the path of love, by continuing to steal haraam glances or listening to haraam things, and being careless in the way he speaks to the opposite sex, etc, then he is affected by love as a result, then he is sinning and will be subject to punishment for his actions.                                                                                                 
How many people have been careless at the beginning of this problem, and thought that they were able to rid themselves of it whenever they wanted, or that they could stop at a certain limit and not go any further, until the sickness took a strong hold and no doctor or remedy could help? 
Ibn al-Qayyim (may Allah have mercy on him) said in Rawdat al-Muhibbeen (147): 
If the cause happens by his choice, he has no excuse for the consequences that are beyond his control, but if the reason is haraam, the drunkard had no excuse. Undoubtedly following one glance with another and allowing oneself to keep thinking about the person is like drinking intoxicants: he is to be blamed for the cause. End quote.  
If a person strives to keep away from the things that lead to this serious sickness, by lowering his gaze and not looking at haraam things, not listening to haraam things, and averting the passing thoughts that the shaytaan casts into his mind, then after that something of the evils of this sickness befalls him because of a passing glance or a transaction that is basically permissible, and his heart becomes attached to a woman, there is no sin on him for that in sha Allah, because Allah says (interpretation of the meaning): 
“Allah burdens not a person beyond his scope” [Al-Baqarah 2:286]
Ibn Taymiyah (may Allah have mercy on him) said in Majmoo’ al-Fatawa (11/10): 
If that does not result from carelessness or transgression on his part, then there is no sin on him for what befalls him. End quote. 
Ibn al-Qayyim (may Allah have mercy on him) said in Rawdat al-Muhibbeen (147): 
If love occurs for a reason that is not haraam, the person is not to be blamed, such as one who loved his wife or slave woman, then he separated from her but the love remained and did not leave him. He is not to be blamed for that. Similarly if there was a sudden glance then he averted his gaze, but love took hold of his heart without him meaning it to, he must, however, ward it off and resist it. End quote. 
But he must treat his heart by putting a stop to the effects of this love, and by filling his heart with love of Allah and seeking His help in that. He should not feel too shy to consult intelligent and trustworthy people for advice or consult some doctors and psychologists, because he may find some remedy with them. In doing that he must be patient, seek reward, remain chaste and  keep quiet, and Allah will decree reward for him in sha Allah. 
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said in Majmoo’ al-Fatawa (10/133): 
If he is tested with love but he remains chaste and is patient, then he will be rewarded for fearing Allah. It is known from shar’i evidence that if a person remains chaste and avoids haraam things in looking, word and deeds, and he keeps quiet about it and does not speak of it, so that there will be haraam talk about that, whether by complaining to another person or committing evil openly, or pursuing the beloved one in any way, and he is patient in obeying Allah and avoiding sin, despite the pain of love that he feels in his heart, just as one who is afflicted with a calamity bears the pain of it with patience, then he will be one of those who fear Allah and are patient, “Verily, he who fears Allah with obedience to Him (by abstaining from sins and evil deeds, and by performing righteous good deeds), and is patient, then surely, Allah makes not the reward of the Muhsinoon (good‑doers) to be lost” [Yoosuf 12:90]. End quote. 
See also questions no.  20949 and 33702. 
And Allah knows best.