Signing my rights away from my daughter

My almost 4 year old is currently in CPS custody and the state keeps trying to push for me to sign my rights away and her foster family is fighting to adopt her. I've shown up to my parenting classes. I've paid the child support. I've done everything I was supposed to do. The only thing I haven't is put my husband out of the house. My husband is not my daughter's biological father. He's dead. But he's been there since she was a baby. The reason she was taken away is because of what he did. He went to prison. He served a year. He has been in therapy. He will never harm her again. He's even shown proof he's been to therapy but they are still refusing to put her back in my custody and said can't be around her anymore. My lawyer said they can take my case but don't think they will win if I won't leave my husband. If I don't sign my rights away they are going to push to involuntarily terminate them. My daughter is now calling her foster parents mama.... And they aren't correcting her. I want to fight for her. I'm her mother. She needs me. Nobody will love her more or take better care of her than me her mother. But I'm wondering if I should just give up at this point. It seems if I get her back the state is gonna stay trying to control my life and who I'm with. Theyre basically telling me to throw away my marriage if I want my daughter back even though my husband is apologetic for what he did. Went to jail. Goes to church and is in therapy. He will be punished by society forever so I'm not going to let him continue to be punished when he's apologetic. They dont care that hes in therapy and doing better. They don't care. They just want to give my daughter away.