Contra Costa County Juvenile Hall locks youths with disabilities in solitary confinement for weeks or months at a time, depriving them of education and allowing them to "deteriorate mentally," according to a federal lawsuit filed Thursday.

The suit, filed in U.S. District Court in Oakland, accuses county officials of flouting state laws mandating that juvenile detention facilities be supportive environments designed for rehabilitation.

At the county's 290-bed Juvenile Hall in Martinez, the suit says, teens have been locked up for up to 23 hours a day in conditions similar to a maximum-security prison.

"The youth are punished for a variety of infractions and are locked away in solitary confinement where their conditions only deteriorate, and they fall further behind in their education because they are denied schooling, making it more likely that they will commit further infractions upon their release from solitary confinement," the complaint states.

The complaint seeks class-action status and "meaningful access to education" for all youths with disabilities in solitary confinement.

"Contra Costa County officials are abandoning education and the hope for change, the most powerful tools they have to reach young people in trouble," said Grace Carter, an attorney for three youths who sued.

A 14-year-old girl referred to as G.F., who was diagnosed with bipolar disorder and ADHD, entered Juvenile Hall at age 13, spent about 100 days in solitary confinement and "has received no education at all," the suit says.

W.B., a 17-year-old boy, began hearing voices and talking to himself in solitary confinement before he had a "complete psychotic break" and smeared feces on his cell wall, his attorneys say.