Is the teacher and the vice principal right and allowed /is it legal for them to do this?

Okay so I'm a 8th grade student and my phone was in my pocket its a iPhone 5s it was on airplane mode and complete silent and i guess the home button got mashed in - in my pocket and siri started talking i didn't know that if the phone was silenced and on airplane mode that siri would still talk and i was trying to focus on my school work but the teacher still took up my phone when its not like i was playing on it or anything and they know that. They said i can't get it back till 10 days my mom even went in the school and talked/argued with the vice principle since she pays the phone bill she's pretty pissed off at the school and I'm a lot more pissed than she is. Is this legal? And its my property its like theft… Other kids do the same as me and they just warn them but no my phone gets taken up i feel this was uncalled for it was my first time too why couldn't i just get a warning? I mean come on. Is this legal and what happens if they loose my phone or go through my information and stuff and what would you do if this was you? Please help me and ill answer your question. I'm very upset.

Yes. Next question please.

The vice principal also told me that the 4th time it gets taken up she gets to keep it forever which i don't think that is legal either?

No it't not legal… Ask someone for the school Policy… Usually in your Agenda.
If it says anything about a teacher can take away your phone if used in class then its legal. But if nothing like that is in there then tell your mom to go back to school and argue that there's no such rule stating that a teacher can do what they did to you. Then the principle will return it… If they don't then Youre Out of Luck because there's no need to file a lawsuit for $500 phone… You will spend more money behind lawyer, then what your phone+monthly service fee costs…
SO just wait 10 days… And get your phone back.
Remember, Don't make the same mistake again…

No, it's not legal. And if the school says that they have such a policy that policy is illegal. They could legally confiscate your property until the end of the day, for example, or they could suspend you for bringing the phone to school but they can't keep your phone for ten days.

However, unless you are prepared to sue over it, you are going to have to put up with it.