If you plan to keep your foreign salary and live in Spain, you will apply for the Digital Nomad Visa.
Cost of Living $2,200 USD / mo
Est. Remote Salary $7,300 USD / mo
Remote Income Tax 15% flat rate under Beckham Law
Visa Option Digital Nomad Visa