You do not have to hold a valid class 1 medical until you apply for the CPL - all of your flying/flight training up to that point can be completed with a class 2. If you are not flying, you do not need to hold a valid medical at all, the only pre-requisite for ATPL theoretical knowledge training is to hold a valid ICAO PPL.