I'm trying to design a Soft Latch Circuit, but the problem is that when a voltage source is connected to one of the analog inputs, the Arduino is always powered on. This problem could be solved with a transistor before each analog input, but in my case this method "costs" a lot of IO pins. Does somebody know how to solve this with less IO pins?
Yeah, the input protection clamp diodes will "phantom power" the device if VCC is low and power is applied to the pins.
You need to keep power off the IO pins somehow.
You can try an analog switch such as this before the analog inputs https://datasheets.maximintegrated.com/en/ds/MAX395.pdf
Perhaps contact Maxim tech support to see what happens if analog signals are applied to it when it's power is off.