Analytical gradients and derivative couplings for dynamically weighted complete active space self-consistent field