THE gloom in Spain is almost palpable. Yet two years on from the protests begun in Madrid by young Spaniards known as los indignados, most accept their lot with resignation. The government of Mariano Rajoy is unpopular, but so is the opposition. And whereas many other stricken euro-zone countries blame the Germans for their woes, Spaniards recognise that they are paying for their own excesses, especially the burst property bubble.

The numbers are grim. The economy is in deep recession. In the first three months of the year GDP shrank for a seventh quarter in a row. The public finances remain stretched, with the budget deficit at 7% of GDP. Bond yields have fallen, but the credit crunch for small firms is worsening. Corporate bankruptcies are running at ten times pre-crisis levels. And unemployment is at a record 27%.

Spain could be the biggest test for the euro. Four countriesGreece, Ireland, Portugal and most recently Cyprus—have been bailed out and are in programmes agreed on with the “troika” of the IMF, the European Union and the European Central Bank. But Spain is the only big euro member that has come close to a bail-out. Instead, it last year took a halfway offer of €100 billion ($129 billion) support from the European bail-out fund for its banks (it drew €41 billion). Unlike France, it has made big structural reforms. Unlike Italy, it has a strong government that expects to last until the next election in late 2015.

Moreover, a few glimmers of hope can be discerned amid the gloom. Thanks to the ECB, long-term bond yields have fallen back to pre-crisis levels. Sharp fiscal consolidation has trimmed the budget deficit from 11% of GDP in 2009 to 7% this year. Overspending by fractious regions has been painfully brought under control. And Spain has been given an extra two years to hack its deficit below 3%.

The government’s programme of restructuring and reform has also started to produce results. As many as 38 financial institutions have been merged, mainly local cajas brought down by property lending. The remaining banks have been recapitalised and some €50 billion of their worst assets transferred to a bad bank, Sareb.

Provisioning against bad debts has risen sharply. Unlike many other euro-crisis countries, the public sector is shrinking: 375,000 civil-service jobs have gone.
.


The real economy is also showing signs of improvement. Measured by unit labour costs, Spain has done more than most to regain competitiveness (see chart). The external current account has switched from a deficit of almost 10% of GDP in 2008 to a surplus, and not only because of import compression. In 2012 exports rose faster than in any other EU country. Reforms last year made it easier to fire workers, so industry is readier to hire again. This new labour-market flexibility is one reason why many car makers are moving production from other EU countries to Spain.

Even so, three big problems could undo this limited progress. One is the credit crunch. Despite lower bond yields, credit for small and medium-sized enterprises remains scarce and expensive compared with northern Europe. And although both capital and provisioning have increased, the banks are still rolling over dodgy debts from many construction firms. Property prices are down by over a third from their peak, and ministers insist the system could absorb a drop of 50%—but if the recession continues, the fall could be larger still.

The second problem is reform fatigue. Spaniards have accepted changes, including wage cuts, to restore lost competitiveness. But more is needed: welfare reforms, a lower minimum wage in some regions, encouraging mini-jobs and part-time work and reducing the burden of pensions. It is not clear that Mr Rajoy’s government has the guts to push such reforms through. Yet without them Spain’s scary level of unemployment is likely to persist. Ministers say the jobs market is more flexible than it looks because in the boom years 5m immigrants came in, and the bust is seeing large net emigration: the population is shrinking. But long-term high unemployment will reduce the quality of the workforce.

Above all is the third problem, insufficient demand and a lack of sources of growth. With public spending, consumption and investment constrained, the government is relying on rising exports. Yet total exports are less than a third of GDP and almost two-thirds go to the recession-hit euro zone. It is hard to see how even strong exports can make up for weak domestic demand. And if GDP growth does not revive, the problems of Spanish banks and the credit crunch will quickly return.

Luis de Guindos, Spain’s finance minister, said last year that Spain was the place where the battle for the euro would be fought. It is also crucial for the future of the EU: the recent Pew report on public opinion found that the favourability rating for the EU had fallen in Spain by fully 34 points, from 80% in 2007 to only 46% now. If this most Europhile, reform-minded country cannot make it, can anybody?