In a smart Barcelona office block this week I came across a map of a state that doesn't exist. This imaginary country has long borders and many provinces. It has history and an ancient language; a famous capital city and some of the world's best chefs. There is a sunny coast, snowy mountains and attractive islands. People come from around the world to visit. All this splendid country lacks is reality.

The Països Catalans – the Catalan lands – stretch out like a ballerina's extended leg down the Mediterranean coast from France to a toe far to the south of Spain. In an alternative history of Europe – one in which different local medieval monarchies had conquered their neighbours – Catalonia, larger than Denmark, could have become a successful member of the European Union.

The Catalans have at different times acquired the trappings of independence: a constitution in the 15th century, and a parliament, twice, in the 20th. But for the most part they have thrived or struggled in Spain. Prosperity has been some compensation for a sense of cultural injustice that like all nationalism draws its power from emotion as much as hard fact.

Franco's repression – most but not all Catalans backed the defeated republicans in the civil war – fuelled Catalan distrust of Madrid. Lluís Companys, the Catalan president during the civil war, was returned from exile in France in 1940 and shot by the fascists: the only elected head of a European government to have been executed in office.

That dark time for Spain is over. Catalans regained their autonomy in 1980. Their language – banned in public under Franco – is flourishing, its sharp tones a curious staccato descendent of Latin. Varied flavours of nationalist parties dominate the Catalan parliament in Barcelona and use their role as powerbrokers in Madrid to demand favours. Devolution is not total – most controversially it does not allow Catalans to keep their tax revenues as the devolved Basque country does – but nor is it fictitious. Spain, like Britain, is an unstable and imbalanced amalgam, devolved in parts but in theory still loyal to its king.

Why, I asked Catalan politicians, did the politics of national identity trouble them so much? The answer lies partly in the events of last summer when a vast crowd in Barcelona protested at the Madrid constitutional court's rejection of a new Catalan statute of autonomy.

Outrage at this ruling – after the statute had been approved by the Catalan and Spanish parliaments and a referendum – has led mainstream Catalan politicians, once largely opposed to independence, to change their thinking. More than a million Catalans – one in seven – marched under the banner "Som una nació. Nosaltres decidim" – "we are a nation, we decide".

I began my journey last Sunday in Figueres, as joggers on a fun run passed fresh graffiti calling for "independencia". This is the town where the republican parliament sat for one last desperate session in early 1939 as a million civil war refugees fled north from the town on the French border. Now Figueres has acquired a symbol of what should be the collaborative new Spain: a station on the first section of a high-speed rail line that will soon link Paris, Barcelona and Madrid. The sleek trains cutting through the Catalan countryside suggest Europe really could be a continent without borders or political differences.

The reality is different. To find out why I went to the Barcelona offices of Esquerra Republicana de Catalunya – a leftist party which wants Catalan independence and until elections last year was part of the Catalan government. This is where I came across that map of the Països Catalans – those old linguistic territories which now run deep into other provinces of Spain and France.

The ERC is anxious to present itself as the pragmatic face of nationalism. Members disassociate themselves from that other, violent, nationalist force inside Spain, in the Basque country. "Here there is no armed movement. Discussion has not been contaminated by the personal experience of people who have been injured," I was told by Pere Aragonès, a young ERC MP.

He was keen to convince me of Catalan moderation. Blame for the independence movement lies in Madrid, he said. "Spain fails to recognise Catalan identity as a part of itself". And growing economic pressures – Catalan resentment of taxes subsidising poorer parts of Spain – mean that "independence is now a rational question, not just one of identity".

But while Aragonès was likeable, his older ERC colleague Josep Huget was more disturbing. His nationalism seemed based on hostility to others. "There is a Spanish tsunami in Catalonia," he claimed – the impact of Madrid's taxes on Catalans in his opinion three times greater each year than the consequences of the disaster in Japan. Huget encapsulated the worst of parochial nationalisms. "I expect people to speak Catalan," he said – absurd in Barcelona, a city of migrants where most citizens do not.

The ERC has overreached itself. Its vote plunged at the last elections. But although polls suggest two-thirds of Catalans do not want independence now, while only a quarter support it, the tide is running against Spain. The ruling centre-right CiU party, long a bastion of Catalonia's post-Franco devolved settlement, is now increasingly sympathetic to a full breakaway. So are some Catalan socialists. Only the rightwing People's party is firmly against.

This is crucial. In the Basque country two centrist parties, the PP and the Spanish socialists, run the devolved government together against a nationalist opposition. But in Catalonia, the major parties are nationalist. No one has an interest in fighting the drift away from Madrid.

How do Catalans feel about this? I phoned Pilar Rahola, a well-known Catalan commentator who once sat in parliament for the ERC but left to write a biography of the current Catalan president, Artur Mas, leader of the CiU. "Catalans are in a phase of perplexity and disenchantment," she told me. "One part of the population are totally pro-independence and the majority, although unhappy with Spain, are slowly evolving towards pro-independence ideas."

The pressure, she said, was growing "because Catalans feel they suffer what is basically burglary, the theft of their economic resources. Spain is taking more than the Catalans are able to give."

On top of that comes a feeling that parties in Madrid are no longer interested in assisting Catalan autonomy. "Spanish parties are the best promoters of Catalan independence," she said. Rahola cites the current Catalan president's stark remark as a sign of what is to come: "Spain is a closed road now."

Certainly there is a casual contempt for Catalans among many Spaniards. Catalans find their accent and their culture mocked. The heir to the Spanish throne is never seen trying to speak Catalan, Basque or Galician. TV3, a Catalan channel, has been blocked from broadcasting in neighbouring Valencia.

But I wonder if the Catalan sense of injustice is not overdone. Catalonia is awash with fast roads, new railways and oversized airports: not a sign Madrid has spent all its money elsewhere. Huget, from the ERC, boasted that without Spain, Catalonia could repay its debts in two years, but there seems be economic ignorance about the consequences of a Catalan walkout from Spain. It is simple for politicians to pretend to voters that all their woes can be blamed on Madrid.

In search of politicians who share my fears I walked though Barcelona's Parc de la Ciutadella, amid palm trees and spring sunshine, to the Catalan parliament, which – tellingly – faces the city zoo. It is a grandiose stone building whose red velvet carpets and uniformed retainers give it the air of a London gentleman's club. It feels no place for a revolution.

In a remote basement office I found Albert Rivera, the young leader of the small Citizens party which has set itself against the nationalist tide. One Catalan dismissed him as "a snake charmer" – a plausible front for the rightwing PP. I found him intelligent and impressive and about the only person I met who admitted to being proud of being both Catalan and Spanish.

Rivera agreed Spain had alienated Catalans but added that nationalist parties were cooking up rows with Madrid to engineer greater resentment. "We are trying to build a border with Spain, not just physical but cultural," he said. "Catalonia is more closed than it was. I don't want to live in Kosovo. I want to be in a powerful region of Spain in a large country in the heart of Europe."

This drift dismays others for whom self-determination is not a priority, such as Dolors Camats of the Green party. "The big parties use the national debate as a curtain to hide other issues," she said. Last week, she tried to stage a debate in parliament on nuclear power after the Japanese disaster. No one was interested.

Across the hall from Rivera's office the clipped Oxford tones of an unusual nationalist are audible. Antoni Strubell is an MP for a small alliance of pro-independence parties. Born in England, his father was a republican exile. Strubell's argument is straightforward. "Catalonia is a nation. Madrid doesn't recognise us as such. No one in Madrid talks about federalism any more." Pressed on the benefits on independence, though, and like most Catalans he seemed vague. "There is a general change to independence worldwide" – Catalonia, like Flanders or Scotland, should break away."

This depressed me. The financial crisis has made Catalans understandably anxious. But there is naivety in wanting to leave Spain to become rich. Members of the public, for the most part, are little involved: turnout in Catalan elections is low. But their politicians are drifting towards a contrived showdown.

"I am disconcerted and pessimistic," said Pilar Rahola – even though she favours independence. After 500 years, it is possible to believe that Spain is on the brink of falling apart – with the pragmatic Catalans, not the rebellious Basques, leading the way to the exit.