MADRID (Reuters) - Spain is gearing up for one of its most tightly contested national elections in decades, with the result too close to call and at least five parties from across the political spectrum with a shot at being in government.

A worker moves ballot boxes as they are to be taken from a warehouse and sent to polling stations ahead of the April 28 Spanish general election, in Barcelona, Spain, April 10, 2019. REUTERS/Albert Gea

The April 28 ballot is set to mark a number of firsts: the first far-right lawmakers in nearly four decades, the first coalition government since Spain’s return to democracy and the first time since the financial crisis that the economy is not a top issue.

Lengthy coalition talks are expected to follow the vote, further fuelling the mood of political uncertainty gripping Europe.

Several leading candidates are holding rallies on Thursday evening before posters go up at midnight, when the campaign officially starts.

Here’s what’s at stake:

WHO WILL WIN?

No party will win enough votes to form a government on its own, and opinion polls point to a deeply fragmented parliament.

Prime Minister Pedro Sanchez’s Socialists are in the lead and on the rise, averaging around 29 percent of votes, according to a poll of polls by El Pais newspaper.

That would give them substantially more seats than the 84 they held in the previous legislature, but they would still need to find one or more allies and there is no guarantee they could form a coalition to stay in government.

Several other scenarios - including a right-wing coalition or a repeat election - are possible, and it will likely be weeks or even months before a new prime minister is chosen.

For now, a range of possible outcomes are all with opinion polls’ margin of error.

WHY IS THIS SO COMPLEX?

The proportion of undecided or wavering voters is as high as 42 percent, according to a CIS poll.

Pollsters have also been struggling to predict how well the new far-right party Vox will fare, though they all agree it will get lawmakers, the first of that political hue since 1982. [L8N21T1MH]

The 350 deputies in Spain’s lower house are elected in 52 constituencies, whose size varies widely. At a time when the number of contenders keeps increasing, forecasting the winners is tough, particular in small, rural areas.

Another factor is local and regional elections on May 26, with parties - especially in a country whose modern democratic history lacks of German-style tradition of coalition-building - unlikely to strike any deal in Madrid that could jeopardize their chances in those ballots.

Furthermore, most parties are either undergoing internal upheavals or have new leaders, meaning much could still change in terms of strategy and alliances.

Spaniards will also elect 208 representatives to the Senate, which has a low political profile and has been controlled by the conservative PP since 2011.

WHO WILL BE PRIME MINISTER?

Under the most optimistic scenario for the Socialists, Sanchez could stay on as prime minister with just one ally, the anti-austerity Podemos, despite the latter’s sharp drop in popularity, a poll showed on Tuesday.

But the same poll gave a wide range for its forecast and showed that the Socialists and Podemos could well need the backing of smaller, nationalist parties, including from Catalonia. Other surveys have shown the same.

Concessions the smaller parties would seek in return - and pressure from right-wing parties already accusing Sanchez of being a “traitor” for being open to dialogue with Catalan secessionists - make any such alliance a tough though not impossible ask.

According to latest polls, the three right-wing parties combined - the PP, Ciudadanos and Vox - would not have a parliamentary majority. But that is also a margin-of-error call.

One scenario of a likely majority would be between Ciudadanos and the Socialists. Ciudadanos chief Albert Rivera has ruled out a deal with Sanchez, but the party has changed its mind over alliances after past elections.

One outcome does seem certain, however: confirmation of the end of the two-party system that began with Spain’s return to democracy in the late 1970s and started unraveling in 2015.

WHAT ARE THE MAIN ISSUES FOR VOTERS?

Catalonia’s independence drive has irritated many and will be a high-profile factor, especially with 12 of its former leaders standing trial.

PP, Ciudadanos and Vox are competing for the anti-separatism vote but the Socialists, after refusing to give in to Catalan demands to secure their backing for the budget, will also aim to use the issue to their advantage.

With the rise of Vox and with PP veering to the right, the Socialist party will seek to attract voters with its progressive stance on issues ranging from women’s rights to the removal of former dictator Francisco Franco’s remains from a grand mausoleum.

The economy, forecast to grow a relatively robust 2.2 percent this year, has so far not been a major campaign theme, but subsidiary issues such as regulating the property rental market could play a role.

WHY SHOULD MARKETS AND THE EU CARE?

Spain has had a succession of minority or caretaker governments over the past three years, meaning structural reforms have been delayed.

And, while the Socialists have managed to adopt some economic measures including an increase in pensions and minimum wages, their rolling over of the 2018 budget means a number of tax hikes will not enter force, making it harder to cut the deficit from 2018’s 2.6 percent of GDP.