Two-loop effective potential, thermal resummation, and first-order phase transitions: Beyond the high-temperature expansion