@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400..700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --violet: #5F1EEC;
  --violet-soft: #F3F1FE;
  --violet-dark: #4a17ba;
  --ink: #14141A;
  --gray: #6b6b76;
  --gray-soft: #a4a3ad;
  --border: #E7E5F0;
  --bg: #ffffff;
  --green: #1a9c5e;
  --red: #c23b3b;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --text: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--text);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; }

/* ---------- Topbar (app pages) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--violet);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- Typography ---------- */
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--ink);
}
h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--ink);
}
h3 {
  font-family: var(--text);
  font-weight: 600;
  font-size: 15px;
  margin: 18px 0 6px;
}
p { margin: 0 0 14px; color: #2b2b33; max-width: 62ch; }
.muted { color: var(--gray); font-size: 14px; }
.lede { font-size: 17px; color: #3a3a42; max-width: 56ch; }

/* ---------- Form elements ---------- */
label { display: block; font-size: 13px; color: var(--gray); margin: 16px 0 6px; }
input, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--text);
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--text);
  cursor: pointer;
  text-decoration: none;
  margin-top: 18px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
button:hover, .btn:hover { opacity: 0.85; }
button:active, .btn:active { transform: scale(0.98); }
button:disabled { background: #d8d7e0; cursor: not-allowed; opacity: 1; }

.btn-accent { background: var(--violet); }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--ink); opacity: 1; }

.error { color: var(--red); font-size: 14px; margin-top: 10px; }
.success { color: var(--green); font-size: 14px; margin-top: 10px; }

.auth-switch { margin-top: 22px; font-size: 14px; text-align: center; color: var(--gray); }
.auth-switch a { color: var(--ink); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Cards (used sparingly, not as default chrome for everything) ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
}
.panel {
  background: var(--violet-soft);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

/* ---------- The day sequence: the visual spine of the product ---------- */
.sequence { position: relative; margin: 8px 0; }
.sequence-line {
  position: absolute;
  left: 21px; top: 24px; bottom: 24px;
  width: 1px;
  background: var(--border);
}
.day-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.day-row.locked .day-title { color: var(--gray-soft); }
.day-row .info { display: flex; align-items: center; gap: 18px; }
.day-num {
  position: relative;
  z-index: 1;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 600; font-size: 16px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--gray);
  flex-shrink: 0;
}
.day-num.active { border-color: var(--violet); color: var(--violet); background: var(--violet-soft); }
.day-num.valide { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-title { font-weight: 600; font-size: 16px; }
.day-sub { font-size: 13.5px; color: var(--gray); margin-top: 2px; }

.progress-bar-outer {
  height: 6px;
  background: var(--violet-soft);
  border-radius: 4px;
  overflow: hidden;
  margin: 18px 0 8px;
}
.progress-bar-inner {
  height: 100%;
  background: var(--violet);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ---------- Quiz ---------- */
.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.quiz-progress .count { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--gray); }
.quiz-dots { display: flex; gap: 6px; }
.quiz-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.quiz-dot.done { background: var(--violet); }
.quiz-dot.current { background: var(--ink); }

.question-block { animation: fadeSlide 0.25s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option-row:hover { border-color: var(--gray-soft); }
.option-row.selected { border-color: var(--violet); background: var(--violet-soft); }
.option-row input { width: auto; margin: 0; accent-color: var(--violet); }
.option-letter {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gray);
}
.option-row.selected .option-letter { border-color: var(--violet); color: var(--violet); }

.quiz-nav { display: flex; justify-content: space-between; margin-top: 28px; }

.result-hero { text-align: center; padding: 40px 0 24px; }
.result-hero .score {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.result-hero .score.pass { color: var(--violet); }
.result-hero .label { color: var(--gray); font-size: 15px; margin-top: 6px; }

.correction-item {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 16px;
  margin-bottom: 22px;
}
.correction-item.correct { border-color: var(--green); }
.correction-item.incorrect { border-color: var(--red); }
.correction-item .c-q { font-weight: 600; margin-bottom: 4px; }
.explication { color: var(--gray); font-size: 14px; margin-top: 6px; }

/* ---------- Tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--gray); font-weight: 600; font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.stat-card { background: #fff; padding: 18px; text-align: center; }
.stat-card .num { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--ink); }
.stat-card .label { font-size: 12px; color: var(--gray); margin-top: 4px; }

.hidden { display: none !important; }
.top-actions { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.link-plain { color: var(--gray); text-decoration: none; }
.link-plain:hover { color: var(--ink); }

.objectifs-list, .tp-list { padding-left: 20px; margin: 0; }
.objectifs-list li, .tp-list li { margin-bottom: 8px; color: #2b2b33; }

/* ---------- Landing page ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 48px;
  max-width: 1100px;
  margin: 0 auto;
}
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 48px 90px;
}
.hero-kicker { color: var(--violet); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.hero h1 {
  font-size: 52px;
  line-height: 1.05;
  max-width: 14ch;
  margin-bottom: 22px;
}
.hero .lede { font-size: 19px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; align-items: center; }
.hero-facts { display: flex; gap: 36px; margin-top: 56px; flex-wrap: wrap; }
.hero-fact .num { font-family: var(--display); font-size: 30px; font-weight: 700; }
.hero-fact .label { font-size: 13px; color: var(--gray); }

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 48px;
  border-top: 1px solid var(--border);
}
.section h2 { font-size: 26px; margin-bottom: 8px; }
.section .lede { margin-bottom: 40px; }

.landing-sequence { max-width: 640px; }

.footer-cta {
  text-align: center;
  padding: 90px 24px;
  border-top: 1px solid var(--border);
}
.footer-cta h2 { font-size: 28px; }

@media (max-width: 680px) {
  .topbar, .nav { padding: 16px 20px; }
  .hero, .section { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 36px; max-width: none; }
  .container { padding: 32px 18px 72px; }
}
