:root {
  --navy:        #0D2456;
  --blue:        #2563EB;
  --blue-50:     #EFF6FF;
  --blue-100:    #DBEAFE;
  --amber:       #D97706;
  --amber-50:    #FFFBEB;
  --emerald:     #059669;
  --emerald-50:  #ECFDF5;
  --red:         #DC2626;
  --red-50:      #FEF2F2;
  --bg:          #F6F4ED;
  --surface:     #FFFFFF;
  --border:      #E5E0D0;
  --border-light:#F0EDE4;
  --text:        #0F1729;
  --text-mid:    #374151;
  --muted:       #6B7280;
  --muted-light: #9CA3AF;
  --r:           14px;
  --r-sm:        8px;
  --sh-sm:  0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh:     0 4px 20px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  --sh-lg:  0 20px 60px rgba(0,0,0,.09), 0 8px 24px rgba(0,0,0,.05);
  --t:      .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ─── Header ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,244,237,.9);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em;
  text-decoration: none; color: var(--navy);
}
.logo-ai   { color: var(--blue); }
.logo-dash { color: var(--muted-light); }
.header-nav { display: flex; align-items: center; gap: 14px; }
.header-breadcrumb { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.btn-ghost {
  padding: 7px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: none;
  font-family: inherit; font-size: .875rem; color: var(--text-mid);
  cursor: pointer; transition: border-color var(--t), color var(--t), background var(--t);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-50); }

/* ─── App screens ─────────────────────────────────────── */
#app { flex: 1; }
.screen { display: none; }
.screen.active { display: block; }

/* ─── Hero ────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #E6F0FD 0%, var(--bg) 55%);
  padding: 88px 28px 72px; text-align: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(37,99,235,.07) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* ─── Tampon « Démo » ─────────────────────────────────── */
.demo-stamp {
  position: absolute; z-index: 2; pointer-events: none;
  top: 82%; left: 68%;
  transform: translate(-50%, -50%) rotate(-8deg);
  padding: 7px 20px 9px;
  border: 3px solid var(--red);
  border-radius: 9px;
  box-shadow: inset 0 0 0 2.5px var(--red);
  color: var(--red);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700; font-size: 1.5rem;
  letter-spacing: .14em; text-transform: uppercase;
  line-height: 1;
  opacity: .68;
  mix-blend-mode: multiply;
}
.demo-stamp span { display: block; padding: 0 2px; }
@media (max-width: 640px) {
  .demo-stamp { top: 70%; left: 72%; padding: 5px 14px 7px; font-size: 1.125rem; }
}
.hero-content { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(64px);
  animation: float 8s ease-in-out infinite alternate;
}
.orb-1 { width: 360px; height: 360px; background: #BFDBFE; top: -100px; right: -80px; opacity: .45; }
.orb-2 { width: 220px; height: 220px; background: #FDE68A; bottom: -60px; right: 100px; opacity: .3; animation-delay: -3s; }
.orb-3 { width: 180px; height: 180px; background: #A7F3D0; top: 10px; left: -50px; opacity: .28; animation-delay: -5s; }
@keyframes float { to { transform: translate(8px, -12px) scale(1.03); } }

.eyebrow {
  display: inline-block;
  background: var(--amber-50); color: var(--amber);
  border: 1px solid rgba(217,119,6,.18); border-radius: 999px;
  padding: 4px 14px; font-size: .78125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 22px;
}
.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.875rem, 5vw, 3.25rem); font-weight: 700;
  line-height: 1.12; color: var(--navy); margin-bottom: 18px;
}
.hero h1 em { font-style: italic; color: var(--blue); font-weight: 400; }
.hero-lead {
  font-size: 1.0625rem; color: var(--muted); line-height: 1.75;
  max-width: 520px; margin: 0 auto;
}

/* ─── Module cards ────────────────────────────────────── */
.modules-section { max-width: 1120px; margin: 0 auto; padding: 52px 28px 88px; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.module-card {
  background: var(--surface); border-radius: var(--r);
  border: 1px solid var(--border); box-shadow: var(--sh-sm);
  padding: 28px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.module-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--blue) 0%, #60A5FA 100%);
  border-radius: 4px 0 0 4px;
  transform: scaleY(0); transform-origin: bottom; transition: transform var(--t);
}
.module-card:hover::before { transform: scaleY(1); }
.module-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-lg);
  border-color: rgba(37,99,235,.15);
}
.module-card.is-locked { opacity: .55; cursor: default; filter: grayscale(.2); }
.module-card.is-locked:hover { transform: none; box-shadow: var(--sh-sm); border-color: var(--border); }
.module-card.is-locked::before { display: none; }

.module-card.is-completed::before {
  background: linear-gradient(180deg, var(--emerald) 0%, #34D399 100%);
  transform: scaleY(1);
}

.card-number {
  position: absolute; top: 14px; right: 18px;
  font-family: 'Playfair Display', serif; font-size: 3.5rem; font-weight: 700;
  color: var(--border-light); line-height: 1; user-select: none;
}
.card-check {
  position: absolute; top: 16px; right: 18px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--emerald); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 10px rgba(5,150,105,.4); z-index: 2;
}
.card-tag {
  display: inline-block; background: var(--blue-50); color: var(--blue);
  border-radius: 999px; padding: 3px 11px; font-size: .75rem; font-weight: 600;
  margin-bottom: 12px; letter-spacing: .02em;
}
.card-title {
  font-family: 'Playfair Display', serif; font-size: 1.125rem; font-weight: 700;
  color: var(--navy); line-height: 1.35; margin-bottom: 8px;
}
.card-subtitle { font-size: .875rem; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-duration { font-size: .8125rem; color: var(--muted-light); }
.card-cta { font-size: .875rem; color: var(--blue); font-weight: 600; }
.card-locked { font-size: .8125rem; color: var(--muted-light); }

/* ─── Module screen ───────────────────────────────────── */
.module-wrap { max-width: 780px; margin: 0 auto; padding: 44px 28px 88px; }

.module-progress { margin-bottom: 40px; }
.progress-steps { display: flex; margin-bottom: 8px; }
.progress-step {
  flex: 1; text-align: center; font-size: .8rem; font-weight: 400;
  color: var(--muted-light); padding-bottom: 4px; transition: color var(--t), font-weight var(--t);
}
.progress-step.is-active { color: var(--blue); font-weight: 600; }
.progress-step.is-done   { color: var(--emerald); font-weight: 500; }
.progress-track { height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, #34D399 100%);
  border-radius: 999px; transition: width .55s cubic-bezier(.4,0,.2,1);
}

.module-info { margin-bottom: 30px; }
.module-num-label {
  display: block; font-size: .8rem; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px;
}
.module-title-el {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.375rem, 3vw, 1.875rem); font-weight: 700;
  color: var(--navy); line-height: 1.25;
}

/* ─── Video ───────────────────────────────────────────── */
.step-panel { animation: fadeUp .38s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.video-frame {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden;
  background: #0a0a1a; box-shadow: var(--sh-lg); margin-bottom: 14px;
}
.video-frame iframe, #ytPlayer { width: 100%; height: 100%; border: none; display: block; }

.video-prompt {
  display: flex; align-items: center; gap: 8px;
  font-size: .875rem; color: var(--muted); margin-bottom: 24px;
}
.dot-pulse {
  width: 8px; height: 8px; background: var(--amber);
  border-radius: 50%; flex-shrink: 0;
  animation: dpulse 1.6s ease-in-out infinite;
}
@keyframes dpulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.4; transform:scale(.7); } }

/* ─── CTA buttons ─────────────────────────────────────── */
.cta-wrap { display: flex; justify-content: center; margin: 28px 0 4px; }
.btn-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy); color: #fff;
  border: none; border-radius: var(--r);
  padding: 15px 32px; font-size: 1rem; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: background var(--t), transform var(--t), box-shadow var(--t);
  box-shadow: 0 4px 16px rgba(13,36,86,.22);
}
.btn-cta:hover { background: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.28); }
.btn-cta svg { flex-shrink: 0; }

/* ─── Flashcards ──────────────────────────────────────── */
.panel-title {
  font-family: 'Playfair Display', serif; font-size: 1.375rem; font-weight: 700;
  color: var(--navy); margin-bottom: 6px;
}
.panel-lead { font-size: .9375rem; color: var(--muted); margin-bottom: 28px; }

.flashcards-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }
.flashcard {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--blue); border-radius: var(--r);
  padding: 22px 24px; box-shadow: var(--sh-sm);
  transition: border-left-color var(--t), box-shadow var(--t);
}
.flashcard.confirmed { border-left-color: var(--emerald); box-shadow: 0 2px 12px rgba(5,150,105,.1); }
.flashcard-title {
  font-family: 'Playfair Display', serif; font-size: 1.0625rem; font-weight: 700;
  color: var(--navy); margin-bottom: 8px;
}
.flashcard-text { font-size: .9375rem; color: var(--text-mid); line-height: 1.65; margin-bottom: 14px; }

.btn-confirm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: none;
  font-family: inherit; font-size: .875rem; color: var(--muted);
  cursor: pointer; transition: all var(--t);
}
.btn-confirm:hover { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-50); }
.btn-confirm.done { background: var(--emerald); color: #fff; border-color: var(--emerald); pointer-events: none; }

/* ─── Quiz ────────────────────────────────────────────── */
.quiz-progress-label { font-size: .875rem; color: var(--muted); font-weight: 500; margin-bottom: 16px; }
.quiz-card {
  background: var(--surface); border-radius: var(--r); padding: 32px;
  box-shadow: var(--sh); border: 1px solid var(--border);
  animation: fadeUp .32s ease both;
}
.quiz-question {
  font-family: 'Playfair Display', serif; font-size: 1.125rem; font-weight: 700;
  color: var(--navy); line-height: 1.5; margin-bottom: 22px;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: inherit; font-size: .9375rem; color: var(--text-mid);
  text-align: left; cursor: pointer; width: 100%;
  transition: border-color var(--t), background var(--t), color var(--t);
}
.quiz-option:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-50); color: var(--navy); }
.option-letter {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: .75rem; font-weight: 700; color: var(--muted);
  flex-shrink: 0; transition: all var(--t);
}
.option-text { flex: 1; line-height: 1.4; padding-top: 2px; }

.quiz-option.is-correct { background: var(--emerald-50); border-color: var(--emerald); color: var(--text); }
.quiz-option.is-correct .option-letter { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.quiz-option.is-wrong   { background: var(--red-50); border-color: var(--red); color: var(--text); }
.quiz-option.is-wrong   .option-letter { background: var(--red); color: #fff; border-color: var(--red); }
.quiz-option:disabled { cursor: default; }

.quiz-explanation {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 18px; padding: 16px 18px;
  background: var(--blue-50); border-left: 3px solid var(--blue);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  animation: fadeUp .28s ease both;
}
.expl-badge { font-size: .8125rem; font-weight: 700; }
.expl-ok { color: var(--emerald); }
.expl-ko { color: var(--red); }
.expl-text { font-size: .9375rem; color: var(--text-mid); line-height: 1.6; }

.btn-next {
  display: flex; align-items: center; gap: 8px;
  margin-top: 20px; margin-left: auto;
  padding: 11px 22px; border-radius: var(--r-sm);
  background: var(--navy); color: #fff; border: none;
  font-family: inherit; font-size: .9375rem; font-weight: 500;
  cursor: pointer; transition: background var(--t), transform var(--t);
  animation: fadeUp .3s ease both;
}
.btn-next:hover { background: var(--blue); transform: translateX(2px); }

/* ─── Score ───────────────────────────────────────────── */
.score-card {
  background: var(--surface); border-radius: var(--r);
  padding: 56px 36px; text-align: center;
  box-shadow: var(--sh-lg); border: 1px solid var(--border);
  animation: fadeUp .5s ease both;
}
.score-ring {
  width: 128px; height: 128px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 28px; border: 3px solid;
}
.score-ring.high { background: var(--emerald-50); border-color: var(--emerald); color: #065F46; }
.score-ring.mid  { background: var(--amber-50);   border-color: var(--amber);   color: #92400E; }
.score-ring.low  { background: var(--blue-50);    border-color: var(--blue);    color: #1E40AF; }
.score-num   { font-family: 'Playfair Display', serif; font-size: 2.75rem; font-weight: 700; line-height: 1; }
.score-denom { font-size: .875rem; opacity: .65; margin-top: 2px; }
.score-title {
  font-family: 'Playfair Display', serif; font-size: 1.625rem; font-weight: 700;
  color: var(--navy); margin-bottom: 12px;
}
.score-message { font-size: 1rem; color: var(--muted); line-height: 1.75; max-width: 420px; margin: 0 auto 32px; }
.score-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; }
.btn-retry-opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--r-sm);
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--border);
  font-family: inherit; font-size: .9375rem; font-weight: 500;
  cursor: pointer; transition: border-color var(--t), background var(--t);
  width: 100%; max-width: 320px; justify-content: center;
}
.btn-retry-opt:hover { border-color: var(--blue); background: var(--blue-50); }
.btn-retry {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--r-sm);
  background: var(--navy); color: #fff; border: none;
  font-family: inherit; font-size: .9375rem; font-weight: 500;
  cursor: pointer; transition: background var(--t);
  width: 100%; max-width: 320px;
}
.btn-retry:hover { background: var(--blue); }
.btn-return {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--r-sm);
  background: var(--navy); color: #fff; border: none;
  font-family: inherit; font-size: .9375rem; font-weight: 500;
  cursor: pointer; transition: background var(--t);
}
.btn-return:hover { background: var(--blue); }

/* ─── Footer ──────────────────────────────────────────── */
.site-footer {
  text-align: center; padding: 22px 28px;
  border-top: 1px solid var(--border);
  font-size: .875rem; color: var(--muted); margin-top: auto;
}
.site-footer strong { color: var(--navy); font-weight: 600; }
.footer-link { color: var(--blue); font-weight: 600; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }

/* ─── Utility ─────────────────────────────────────────── */
[hidden] { display: none !important; }

@media (max-width: 600px) {
  .hero { padding: 60px 20px 48px; }
  .modules-section { padding: 32px 20px 60px; }
  .module-wrap { padding: 28px 20px 60px; }
  .quiz-card { padding: 22px 18px; }
  .score-card { padding: 40px 20px; }
  .header-inner { padding: 12px 20px; }
}
