Unable to flip the fog upside down
For something simple like this, I would just separate the generated coordinates into XYZ and use the Z value plugged into a ColorRamp node.
This will give you a far better control of your scattering density.

The object orientation should be world oriented (at least if you're using Generated or Object coordinates), so that the Z axis is aligned to the world Z axis.

On the right 3DViewport you can see that the local axis for the box has at least the Z axis (blue arrow at the center of the box) aligned with the world Z axis (the blue arrow at the bottom left corner of the viewport).
The Z axis is then used from the 'Generated' coordinates, which are mapped from the bottom/top to a scale of 0 to 1 and plugged into a color ramp, that defines the vertical density map.