You need to drop the headliner and take a look at the drain tubes for the sunroof. i'll bet they came detached. Use a cheap gear clamp to clamp the hoses back onto the sunroof drain fittings. The water is coming in through the sunroof channels and draining into your headliner, then running down the pillars onto your floor. Front and back, by the sounds of things.
If you want to test it out, retract the sunroof and dump a cup of water in the channels and see if the water comes out by the front and rear fenders. Park the car on a slope to guide the water to the each end of the sunroof drains (2 on the front, 2 on the rear). If the water doesn't drain, it'* the drain tubes.
Once you re-connect them, do the water test again and bask in the glory of watching the water draining to the outside of the car, not the inside.
Tear the whole interior out and let the carpet dry out in the sun. I grabbed new underpadding from a carpet store (it was cheap!) when I had trouble, and put that down before installing the dried carpet. I have been rewarded with a dry, scent free car, and my passengers really dig how cushy the carpet feels
It seems like a pain in the butt, but you'll feel a lot better when it'* all said and done.