It doesn’t actually straight up reset, you just lose a day. So if you’re at day 41 and you miss the next day (day 42), on what would be day 43 you’ll be back on day 40.
basically it works like this, if you log in the next day, the counter increments, and if you miss a day, the counter decrements plus you don’t collect that bonus after a non-consecutive login.
It’s a pretty ingenious way to balance rewarding those who log in daily and not screwing over people who miss days here and there by resetting them back to day 0.