Physical meaning of Impedance So I have been thinking about the way impedance is defined for electrical systems, and the way it is derived. Even after looking through some websites, I cannot seem to grasp something, which every website I visited seemed to skip on.
In an ideal resistor, if we take the ratio of the voltage to the current at ANY time, the ratio is a constant. This ratio is then the resistance (also the impedance) of the resistor. I have been interpreting this as the opposition the resistor bears to the current flow through it  upon application of a voltage. I thought of it like a constant that relates the otherwise-would-be-infinite current to the applied voltage. 
Coming to a capacitor, there seems to be some sort of change in the definition of impedance. The impedance for a capacitor is no longer the ratio of voltage to the current, but the ratio of the complex voltage to the complex current. In other words, mathematically it is equivalent to $$\dfrac{1}{i\omega C},$$ and not
$$\dfrac{\tan(\omega t)}{\omega C},$$ for a capacitor with capacitance C at a frequency w. 
I am finding this difficult to interpret because the ratio of the voltage to current is definitely varying in time. How can the analogy of a resistor's impedance be applied to the impedance of a capacitor when the ratio of the voltage across it to the  current through it is changing (it's even 0 or undefined sometimes). Why is the magnitude of the quantity 
$$\dfrac{1}{i\omega C}$$ now the resistance of the capacitor circuit? What happened to the plain old voltage to current ratio? Have books been skipping this subtlety, or I am just not understanding something very simple?
Clarification:
$$
if \hspace{.5 pc} v(t) = V_m \sin (\omega t), \hspace{0.5 pc} then \dfrac{d V(t)}{dt} = \omega  V_m \cos (\omega t)
$$
$$
so \hspace{0.5 pc}the\hspace{0.5 pc}ratio\hspace{0.5 pc} \dfrac{v(t)}{i(t)} = \dfrac{V_m \sin (\omega t)}{C\omega  V_m \cos (\omega t)} = \dfrac{\tan (\omega t)}{C\omega}
$$
$$
In \hspace{0.5 pc}phasor \hspace{0.5 pc}notation, \hspace{0.5 pc}this \hspace{0.5 pc} ratio\hspace{0.5 pc}  seems\hspace{0.5 pc} to\hspace{0.5 pc} be\hspace{0.5 pc}different \hspace{0.5 pc}in \hspace{0.5 pc}that: \\
\dfrac{\mathbf{V_c}}{\mathbf{I_c}} = \dfrac{1}{Cj\omega} = -\dfrac{1}{C \omega  }j 
$$
$$ and \hspace{0.5 pc} \Re\{-\dfrac{1}{C \omega  }j \} = 0$$
$$but \\ |\dfrac{\mathbf{V_c}}{\mathbf{I_c}}| = \dfrac{1}{C \omega  } $$
Why does the magnitude of the ratio of the complex voltage to the complex current now suddenly carry a physical meaning (if my understanding is correct, it is the resistance which can be measured in ohms, just like in the resistor). Also, why is going from the complex domain to real domain not possible for this ratio, because clearly the real part of the complex impedance is 0 (@Alfred Centauri mentions that the impedance is not itself a phasor). I understand that the math works, but the thing that is not making sense to me is this ratio of two complex quantities and the apparent emergence in its physical meaning.
 A: In general, the voltage across and current through a capacitor or inductor do not have the same form:
$$i_C(t) = C \dfrac{dv_C}{dt} $$
$$v_L(t) = L \dfrac{di_L}{dt} $$
Thus, in general, the ratio of the voltage across to the current through is not a constant.
However, recalling that:
$$\dfrac{d e^{st}}{dt} = s e^{st} $$
where s is a complex constant $s = \sigma + j \omega$, we find that, for these excitations only:
$$i_C(t) = (sC) \cdot v_C(t)$$
$$v_L(t) = (sL) \cdot i_L(t)$$
In words, for complex exponential excitation, the voltage across and current through are proportional.
Now, there are no true complex exponential excitations but since:
$$e^{j \omega t} = \cos(\omega t) + j \sin(\omega t) $$
we can pretend that a circuit with sinusoidal excitation has complex exponential excitation, do the math, and take the real part of the solution at the end and it works.
This is called phasor analysis.  The relationship between a sinusoidal voltage its phasor representation is:
$$ v_A(t) = V_m \cos (\omega t + \phi) \rightarrow \mathbf{V_a} = V_m e^{j \phi}$$
This is because:
$$v_A(t) = \Re \{V_me^{j(\omega t + \phi)}\} = \Re\{V_m e^{j \phi}e^{j \omega t}\} = \Re\{\mathbf{V_a} e^{j \omega t}\} $$
Since all of the voltages and currents in a circuit will have the same time dependent part, in phasor analysis, we just "keep track" of the complex constant part which contains the amplitude and phase information.
Thus, the ratio of the phasor voltage and current, a complex constant, is called the impedance:
$$\dfrac{\mathbf{V_c}}{\mathbf{I_c}} = \dfrac{1}{j\omega C}  = Z_C$$
$$\dfrac{\mathbf{V_l}}{\mathbf{I_l}} = j \omega L = Z_L$$
$$\dfrac{\mathbf{V_r}}{\mathbf{I_r}} = R = Z_R$$
(Carefully note that though the impedance is the ratio of two phasors, the impedance is not itself a phasor, i.e., it is not associated with a time domain sinusoid).
Now, we can use the standard techniques to solve DC circuits for AC circuits where, by AC circuit, we mean:  linear circuits with sinusoidal excitation (all sources must have the same frequency!) and in AC steady state (the sinusoidal amplitudes are constant with time!).


So my question is why does the magnitude of the ratio of the complex
  voltage to the complex current now suddenly carries a physical meaning
  (if my understanding is correct, it is the resistance which can be
  measured in ohms, just like in the resistor).

Remember, the complex sources are a convenient fiction; if there were actually physical complex sources to excite the circuit, the phasor representation would by physical.
The physical sources are sinusoidal, not complex but, remarkably, we can mathematically replace the sinusoidal sources with complex sources, solve the circuit in the phasor domain using impedances, and then find the actual, physical sinusoidal solution as the real part of the complex time dependent solution.
Here's an example of the physical content of impedance:
Let the time domain inductor current be:
$i_L(t) = I_m \cos (\omega t + \phi)$
Find the time domain inductor voltage using phasors and impedance.  The phasor inductor current is:
$\mathbf{I_l} = I_m e^{j\phi}$
and the impedance of the inductor is:
$Z_L = j \omega L = e^{j\frac{\pi}{2}}\omega L$
Thus, the phasor inductor voltage is:
$\mathbf{V_l} = \mathbf{I_l} Z_L = I_m e^{j\phi}e^{j\frac{\pi}{2}}\omega L = \omega L I_m e^{j(\phi + \frac{\pi}{2})}$
Converting to the time domain:
$v_L(t) = \omega L I_m \cos (\omega t + \phi + \frac{\pi}{2})$
Note that the magnitude of the impedance shows up in the amplitude of the sinusoid and the phase angle of the impedance shows up in the phase of the sinusoid.
A: Keep in mind that the capacitor is made of 2 conductive plates that are separated by an insulator. When the two plates are at the same potential, the density of charges is the same on the two side, thus no charges want to move.
When there is a difference of potential between the two plates, charges are arriving on 1 side, or leaving the other. But no charges are moving through the insulator. It is like the charges on the highest plate are frightening the charges on the other one! But they never cross the insulator. And the thinner the insulator, the higher the capacitor effect.
Now, what about the opposition current is facing in a capacitor. It´s quite simple. Imagine for a given voltage, there would be a given number of seats for charges for each plates (addition or suppression). As soon as the doors open, charges are randomly going (or leaving) to a seat. When there is choices in seats, charges flow is high. But when there are less free seats, charges are flowing slower. That´s how the opposition current faces is changing over time for a given voltage. The complex notation is the solution to write such changes in time.
Finally, I suggest you try to imagine the physical meaning of capacitor impedance with a step in voltage instead of a sine. I hope my explanation helps you. If not, don´t give up.
A: A generalized view about impédance of basic components and combination of components is exposed in the paper "The Phasance Concept" published on Scibd :
http://www.scribd.com/JJacquelin/documents
A: It is difficult to think about oscillating current as a function of time. Therefore the complex current and voltage were invented.
When you start thinking about current and voltage as about two complex numbers (instead of functions) the analogy with resistor is clear - the two complex numbers have one ratio which does not change over time.
