  Elastic systems driven in a disordered medium exhibit a depinning transition
at zero temperature and a creep regime at finite temperature and slow drive
$f$. We derive functional renormalization group equations which allow to
describe in details the properties of the slowly moving states in both cases.
Since they hold at finite velocity $v$, they allow to remedy some shortcomings
of the previous approaches to zero temperature depinning. In particular, they
enable us to derive the depinning law directly from the equation of motion,
with no artificial prescription or additional physical assumptions. Our
approach provides a controlled framework to establish under which conditions
the depinning regime is universal. It explicitly demonstrates that the random
potential seen by a moving extended system evolves at large scale to a random
field and yields a self-contained picture for the size of the avalanches
associated with the deterministic motion. At $T>0$ we find that the effective
barriers grow with lenghtscale as the energy differences between neighboring
metastable states, and demonstrate the resulting activated creep law $v\sim
\exp (-C f^{-\mu}/T)$ where the exponent $\mu$ is obtained in a $\epsilon=4-D$
expansion ($D$ is the internal dimension of the interface). Our approach also
provides quantitatively a new scenario for creep motion as it allows to
identify several intermediate lengthscales. In particular, we unveil a novel
``depinning-like'' regime at scales larger than the activation scale, with
avalanches spreading from the thermal nucleus scale up to the much larger
correlation length $R_{V}$. We predict that $R_{V}\sim T^{-\sigma}f^{-\lambda
}$ diverges at small $f$ and $T$ with exponents $\sigma ,\lambda$ that we
determine.
