Aren't HSA contributions pretax? Why does my refund drop by $1500 when I input $4000 on form W-2 box 12 code W "Employer contributions to Health Savings Account"?

This is my first year using an HSA. I contributed $3000 and my employer contributed $1000. How is it that my federal refund could be reduced in any way by using an HSA?