Today people tend to say the way Islamic countries treat women and girls is "medieval". Thinking about that made me wonder how actual medieval Muslims treated women (or in this case girls) who have sex out of wedlock, and how it compares to how they're treated in places like Saudi Arabia or Iran today?
I can't give you a concrete answer for 1397. This was before the Ottomans began issuing legal codes that regulated criminal justice, and thus the handling of the law would have been very uneven across the empire. The thing about the punishment of illicit sex (zina) in Islamic Law is that it had very strict requirements for establishing proof: the perpetrator of zina had to confess to the crime on four separate occasions in court, or be testified against by four male witnesses of good reputation who actually saw the sexual act, with severe punishment for unproven accusations. If one of the witnesses' stories didn't match, or if the perpetrator confessed but changed his/her mind before doing so four times, the crime could not be punished. These extreme requirements meant that in practice the fixed religious punishments (hadd, pl. hudud) for these crimes have been implemented only extremely rarely in Islamic history. In the whole history of Ottoman Istanbul, we know of only one instance of someone being stoned to death for adultery, and that caused a legal scandal because the requirements hadn't actually been met. If they were met in our hypothetical case, the hadd punishment for an unmarried person who committed zina would be flogging.
For this reason, punishment of sexual crimes was more often handled in accordance with local custom. Judges' duties involved maintaining harmony in society and this gave them a great deal of leeway regarding how they could choose to punish criminals. The only limitation was that they could not hand out any punishment harsher than the hudud punishments. In practice, Islamic Law was therefore almost always more lenient than what one would expect from reading about hudud punishments, because the requirements for carrying them out were rarely met. Therefore, a girl suspected of zina in 1397 would have been treated in accordance with local Edirne custom, whatever that may have been. If taken to court, this could be as lenient as the judge simply ordering her and her "boyfriend" to get married (we know this was common because later Ottoman legal theorists had to explicitly ban this practice). In some cases, youths may have even used extramarital sex as a strategy to marry against their parents' wishes. On the other extreme, if they were caught in the act by a member of the girl's family and murdered in a rage, many judges would be willing to look the other way. Honor killings were a widespread and socially acceptable phenomenon, but they were extralegal. Leslie Peirce has theorized that the surprisingly large number of voluntary zina confessions in mid 16th-century Ayntab may have been a response to this threat of extralegal punishment. By confessing they tied themselves to the Ottoman court and made it more difficult for the local community to pursue its own vigilante justice.
Once the Ottomans began issuing regular legal codes in the latter half of the 15th century, the most common punishment for zina (assuming the requirements for the hadd punishment were not met or were for some reason inapplicable) was a monetary fine. Fines had been issued earlier and they played a role in the local custom of various regions, but the Ottomans sought to standardize them. These fines were progressive by wealth and social class, with free married Muslim men paying the most, and with lower fines for the unmarried, women, slaves, and non-Muslims. This is the type of punishment most non-violent sexual crimes would have been met with under the Ottoman judicial system of the sixteenth, seventeenth, and eighteenth centuries. Repeat offenders could be punished more harshly, with corporal punishment or banishment. At least in this respect, Ottoman legal codes resembled those of many parts of contemporary Europe.