Bernardo Silva and Bruno Fernandes were on target as Portugal sealed their place in the UEFA EURO 2024 knockout stages with a match to spare.