As your mother, it’s not illegal. But since she is a teacher, she does have to treat you like a student so yes. It’s illegal, and should not be allowed. You should go to the principal about this. Plus it’s not right whatsoever. I say, screw it and tell her you will be using the restrooms. And tell her you will be telling the principal about the situation if she tells you no again. !