* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; padding: 20px; color: #333; }
.container { max-width: 500px; margin: 0 auto; background: white; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); overflow: hidden; }
.header { background: linear-gradient(45deg, #ff6b6b, #ee5a24); padding: 30px 20px; text-align: center; color: white; }
.header h1 { font-size: 24px; margin-bottom: 10px; }
.header p { opacity: 0.9; font-size: 14px; }

/* NOUVEAU : Styles pour la page d'accueil */
.home-content { padding: 20px 30px; }
.home-content .intro { font-size: 16px; line-height: 1.6; text-align: center; margin-bottom: 30px; color: #555; }
.home-content .card { background: #f8f9fa; border-radius: 15px; padding: 25px; margin-bottom: 20px; border-left: 5px solid #667eea; }
.home-content .card h2 { margin-top: 0; margin-bottom: 15px; color: #333; }
.home-content .card p { margin-bottom: 20px; line-height: 1.5; color: #666; }
.home-content .card .btn-primary { width: 100%; text-align: center; padding: 15px; font-size: 16px; }
.home-content .card-secondary { border-left-color: #fdcb6e; }
.home-content .card-secondary ul { list-style: none; padding-left: 0; color: #666; }
.home-content .card-secondary ul li { margin-bottom: 8px; padding-left: 20px; position: relative; }
.home-content .card-secondary ul li::before { content: '✓'; color: #2ecc71; position: absolute; left: 0; font-weight: bold; }

.mode-selection { display: flex; gap: 15px; padding: 20px; flex-wrap: wrap; justify-content: center; }
.mode-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 10px; border: none; border-radius: 12px; color: white; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-align: center; min-width: 180px; }
.mode-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.mode-btn__title { margin-bottom: 5px; }
.mode-btn__subtitle { font-size: 12px; font-weight: 400; opacity: 0.8; }
#mode-complete-btn { background: linear-gradient(45deg, #2ed573, #1dd1a1); }
#mode-live-btn { background: linear-gradient(45deg, #54a0ff, #2e86de); }
#edition-zone { padding: 0 20px 20px 20px; border-top: 1px solid #f0f0f0; display: none; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; }
input[type="datetime-local"], textarea#notes { width: 100%; padding: 12px 16px; border: 2px solid #e1e8ed; border-radius: 12px; font-size: 16px; transition: all 0.3s ease; background: #f8f9fa; }
input[type="datetime-local"]:focus, textarea#notes:focus { outline: none; border-color: #667eea; background: white; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
textarea#notes { min-height: 80px; resize: vertical; }
.options-group { margin-top: 20px; padding: 15px; background: #f8f9fa; border-radius: 12px; }
.interruptions-section { background: #f8f9fa; padding: 15px; border-radius: 12px; }
.interruption-item { display: flex; align-items: center; margin-bottom: 10px; }
.interruption-item input { flex: 1; margin-right: 10px; }
.checkbox-group { display: flex; align-items: center; margin-bottom: 15px; }
.checkbox-group label { margin: 0 0 0 10px; font-weight: normal; color: #333; }
#notes-wrapper { display: none; margin-top: 10px; }
.btn { background: linear-gradient(45deg, #667eea, #764ba2); color: white; border: none; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; text-decoration: none; display: inline-block; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); }
.btn-danger { background: linear-gradient(45deg, #ff6b6b, #ee5a24); }
.btn-small { padding: 8px 12px; font-size: 12px; }
.btn-add { width: 100%; margin-top: 20px; padding: 15px; font-size: 16px; }
.timeline-section { padding: 20px; }
.timeline-day { margin-bottom: 30px; padding-bottom: 25px; }
.day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.day-date { font-weight: 700; color: #333; font-size: 16px; }
.day-stats { font-size: 12px; color: #666; background: #f0f1f2; padding: 5px 10px; border-radius: 20px; }
.timeline-bar { position: relative; height: 40px; background: #e9ecef; border-radius: 8px; overflow: visible; }
.time-labels { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 10px; color: #666; }
.sleep-block-wrapper { position: absolute; top: 0; height: 100%; }
.sleep-block { position: relative; width: 100%; height: 100%; background: linear-gradient(45deg, #2c3e50, #34495e); cursor: pointer; transition: all 0.3s ease; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sleep-block:hover { filter: brightness(1.2); }
.sleep-block--long { background: linear-gradient(45deg, #1e2b38, #253847); }
.sleep-block--short { background: linear-gradient(45deg, #4a5d70, #536a7e); }
.sleep-block--in-progress { background: linear-gradient(to right, #ffaf40, #ff793f); border-radius: 4px 0 0 4px; z-index: 10; }
.sleep-block--in-progress::after { content: ''; position: absolute; right: -20px; top: 0; width: 0; height: 0; border-top: 20px solid transparent; border-bottom: 20px solid transparent; border-left: 20px solid #ff793f; }
.sleep-block-duration { color: white; font-size: 12px; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.7); }
.interruption-mark { color: #ffdd59; font-weight: bold; font-size: 20px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); line-height: 1; }
.sleep-block-forced-wakeup::after { content: ''; position: absolute; right: 0; top: 0; width: 5px; height: 100%; background-color: #d63031; border-radius: 0 4px 4px 0; }
.sleep-block-notes-wrapper { position: absolute; bottom: -22px; left: 0; width: 100%; text-align: center; }
.sleep-block-notes-underline { height: 3px; background-color: #ffdd59; border-radius: 2px; width: 100%; margin: 0 auto; }
.sleep-block-notes-text { font-size: 11px; color: #4a4a4a; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.sleep-details { background: white; margin-top: 15px; padding: 20px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-left: 4px solid #667eea; display: none; animation: slideDown 0.3s ease-out; }
.sleep-details.show { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.details-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; }
.details-header h3 { color: #333; margin: 0; font-size: 18px; }
.close-details { color: #999; font-size: 24px; font-weight: bold; cursor: pointer; line-height: 1; padding: 5px; border-radius: 50%; transition: all 0.3s ease; }
.detail-item { margin-bottom: 15px; padding: 12px; background: #f8f9fa; border-radius: 10px; }
.detail-label { font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.detail-value { font-size: 16px; color: #333; }
.action-buttons { display: flex; gap: 10px; margin-top: 15px; justify-content: flex-end; }
.loading { text-align: center; padding: 20px; color: #666; }
.error { background: #ffe6e6; color: #d63031; padding: 15px; border-radius: 10px; margin: 20px; border: 1px solid #fab1a0; }
.average-section { padding: 15px; background: #f8f9fa; border-radius: 12px; border-top: 2px solid #e9ecef; margin: 20px 0; text-align: center; }
.average-section div { font-size: 14px; color: #333; line-height: 1.5; }
#live-tracker-view { text-align: center; padding: 20px; }
#live-chronometer { font-size: 28px; font-weight: 700; color: #333; margin: 10px 0 20px 0; }
#live-interruption-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e9ecef; }
.chronometer-blinking { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 480px) { body { padding: 10px; } .container { border-radius: 15px; } .header { padding: 20px 15px; } #edition-zone, .timeline-section { padding: 0 15px 15px 15px; } }

/* NOUVEAU : Styles pour l'overlay d'inscription */
.registration-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.registration-box {
    background: white;
    padding: 30px 40px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}
.registration-box h2 {
    margin-top: 0;
    margin-bottom: 15px;
}
.registration-box p {
    color: #666;
    margin-bottom: 25px;
}
.registration-box input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}
.registration-box .btn {
    width: 100%;
}
.error-message {
    color: #d63031;
    margin-top: 15px;
    font-weight: bold;
}
.guest-mode .mode-selection, .guest-mode .timeline-section, .guest-mode #edition-zone {
    display: none;
}