What time of year are you going? I see a few people in this thread confirming the long pants thing... We were in Rome, Florence, and Greater Tuscany in July 2018. I wore Bermuda length shorts the entire time with no issues whatsoever.
To my observation, the main things church employees cared about (and I would say this is true mostly of the larger famous churches, which have more staff) was that the shoulders were covered, especially if women were in spaghetti straps or midriff baring shirts or possibly if they were wearing super short shorts. I carried a little shawl to throw over my shoulders if I was in a tank top rather than a T-shirt but otherwise, I didn’t do anything special. So I’m disagreeing with Mira here.
If you’re going in summer, don’t torture yourself with sweat wearing pants to go into churches. It ain’t worth the dehydration. Not to say that you shouldn’t be respectful but this board has a tendency to give way over conservative dress advice. And you’re going to look like a tourist regardless.
As for dressing up for dinner... maybe we ate at too many “obviously casual” places but it didn’t seem much different from the states. Fancy restaurant, dress nice, otherwise casual wear is fine. As for the shoes... well, white tennis shoes are pretty out of style everywhere...