Preheat oven to 375°F (190°C).
Slice zucchinis lengthwise into thin strips. Lay them on paper towels, sprinkle lightly with salt, and rest for 15 minutes to remove excess moisture.
Heat olive oil in a skillet over medium heat. Sauté onion until translucent, then add garlic.
Add bell pepper and mushrooms; cook until tender. Stir in spinach until wilted. Season well.
In a bowl, mix ricotta, 1 cup mozzarella, Parmesan, and egg (if using). For vegan, use plant-based alternatives and omit egg.
Spread marinara sauce in a baking dish. Layer zucchini, cheese mixture, and vegetables. Repeat layers.
Finish with sauce and remaining cheese. Cover with foil and bake 30 minutes.
Uncover and bake another 20–25 minutes until bubbly and golden. Let rest 10 minutes before slicing.