Spanish lawmakers vote to legalize euthanasia