Following its heyday as a global maritime power during the 15th and 16th centuries , Portugal lost much of its wealth and status with the destruction of Lisbon in a 1755 earthquake , occupation during the Napoleonic Wars , and the independence of its wealthiest colony of Brazil in 1822 .