Last night the Italian centre-left lost power and the German centre-left decided to cling to power.

I’ve visited both countries in the past month, and discussed with people who will influence what happens next. The common theme is despair: an understanding that the old project of European social democracy is over, and that what comes next will have to be radically different.

Many ask what they can do to emulate Labour under Jeremy Corbyn, but for demographic, cultural and institutional reasons the answer is “not much” unless you fundamentally rethink the EU.

The German Social Democratic party (SPD) has slumped to 18% in the opinion polls, down from the 20% it scored in the election that led to stalemate last year. Meanwhile in one poll, the SPD is now neck and neck with the far-right Alternative für Deutschland (AfD). The fear of a new election in which the historic party of the German working class gets wiped out was enough to make two thirds of the membership opt for what most know will be long-term political suicide: a coalition with Angela Merkel in which their hands become mired once again in the failures of neoliberalism.

On the face of it, the Italian Democratic party (PD) scoring 19%, with a recent breakaway called Free and Equal getting 5% is not so bad – especially as they have just been in government. But some close to the leadership of the PD tell me privately that their entire project is “finished” – because what disappeared last night is the world in which ordinary coalitions of centrist parties can be formed.

The Five Star Movement – whose populism is a mixture of anti-immigrant, anti-Europe and anti-corruption rhetoric – is the biggest party; while within the centre-right coalition it was the eurosceptic and racist party, Lega Nord, which performed better, eclipsing Silvio Berlusconi’s Forza Italia. In fact, describing the Lega-FI alliance as centre-right already stretched the definition of that term.

Amazingly, given the total disaster that has befallen social democrats in coalition with conservatives, the only hope of the PD was for Berlusconi and themselves to score enough to form a centrist coalition, but that failed.

To understand what the left needs to do next, you have to understand how last night’s results change Europe. As the price of the coalition with Merkel, the SPD can and probably will demand enthusiastic German co-operation with Emmanuel Macron in the creation of a more socially progressive Europe which demands greater integration, faster moves towards banking union and looser fiscal rules, etc.

But any incoming Italian government will stand apart from the ‘faster Europe’ project, possibly siding with the neo-right coalition in Austria – and Poland and Hungary – to demand tougher migration controls and a more two-speed EU.

Difficult though it is for the left to face, we are losing the argument on migration all across Europe. The cosmopolitan, globalist, educated part of society is increasingly unable to convince the conservative, nationalist and xenophobic part that migration and multiculturalism are positive things.

So the call begins for the left to accommodate to the conservatism of some workers – just as the ‘Blue Labour’ faction argued in the UK.

And this, of course, is an issue that divides the hard left, not just the social democrats: in Germany there is an effective standoff inside Die Linke (The Left), with one group arguing for a kind of left nationalism in order not to ‘lose’ their working class base, and another, around its leader Katja Kipping, more oriented to the kind of politics we have in Momentum in the UK. In France, Jean-Luc Mélenchon’s party, La France Insoumise, projects a strong anti-EU line, again playing to the conservatism of some workers.

In the face of this, as I have argued many times, social democrats, the far left, and such green and left nationalist parties that exist should form a united front, wherever possible forming electoral alliances.

They need to rip up the copy of the Lisbon Treaty that exists inside their heads, permanently limiting their ability to promise what Corbyn/McDonnell promised – namely to tax, borrow and spend to revive the left-behind communities where xenophobia is replacing hope.

Imagining a new, post-Lisbon Europe is the first step: it allows you to put radical redistribution, state intervention and state aid on the agenda.

But the most difficult thing is to construct an offer on migration that quells people’s fears of it and turns their anger against the rich, the corrupt and the organised criminals (in Italy’s case) who oil the system’s wheels. In both Italy and Germany – unlike the UK – it’s been the refugee influx, and the economic migration that has taken place alongside it, that triggered the movement towards authoritarian populism.

The alt-right media is conducting an internationalised campaign to weaponise the refugee issue, against which the liberal media – and centrist politics full stop – has few answers.

We have to begin from the principle that refugees have rights and so do economic migrants, but they are not the same rights. One is unconditional, the other a matter of economic and social policy.

I don’t think any ‘alternative left migration policy’ stands a chance of convincing hardline racists; but combined with an alternative economic policy it would have the chance to change the conversation, to de-weaponise the migration issue. It should focus on providing routes to citizenship for people already here; routes to inward migration for people who want to come; and, yes, limits on those who don’t meet the criteria for coming. It should be combined with a massive fiscal stimulus to avoid inward migration placing a strain on services, and massive capacity building in countries where poverty and lawlessness are forcing people to migrate.

I opposed the GroKo (Grand Coalition) in Germany, and I would oppose any attempt by the PD to prop up a Berlusconi government in Italy. The left in these two countries needs now to rapidly remake itself around a radical social programme, fighting fascism, defending refugees and offering humane but limited routes to economic migration into Europe.

If the old, Third Way-era leaderships in Germany and Italy don’t get it, and go on clinging to the old strategy, it is time for new institutional forms.

Both in Italy and Germany there are enough radical social democrats and far leftists to form viable opposition parties. They will have to do what you do when you are not in power, but which they have forgotten how to do: fight.