residence permitshall mean any authorisation issued by the authorities of a Member State allowing a third-country national to stay legally on its territory, with the exception of:
third-country nationalshall mean any person who is not a citizen of the Union within the meaning of Article 17(1) of the Treaty.