Preheat your oven to 375°F (190°C). Lightly grease your baking dish to prevent sticking.
In a large skillet, heat the olive oil over medium heat and add the minced garlic. Cook until fragrant, about 30 seconds, filling your kitchen with that inviting aroma.
Add the fresh spinach to the skillet and cook until wilted, about 2-3 minutes. Stir occasionally, and then remove from heat to let it cool slightly.
Drain and chop the artichoke hearts into bite-sized pieces, then set aside.
In a mixing bowl, combine the softened cream cheese, shredded mozzarella, and grated Parmesan. Mix until smooth and creamy.
Add the cooked spinach and chopped artichokes to the cheese mixture. Season with salt, pepper, and red pepper flakes if using. Stir until evenly combined.
Transfer the mixture into your prepared baking dish, spreading it out evenly with a spatula.
Sprinkle extra shredded mozzarella and optional cheddar cheese on top for a cheesy crust.
Bake in the preheated oven for 20-25 minutes, until the mixture is bubbling around the edges and the top is golden brown.
If you like a crispy top, broil the bake on high for 1-2 minutes, watching carefully to prevent burning.
Remove from the oven and let it rest for about 5 minutes. This helps the cheese set, making it easier to serve neat slices.
Serve warm, scooping out portions with a spoon or serving slices with crusty bread. Enjoy the melty, cheesy comfort in every bite!