Arizona agrees to pay for gender-affirming surgery for state