You have alot of things going on here. Your daughter really isn't so rebellious as just being a fairly normal, more introverted teenager. I have 14 and 16 year old sons and some of this just has to be endured. It is unfortunate, but it is your job to be in the middle and not your husbands, which is maybe one reason things got so bad. It seems your husband is doing his best, so don't worry about him so much.
IMHO, you should let her go stay with her bio father. At this age, the grade thing is not going to impact her nearly as much as it would later and given this seems to be the first time she has started asserting her will, this seems to be something that's EXTREMELY important to her. Given she would also be with her grandmother, unless grandma is unfit (one can debate how well she mothered her son given his current situation, but this is different), then this would likely be a really important life lesson experience for your daughter in a fairly safe environment.
You really have to remind yourself that your daughter is half her father so it really is important that she have as good of a relationship as possible with him. This is the age where kids are exploring their own identity - that's healthy and necessary at this age, so that at 17-18 they become their own person and are ready to start dealing with the world as an adult.
I am divorced from my sons' father and while he is not a great dad, they do spend some time with him. At this age, they can see the faults in him and it's not up to me to point those out or comment on them. If you view your daughter's father so negatively, it is only natural that your daughter will absorb some of that as a reflection of who she is. So, please try to accept that your daughter's father as is - it's up to your daughter to form her own opinions.
Also, please keep in mind that fathers are in the end the most important parent in terms of how a daughter later relates to men in general. So, you need to do everything possible to make this a positive experience. Again, it sounds like your husband is a truly great guy, so that has likely very positively impacted your daughter.
Sorry so long, but in short your daughter's behavior is normal and the teen years are very, very like the 2-7 years where the child is learning to become a separate person, detaching from the mother and developing their own identity.