The preposition in is followed by either accusative (= direction, movement) or dative (= place, location). Here it is a place, hence one needs to use dative case, and the possessive pronoun needs to agree with that case.
How I say I am exactly in the bath (not bathroom) in german? And how germans understand the word "Bad"?
I hope a better German speaker can answer your question too, but if I remember right... Bad = Bathtub Badezimmer = Bathroom Toilette = The actually toilet (usually)
I remember a German telling me to ask for "die Toilette", not "das Badezimmer" if you are asking to use the restroom. He said that to him asking for the "Badezimmer" makes it seem like you might want to take a shower/bath.
the word "das Bad" can be both:
the abbreviation of "das Badezimmer"
and a bathtub already filled with water - ready to use.
"Ein Bad nehmen" (=to take a bath) refers to "Bad" in the second meaning. "Musst du noch ins Bad bevor ich mir die Zähne putze?" (=Do you have to go to the bathroom before I brush my teeth?) uses the first meaning as a bathroom.
The bathtub itself is "die Badewanne".
To say that you are currently taking a bath you may say "Ich nehme ein Bad.", "Ich bade." or "Ich bin in der Badewanne.".