Hello and welcome to justanswer. My name is***** will be assisting you today. I am sorry to hear that you are having such trouble.
2 step verification is most likely on
You can turn it off
Hi i'm just following up if this worked for you?
Please check iCloud Two-Factor Authentication
Please delete your imap account and setup account again as you mentioned it's greyd out. It should work fine after that.