Hungary's opposition has defeated the prime minister by a landslide.