* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #111111;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.frame {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  position: relative;
  padding-bottom: 64px;
}

/* ---------- Header (Accueil) ---------- */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}
.home-header .brand-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.home-header .brand-subtitle {
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.03em;
}

/* ---------- Header (pages internes) ---------- */
.page-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-bottom: 1px solid #f3f4f6;
}
.page-header h1 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
}
.page-header .back-btn {
  position: absolute;
  left: 12px;
  padding: 4px;
  font-size: 20px;
  line-height: 1;
}

/* ---------- Cover cards (rubriques / parcours) ---------- */
.cover-card {
  position: relative;
  display: block;
  width: 100%;
  height: 176px;
  overflow: hidden;
}
.cover-card.small { height: 160px; }
.cover-card .bg {
  position: absolute;
  inset: 0;
}
.cover-card .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.1) 60%, transparent);
}
.cover-card .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px;
  color: #fff;
}
.cover-card .eyebrow {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  margin: 0 0 2px;
}
.cover-card .title {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
}

/* dégradés placeholder (pas d'images réelles) */
.g-slate   { background: linear-gradient(135deg, #475569, #0f172a); }
.g-amber   { background: linear-gradient(135deg, #b45309, #1c1917); }
.g-cyan    { background: linear-gradient(135deg, #0e7490, #0f172a); }
.g-rose    { background: linear-gradient(135deg, #e11d48, #4c0519); }
.g-indigo  { background: linear-gradient(135deg, #4338ca, #0f172a); }
.g-zinc    { background: linear-gradient(135deg, #3f3f46, #18181b); }
.g-stone   { background: linear-gradient(135deg, #57534e, #292524); }
.g-gray    { background: linear-gradient(135deg, #d1d5db, #9ca3af); }

/* ---------- Section accordion ---------- */
.section {
  border-bottom: 1px solid #f3f4f6;
}
.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-align: left;
}
.section-header .titles {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header .titles p.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
}
.section-header .meta {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0;
}
.section-header .meta.disabled { color: #9ca3af; }
.badge-new {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #000;
  border-radius: 4px;
  padding: 2px 6px;
}
.chevron {
  font-size: 14px;
  color: #9ca3af;
  transition: transform 0.2s ease;
}
.chevron.open { transform: rotate(180deg); }

.section-cover {
  height: 96px;
  margin: 0 16px 12px;
  border-radius: 8px;
}

.simple-items {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.simple-item {
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  padding: 10px 12px;
  border-radius: 6px;
}

.group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.03em;
  padding: 6px 16px;
  white-space: pre-line;
}

/* ---------- Lesson row (favori + pdf) ---------- */
.lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row .lesson-btn {
  flex: 1;
  text-align: left;
}
.lesson-row .lesson-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.lesson-row .lesson-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0;
}
.bookmark-btn {
  padding: 4px;
  margin-left: 8px;
  flex-shrink: 0;
  font-size: 16px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #9ca3af;
}
.bottom-nav .nav-item.active { color: #000; font-weight: 600; }
.bottom-nav .nav-icon { font-size: 18px; line-height: 1; }
.bottom-nav .nav-underline {
  height: 2px;
  width: 28px;
  border-radius: 2px;
  background: transparent;
  margin-top: 2px;
}
.bottom-nav .nav-item.active .nav-underline { background: #000; }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  padding: 96px 16px;
}

/* ---------- PDF modal ---------- */
.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.pdf-sheet {
  width: 100%;
  max-width: 430px;
  height: 92vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}
.pdf-sheet-header .lesson-title { margin: 0; font-size: 13px; font-weight: 600; }
.pdf-sheet-header .lesson-subtitle { margin: 2px 0 0; font-size: 12px; color: #6b7280; }
.pdf-sheet iframe {
  flex: 1;
  width: 100%;
  border: none;
}
