Arizona- question about the long term capital gains on form 140 and form 140 X

On AZ form 140, it asks for total net short term gain or loss on line 21, total net long term gain on line 22, and total net long term capital gains from assets acquired after December 31, 2011. Let us assume the following:

Line 21: -20,000

Line 22: +10, 000

Line 23: + 5,000

 

For federal tax purposes, one would owe no taxes and have a capital loss carry over of -20,000 + 10,000 = -10,000.

 

However, following the form instructions for form 140 or 140X, it lowers the tax owed by Line 23 * 25%  (on line 30)* tax rate even though the AGI shows no capital gains as row losses offset the gains. Is something wrong or is this the right way to file?