How regret moves individual and collective choices towards rationality