It is essential for the person who wishes to observe an obligatory fast to have the intention to do so before dawn, because the Prophet said: “Whoever does not have the intention to fast before dawn has no fast [for that day].” [Sunan al-Tirmidhī (730) and Sunan Abī Dāwūd (2454)]
This is unnecessary for those who wish to offer a voluntary fast. They can decide to do so in the morning, as long as they have not already partaken of food or drink.
This is in accordance with the Prophet’s practice with his voluntary fasts. His wife `Ā’ishah relates to us that he would ask her in the morning if there was anything to eat. If she said “no”, he would say: “Then I shall fast today.” [Sahīh Muslim (1154)]
Regarding the requirement for having the intention to fast before dawn for the obligatory fasts, what matters is that dawn has not yet arrived. It does not matter if the person has slept that night.
Therefore, if a person goes to sleep not knowing whether it is the eve of the first of Ramadān and wakes up a little before dawn to learn that it is, then the person should to resolve to fast on the spot.
To answer your final concern, having an intention to fast is something straightforward. There is nothing difficult or ambiguous about it. Some people misunderstand this and have misgivings whether or not they really intended to fast.
Any Muslim who knows that Ramadān is starting and that they are going to fast the month already has the intention for the whole month. It is that simple.
Therefore, if you intend to be fasting Ramadān, you have nothing to worry about. You do not have to formulate a new intention every night.
And Allah knows best.