You buy the plushest pillowtop mattress... set the thermostat to the perfect temp… and maybe even pop in some earplugs.

When it comes to creating the ideal environment for a good night's sleep, you don't want to cut any corners -- because if things aren't "just so," you could toss and turn all night long.

Yet while some of us need it to be pitch black before we can fall asleep, others drift off easily with light from the TV or a nightlight brightening the room.

But according to a new study, even if being exposed to light doesn't SEEM to bother your sleep, it may upset your metabolism -- because being exposed to light while you're snoozing ups your risk of DIABETES.

In the study, Northwestern University researchers divided a group of healthy adults into two groups: One group slept in a completely dark room for two nights, while the other spent the first night in a dark room and the second night in a room with overhead light.

On both mornings, the researchers tested participants’ blood sugar and found that those who were exposed to light during sleep became significantly MORE resistant to insulin than those who slept in the completely dark room only.

Now, as I've shared with you before, insulin helps deliver sugar from your bloodstream to your cells.

And when your cells become resistant to insulin -- preventing it from doing its job -- your blood sugar numbers can skyrocket.

That means that just ONE night of sleep in a room with light can set you on a path toward insulin sensitivity.

And if it happens night after night, we're talking a fast track to Diabetes City!

Now, the study didn't determine exactly why light exposure can wreck your body's response to insulin.

But we do know that light can suppress your levels of the sleep hormone melatonin.

And when you sleep, melatonin typically tells your pancreas to decrease insulin secretion -- most likely because while you're sawing logs, you're not sending any food into your stomach!

So, it stands to reason that if light exposure reduces your melatonin levels, your pancreas may shoot more insulin than necessary into your bloodstream, paving the way to insulin resistance.

That means you should aim to sleep in the DARKEST room possible -- even if you're one of those people who can nod off when it's bright as day.

At bedtime, shut off all your lamps and keep all electronic devices -- including the boob tube -- off or out of your bedroom.

If you need a nightlight for those wee-hours bathroom trips, place it in the bathroom or hallway instead of in your bedroom (or get one that’s set to turn on when it detects motion).

And if light tends to drift in through your windows, consider investing in some "blackout" shades or a good eye mask to block it out.