ON JUNE 5th voters in 12 Mexican states unexpectedly gave the Institutional Revolutionary Party (PRI) of President Enrique Peña Nieto a good kicking. In elections for governors, by a preliminary count, the PRI lost seven states to the conservative National Action Party (PAN). In four of those states, the PRI had never before lost power. “After 86 years in which they governed Veracruz, we beat the PRI,” exclaimed Miguel Ángel Yunes, the PAN candidate in that state. This is how democracy is supposed to work: angry voters get to kick the bums out.

For Mexico, this is still a novelty. It was only in 2000 that seven decades of one-party rule by the PRI finally ended when Vicente Fox of the PAN won the presidency. Yet hopes of a deep and lasting transformation that Mr Fox’s victory raised have given way to disillusion. In striking unison, several of the country’s leading thinkers published jeremiads on the state of Mexican democracy last month.

“The goddess who was going to cure all evils gave birth to an unrecognisable creature which today prompts rejection and mistrust among the majority of Mexicans,” wrote Héctor Aguilar Camín, a historian and novelist, in an essay in Nexos, a monthly journal. In Letras Libres, Enrique Krauze, another historian, declared in a similar vein: “Many of us thought that democracy…would bring an era of peace, prosperity and justice. That was naive.”

This intellectual gloom contains a recognition that many things in Mexico are not going so badly. The economy is solid, if not stellar. A dozen of Mexico’s 32 states, mainly in the north, are growing at Asian rates. Consumption has expanded steadily, as has home-ownership, and an open economy has brought Mexicans cheaper, better goods, as Luis Rubio, a political scientist, points out. These improvements are being boosted by the structural reforms—of energy, the labour market, education, banking and telecommunications—launched by Mr Peña.

Such achievements are more than cancelled out in the public mind by two, linked, failings: crime and corruption. Mr Peña at first played down the battle against organised crime, but the murder rate is rising again and extortion is an everyday misery. According to Latinobarómetro, a regionwide poll, in 2015 57% of Mexican respondents said they or a relative had been a victim of crime in the past year, compared with 44% in the region as a whole. Crime routinely goes unpunished: only a quarter of murders are solved.

Corruption is equally ubiquitous. It costs Mexico as much as 10% of GDP, according to a study by IMCO, a think-tank. From 2000 to 2013 41 state governors were implicated in corruption scandals; only two have been jailed. In a horror that still shocks Mexico, crime and corruption came together in the murder in 2014 of 43 student teachers in the state of Guerrero at the hands of local police, politicians and drug traffickers.

It has become commonplace to say that in Mexico democracy did not bring the rule of law. But why did it not? The answer lies in a largely unreformed political system. Under one-party rule, it was a top-down affair based on an imperial presidency. Instead of a systematic redesign, Mr Fox’s victory brought fragmentation and institutional decay. Since 2000 no president has had a majority in Congress. Mr Aguilar notes that power and much federal money have passed to state governors, with no oversight. The cost of politics has rocketed, he adds: office is auctioned to the highest bidder, repaid by siphoning public money and bribes from contractors, developers and organised crime. Freed from the tutelage of the presidency, many local governments fail to fight crime, writes Mr Krauze.

Mexicans are fed up with crime and corruption; fairly or not, they blame the unpopular Mr Peña. He acknowledged recently that society is “ill-humoured”. But Mexico’s constitution does not provide for a presidential run-off; PRI strategists have calculated that they can keep power in 2018 with just 30% or so of the vote.

The gubernatorial elections should shake them out of their complacency. Some Mexicans believe that political alternation at the state level is the key to progress. Others argue that the country needs deeper political reform. At a minimum, this should include some recentralisation, with a stronger federal police force and more control over public funds; genuine autonomy and accountability of prosecutors and the courts; and steps to cut the cost of politics. A fragmented political system needs a mechanism to produce a majority, such as a run-off. The problem is that in democracies it is easier to kick the bums out than to devise ways to stop them getting in in the first place.