Allow me to put your mind at ease, because I can sense how worried you must be right now. First of all, you cannot legally adopt a child when both biological parents are still in the picture. Adoption can only take place if one parent legally waives his or her rights and obligations to the child. You must be thinking that's it's unfair as you've given so much to your stepchild, but that's the way the way the legal cookie crumbles. The court will always protect the rights of the biological parents in an effort to protect the children. In your case, your husband re-married (you) and his daughter basically has come to have three parents, which is fantastic for the child but still leaves you on the outs. Despite the money you may have spent on her and the time you shared, you legally have no rights or obligations to her. However, this not to say you're going to be completely shut out.
Now, there is one other route, but it is far more complicated, and the expiration date has long passed in your case. In some cases, guardianship is sort of a loophole. A person has the ability to become a child's guardian but it must be done legally and come with justification. Guardianship just means that you take responsibility for the child, but do not take the place of another parent. Guardians co-exist with the biological parents and control the child's finances. The courts however do not grant guardianship easily, and if both parents make a decent living and share custody, the law will most likely not recognize a need for guardianship. And either way, it is not a permanent solution as it ends when the child turns 18. So as you can see, there wasn't much you could have done prior to your relationship going awry. In the eyes of the law, you are not the child's parent, but that doesn't mean she doesn't think of you as a mother.
Most parents don't want to deprive their child of love, so as messy as your divorce may be, you might be surprised to discover that your ex doesn't want to take his daughter away from you. Sure, your visits may be few and far between, but that should be expected in the beginning. People need time to regroup after a separation and even if he filed for divorce, it's still difficult for him to see you and have him in his life in any capacity. Having you in his life will be difficult, and knowing his daughter will continue to have a relationship with you is probably a hard pill for him to swallow. Treat this situation delicately. Do not demand you see his 13-year-old, but rather explain how much she has come to mean to you and that you would be devastated if she suddenly disappeared from your life. In due time, he will most likely accommodate your request to see her. If not, take solace in knowing that she is 13 and has a strong voice. If she wants to see you, she will demand it from her father. And he can't ignore her requests forever.
You need to acknowledge one thing, which may be painful. Your relationship with her will be forever changed. You won't be taking her to school anymore, or having girl talks before bed. When you see her, your visits will probably be limited to a couple of hours at a time. Once you get over what once was, you'll realize that any time spent with her is valuable. So give yourself time to cool down and allow your ex to sort out his feelings. Your stepdaughter also needs time to get over another divorce. Remember, divorce is often harder for children to deal with than for those directly involved. She may feel confused and not even want to see you at first. She may also feel a sense of abandonment, which is no one's fault – it's just a natural feeling for her at this point. But she should get past it, as long as everyone lets her know the divorce had nothing to do with her. Sending her letters to reinforce how much you love her right now would be great, and in time she will reach back. Slowly but surely you will see her again, just be prepared for it to happen under everyone else's terms.