The surface impedance of type-II superconductors in the mixed state has been studied, taking into account the vortex elasticity and nonlocality (long-range interaction of vortices). An electromagnetic wave penetrates into a superconductor as a superposition of two exponentially decaying modes with different penetration lengths, in contrast with one mode in a normal conductor or in a superconductor in the Meissner state. The second mode is an elastic mode of the vortex array; it is crucial for incorporation of vortex elasticity and surface pinning into electrodynamics.