What you want is a form of heliograph, which is a fairly well-studied and used form of communication. These systems use a mirror to reflect sunlight at the target in flashes, so their maximum range is determined by the size of the mirror. Using large, emplaced mirrors and telescopes between fixed positions, ranges of up to 300km are possible, and your nation could use relay stations or a series of fortresses to spread them further. Portable versions could be used by troops in the field to communicate with their home base.
Heliographs rely on sunlight, and won't work at night or in overcast conditions; similar light signals can be sent via oil lamp but I doubt they have as much range. For vital messages, it would probably be best to have a backup system of messengers in place. (Modern light signals can be sent even in daylight using carbon arc lamps, but that sounds like more sophisticated technology than you're aiming for.)
In terms of hiding signals from the enemy, heliographs are inherently fairly secure because the reflected flashes are only visible in a narrow cone; when transmitting to a fixed location, you can use tubes to narrow the aperture even further. However, those signals can still be read by enemies along the path of the beam. The conventional solution would be to use a codebook that translates words and phrases into numerical codes, which are then kept secret from the enemy.
You can see what that looks like in a diplomatic example with the Zimmerman telegram, which consisted of a long string of numbers broken up into blocks. More common words would receive lower number codes. The diplomatic code contained many thousands of entries to cover every possibility; a military code could be considerably shorter.
The disadvantage of codebooks, of course, is that they can fall into enemy hands. For this reason, it's prudent to keep track of who has them and what happens to them, and have a plan to roll out a new code if your existing one is compromised.