There are some very serious causes of swollen legs and you do need to have a check by your doctor.
There are a variety of reasons for swollen ankles and feet including high blood pressure, cardiovascular problems, circulation problem, kidney problem and something putting pressure on a major vein (the Inferior vena cava).
Transient swelling could be related to prolonged immobility causing calf muscles failing to pump fluid back into the circulation. Other causes include varicose veins, side-effects of some drugs and being overweight. A mild diuretic would be the first action, together with compression hosiery.
Keep your legs elevated at a high angle when you can to encourage drainage and if you have a sedentary job ensure that you get up and move around every hour. Avoid caffeine drinks, but do continue to drink water. Reduce your salt intake too.
However your symptoms either indicate a deterioration of your cardiovascular function or your renal function.
The risk of facial edema which is linked to frothy or cloudy urine is a sign of nephrotic syndrome and this can read to renal failure so you do need to have some basic kidney function tests, even a urine dipstick for protein would be a simple guide.
You may want to look locally for not-for-profit centers or see if there any healthcare schemes that you may be entitled to claim.