Use w3-grid to place form controls next to each other.
The columns automatically stack when there is not enough space.