OP without knowing your history I recommend doing a couple checks first before you go all drastic. If you have a bad gasket that's another story, but if it's from a poor seal between roof panel and car, do this..
Take your sunroof off. There are 3 torx screws on either side. It comes off very easily. Sit it safely out of the way.
If the pin on either slide is out, push it back in. With a loose pin, the sunroof can open and close but it won't be as tight as it should be. Pins must be pushed in. Do this with the roof panel OFF. The pin slides back and forth, line it all up. Also, Don't lose or forget your little round pin holder than slides back and forth in the inner slide. You can see it in my third pic below. It is there to keep things solid or the slide can make noises over bumps. To sum it up, The pin makes contact and sits within with three separate parts of the slide. FYI the middle piece that flips up and pops the roof open is kinda tight around the pin deliberately to hold the pin in place, that is until the next time it backs itself out haha
Reinstalling the roof panel is surprisingly easy, also easy to do wrong. This is where the issue happens, you can cause your own own leak. You need to tighten down the panel, NOT simply reinstall the torx screws and call it a day.
First, line up the sunroof panel on the slide rails. Reinstall all 6 screws but don't tighten them down yet, just enough so you can close the roof under power. Close it. Next loosen all six screws a bit. The next part only takes a minute but it's the key to a tight seal.
Second, have a friend stand on the outside of the car and press down, firmly but not like a hulk, on the front and rear corners of one panel side. From inside the car, you can now tighten the screws in this order: front and rear corners, and last the middle screw. You and your friend Move to the other side and repeat.
Now check it under power, open and close again. It should seat like mine is below. The front of the panel is pretty flush with the roofline..My pic is jacked, it's actually more flush than it looks. The rear of the panel sits below the roofline. That's how mine came new in 2005 so it's right.
Now if you press down on the roof panel it's a little spongy but not a lot of slop. If you do a search you will find other sunroof threads where the owner complained their panel was sitting up high and they didn't know why. Water will find its way in.
Note: if your pins were not loose or out you can just follow the steps to redo your screws without removing the sunroof. Hope this helped.
Front
Rear
Sent from my Corded phone