Liberal lawyer Zuzana Caputova has won Slovakia's presidential election, making her the country's first female head of state.