If you look at the English translation it says:
She pet the dog in a way that seemed affectionate.
Meaning 優しそう is describing the act of petting rather than the dog. Thus its 優しそうに…撫でた.
優しそうな犬 would mean She petted the seemingly gentle dog.
This sentence is a bit ambiguous if you don’t see the English. I think the hint should be changed to include “in a way that seemed” so that you can see it’s modifying the verb, NOT the noun. It’s a tricky sentence but I think it’s a good one, it breaks you out of thinking that it’s always what comes directly after that matters.
(Also I think it should be petted not pet but I keep saying both sentences over and over and for some reason pet sounds okay? Why? )