:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface2: #F3F4F6;
  --border: #E5E7EB;
  --text: #1F2937;
  --text-muted: #6B7280;
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

/* AUTH */
.view-auth-wrap {
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 32px 24px;
  gap: 24px;
}
.view-auth-wrap .auth-slogan-card {
  width: 100%;
  max-width: 760px;
  margin-bottom: 0;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-logo-img { width: 56px; height: 56px; }
.auth-logo h1      { font-size: 26px; color: var(--primary); letter-spacing: -0.5px; margin: 0; }
.auth-version      { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.auth-slogan-card  { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 20px; padding: 14px 20px; background: linear-gradient(135deg, #EDE9FE, #F0FDF4); border-radius: 12px; border-left: 4px solid #4F46E5; }
.auth-slogan-card span { font-size: 13px; font-weight: 600; color: #4F46E5; text-align: center; line-height: 1.6; }
.review-guest-msg  { text-align: center; color: #6B7280; font-size: 14px; padding: 20px; background: #F9FAFB; border-radius: 12px; margin-bottom: 16px; }
.auth-field        { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-label        { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.email-hint-icon   { width: 16px; height: 16px; background: #4F46E5; color: white; border-radius: 50%; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: help; flex-shrink: 0; }
.auth-pw-wrap      { position: relative; display: flex; }

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s;
}

.auth-tab.active { background: var(--primary); color: #fff; }

#auth-form { display: flex; flex-direction: column; gap: 12px; }

#auth-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  width: 100%;
  box-sizing: border-box;
}

#auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(220,38,38,0.06);
  border-radius: 8px;
  border: 1px solid rgba(220,38,38,0.2);
}

.auth-success {
  color: var(--success);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(5,150,105,0.07);
  border-radius: 8px;
  border: 1px solid rgba(5,150,105,0.2);
}

/* Champ mot de passe avec bouton œil */
#password-field-wrap {
  position: relative;
  display: flex;
}
#password-field-wrap input {
  flex: 1;
  padding-right: 44px;
}
.btn-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  color: var(--text-muted);
}

/* Suggestions de mots de passe */
.pw-suggest-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
#pw-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.btn-pw-suggestion {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.btn-pw-suggestion:hover  { border-color: var(--primary); background: rgba(79,70,229,0.05); }
.btn-pw-suggestion.selected { border-color: var(--primary); background: rgba(79,70,229,0.1); color: var(--primary); }
.btn-refresh-pw {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
}
.btn-refresh-pw:hover { text-decoration: underline; }

/* Mot de passe oublié */
.btn-forgot {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  width: 100%;
  padding: 4px 0;
  transition: color 0.15s;
}
.btn-forgot:hover { color: var(--primary); }

.forgot-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.forgot-desc  { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

#forgot-form { display: flex; flex-direction: column; gap: 10px; }
#forgot-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

/* NAV user */
.nav-user { display: flex; align-items: center; gap: 12px; }

#nav-username { font-size: 13px; color: var(--text-muted); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.logo { font-weight: 700; font-size: 18px; color: var(--primary); letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.logo-img { width: 38px; height: 38px; display: block; }

.nav-links { display: flex; gap: 4px; }

.nav-links button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-links button:hover { background: var(--surface2); color: var(--text); }
.nav-links button.active { background: rgba(79,70,229,0.08); color: var(--primary); }

/* VIEWS */
.view {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px;
}

.hidden { display: none !important; }
.nav-logged { visibility: hidden; pointer-events: none; }
nav.is-logged .nav-logged { visibility: visible; pointer-events: auto; }

h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; color: var(--text); letter-spacing: -0.5px; }

.subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 15px; }

/* IMPORT */
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 16px;
  font-size: 16px;
  font-family: 'David Libre', serif;
  direction: rtl;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.8;
  box-shadow: var(--shadow);
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.import-actions { margin-top: 16px; }

.result-box {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.result-box.success { border-color: var(--success); color: var(--success); background: rgba(5,150,105,0.05); }
.result-box.error   { border-color: var(--danger);  color: var(--danger);  background: rgba(220,38,38,0.05); }

/* BUTTONS */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(79,70,229,0.3);
}

.btn-primary:hover  { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(79,70,229,0.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* REVIEW */
#session-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

#session-progress { font-size: 14px; color: var(--text-muted); font-weight: 500; }

.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

/* FLASHCARD */
#flashcard-container {
  perspective: 1200px;
  margin-bottom: 32px;
}

#flashcard {
  width: 100%;
  height: 280px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#flashcard.flipped { transform: rotateY(180deg); }

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.card-front, .card-back {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-card);
}

.card-back {
  transform: rotateY(180deg);
  border-color: var(--primary);
  border-width: 2px;
}

.card-label {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.card-back .card-label { left: auto; right: 20px; }

#card-french {
  font-size: 22px;
  text-align: center;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

#card-hebrew {
  font-family: 'David Libre', serif;
  font-size: 28px;
  text-align: center;
  line-height: 1.8;
  color: var(--text);
  direction: rtl;
}

#card-phonetic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
}
.phonetic-masc, .phonetic-fem {
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.3px;
}
.phonetic-masc { color: #6B7280; }
.phonetic-fem  { color: #9D74C7; }

.card-hint {
  position: absolute;
  bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-audio {
  position: absolute;
  bottom: 14px;
  right: 16px;
  background: rgba(79,70,229,0.08);
  border: 1px solid rgba(79,70,229,0.3);
  color: var(--primary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-audio:hover { background: rgba(79,70,229,0.15); }

.btn-unflip {
  position: absolute;
  bottom: 14px;
  left: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-unflip:hover { background: var(--border); color: var(--text); }

.btn-audio-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.btn-audio-sm:hover { border-color: var(--primary); color: var(--primary); }

/* GRADES */
.grade-label {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 14px;
  font-weight: 500;
}

.grades {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.grade {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: transform 0.1s, opacity 0.1s, box-shadow 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.grade:hover  { opacity: 0.9; box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
.grade:active { transform: scale(0.96); }

.grade-num { font-size: 20px; font-weight: 700; }

.grade-0 { background: #DC2626; }
.grade-1 { background: #EA580C; }
.grade-2 { background: #2563EB; }
.grade-3 { background: #16A34A; }

/* SESSION DONE */
#session-done {
  text-align: center;
  padding: 40px 0;
}

.done-icon { font-size: 56px; margin-bottom: 16px; }

#session-done h2 { font-size: 24px; margin-bottom: 10px; }

#session-done p { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }

/* LIST */
.list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

#due-badge {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface2);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.td-hebrew {
  font-family: 'David Libre', serif;
  font-size: 18px;
  direction: rtl;
  text-align: right;
}

.td-due { color: var(--success); font-weight: 500; }
.td-future { color: var(--text-muted); }

.btn-delete {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}

.btn-delete:hover { border-color: var(--danger); color: var(--danger); background: rgba(220,38,38,0.05); }

#empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}

#empty-state p { margin-bottom: 20px; font-size: 16px; }

/* TOAST */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 22px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success { background: var(--success) !important; }
.toast-error   { background: var(--danger)  !important; }

/* ── DASHBOARD ──────────────────────────────────────────────────────── */
.dashboard-top {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  align-items: stretch;
  flex-wrap: wrap;
}

.dashboard-streak {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 32px;
  text-align: center;
  min-width: 140px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.streak-label-top {
  font-size: 13px;
  font-weight: 700;
  color: #4F46E5;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.streak-flame { font-size: 40px; line-height: 1; }

.streak-value {
  font-size: 52px;
  font-weight: 700;
  color: var(--warning);
  line-height: 1.1;
}

.streak-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.streak-rights {
  margin-top: 8px;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

.streak-missed {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  min-height: 16px;
}
.streak-missed.warning { color: var(--warning); }
.streak-missed.danger  { color: var(--danger); }

.dashboard-info {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}

.db-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.db-info-label { color: var(--text-muted); }

.db-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
  margin-top: 8px;
}

/* Lesson bars in dashboard */
.lesson-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}

.lesson-bar:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.lesson-bar.current  { border-color: var(--primary); border-left: 3px solid var(--primary); }
.lesson-bar.validated { border-color: var(--success); border-left: 3px solid var(--success); }

.lesson-bar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.lesson-bar-num { font-weight: 700; font-size: 14px; flex-shrink: 0; }

.lesson-bar-title { color: var(--text-muted); font-size: 14px; flex: 1; }

.lesson-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.validated-badge { background: rgba(5,150,105,0.1); color: var(--success); }
.current-badge   { background: rgba(79,70,229,0.1); color: var(--primary); }

.lesson-bar-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.progress-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.progress-fill-bar.fill-green { background: var(--success); }

.lesson-score-label { font-size: 12px; color: var(--text-muted); }

.dashboard-slogan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 16px 0;
  padding: 14px 20px;
  background: linear-gradient(135deg, #EDE9FE, #F0FDF4);
  border-radius: 12px;
  border-left: 4px solid #4F46E5;
}
.dashboard-slogan span {
  font-size: 14px;
  font-weight: 600;
  color: #4F46E5;
  text-align: center;
  line-height: 1.6;
}

.btn-review-now {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 16px;
  font-size: 16px;
}

.force-review-banner {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: rgba(79,70,229,0.04);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: 12px;
  text-align: center;
}

.force-review-banner p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-secondary:hover { background: rgba(79,70,229,0.08); }

/* ── CARD LAYOUT v2 ─────────────────────────────────────────────────── */
.card-label-top {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-lang {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.card-lesson-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ── LESSONS VIEW ───────────────────────────────────────────────────── */
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}

.lesson-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.lesson-card.current  { border-left: 3px solid var(--primary); }
.lesson-card.validated { border-left: 3px solid var(--success); }
.lesson-card.locked { opacity: 0.5; }

.lesson-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lesson-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lesson-num { font-weight: 700; font-size: 14px; }
.lesson-title-fr { font-size: 15px; font-weight: 500; }
.lesson-title-he { font-family: 'David Libre', serif; font-size: 18px; color: var(--text-muted); }

.lesson-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 600;
}

.badge-locked  { background: rgba(107,114,128,0.1); color: var(--text-muted); }
.badge-ok      { background: rgba(5,150,105,0.1); color: var(--success); }
.badge-current { background: rgba(79,70,229,0.1); color: var(--primary); }

.lesson-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── SETTINGS VIEW ──────────────────────────────────────────────────── */
.setting-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-group label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.setting-group select,
.setting-group input[type="number"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  max-width: 280px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.setting-group select:focus,
.setting-group input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* BOUTON AIDE */
.btn-help {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-help:hover { background: var(--surface2); }

/* MODAL MODE D'EMPLOI */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.help-overlay.hidden { display: none; }

.help-modal {
  background: var(--surface);
  border-radius: 18px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-header h2 { font-size: 18px; }

.help-close {
  background: var(--surface2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.help-close:hover { background: var(--border); }

.help-lang-btns { display: flex; gap: 6px; margin-left: auto; margin-right: 8px; }
.lang-btn { background: #E5E7EB; border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600; transition: background 0.15s, color 0.15s; }
.lang-btn.active { background: #4F46E5; color: white; }

.help-body {
  overflow-y: auto;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-body section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}

.help-body section p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 6px;
}

.help-body section ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.grade-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  margin-right: 4px;
}
.grade-0-pill { background: #FEE2E2; color: #991B1B; }
.grade-1-pill { background: #FEF3C7; color: #92400E; }
.grade-2-pill { background: #DBEAFE; color: #1E40AF; }
.grade-3-pill { background: #D1FAE5; color: #065F46; }

/* ── NAV MENTIONS LÉGALES ───────────────────────────────────────────── */
.nav-legal {
  font-size: 12px !important;
  color: #94A3B8 !important;
  padding: 6px 10px !important;
}
.nav-legal:hover { color: var(--text-muted) !important; }

/* ── MENTIONS LÉGALES ───────────────────────────────────────────────── */
.legal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.legal-section h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.legal-section p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-section p:last-child { margin-bottom: 0; }

.legal-section ul {
  padding-left: 20px;
  margin: 8px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

.legal-section a { color: var(--primary); text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }

.legal-copyright {
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 0 0;
}
.legal-copyright p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── SETTINGS RADIO + CHECKBOX ─────────────────────────────────────── */
.class-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.class-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  max-width: 320px;
  user-select: none;
}

.class-radio:hover { border-color: var(--primary); background: rgba(79,70,229,0.04); }

.class-radio input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.class-radio:has(input:checked) {
  border-color: var(--primary);
  background: rgba(79,70,229,0.07);
}

.class-radio span { font-size: 14px; font-weight: 500; color: var(--text); }

.setting-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.setting-checkbox input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.setting-checkbox span { font-size: 14px; color: var(--text); line-height: 1.5; }

/* ── AVIS ───────────────────────────────────────────────────────────── */
.review-intro {
  background: linear-gradient(135deg, #EDE9FE, #F0FDF4);
  border-left: 4px solid #4F46E5;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.review-intro p { font-size: 14px; color: #374151; line-height: 1.6; }

.review-form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}
.review-form-box h2 { font-size: 16px; margin-bottom: 14px; }

.star-rating {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.star {
  font-size: 36px;
  color: #D1D5DB;
  cursor: pointer;
  transition: color 0.12s, transform 0.1s;
  line-height: 1;
  user-select: none;
}
.star.active  { color: #F59E0B; }
.star:hover   { transform: scale(1.15); }
.star-label   { font-size: 13px; color: var(--text-muted); min-height: 18px; }

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.review-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-stars { color: #F59E0B; font-size: 18px; letter-spacing: 1px; }
.review-date  { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.review-comment { font-size: 14px; color: var(--text); line-height: 1.6; }
.review-reply {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(79,70,229,0.05);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}
.review-reply strong { color: var(--primary); }
