/* student/exam.css

   Passage d'un test : chronomètre, questions, lecteur audio, enregistreur de l'examen.

   Chargé par index.html, dans l'ordre de css/README.md. Ne pas changer cet
   ordre sans relire la section « Ordre de chargement ». */

/* ---------- exam runner ---------- */

.exam {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.timer-rail { height: 4px; background: var(--surface); flex: 0 0 auto; }

.timer-fill { height: 100%; width: 100%; background: var(--primary); transition: width .25s linear; }

.timer-fill.warn { background: var(--primary); }

.timer-fill.critical { background: var(--red); }

.exam-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 24px 30px 0;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.exam-progress { font-size: var(--fs-2); color: var(--muted); }

.exam-clock {
  font-size: var(--fs-9);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.exam-clock.warn { color: var(--primary); }

.exam-clock.critical { color: var(--red); }

.exam-body {
  flex: 1;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 30px;
}

.exam-foot {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding: 0 30px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- examen blanc : la section entière sur un écran ---------- */

.paper-q {
  padding-top: 26px;
  margin-top: 26px;
  border-top: 1px solid var(--border);
}

.paper-q:first-of-type { border-top: none; }

.paper-q-num { font-size: var(--fs-1); color: var(--muted); margin: 0 0 8px; }

.paper-count { font-size: var(--fs-2); color: var(--muted); }

.passage {
  font-family: var(--serif);
  font-size: var(--fs-6);
  line-height: 1.75;
  white-space: pre-wrap;
  max-width: 64ch;
}

.passage-small {
  font-family: var(--serif);
  font-size: var(--fs-4);
  line-height: 1.65;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  margin-bottom: 24px;
  max-height: 210px;
  overflow-y: auto;
  color: var(--muted);
}

.q-prompt { font-size: var(--fs-7); font-weight: 600; margin: 10px 0 24px; line-height: 1.4; }

.choices { display: grid; gap: 10px; }

.choice {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  font-size: var(--fs-5);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  width: 100%;
  font-family: var(--sans);
}

.choice:hover { border-color: var(--muted); }

.choice.picked { border-color: var(--primary); }

.choice .key {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--muted);
}

.choice.picked .key { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.text-answer {
  width: 100%;
  padding: 15px 18px;
  font-size: var(--fs-5);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
}

.text-answer:focus { border-color: var(--primary); outline: none; }

@media (max-width: 640px) {
  .exam-clock { font-size: var(--fs-8); }
  .passage { font-size: var(--fs-5); }
  .q-prompt { font-size: var(--fs-6); }
}

/* ---------- lecteur de test ---------- */

.player {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 22px;
  margin-bottom: 26px;
}

.play-btn {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-5);
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.play-btn:disabled, .play-btn.spent {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

.player-body { flex: 1; min-width: 0; }

.player-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.player-line span:last-child { font-variant-numeric: tabular-nums; }

.player-rail { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }

.player-fill { height: 100%; width: 0%; background: var(--primary); transition: width .2s linear; }

.stim-image { max-width: 100%; border-radius: var(--r); margin-bottom: 26px; display: block; }

.stim-video { width: 100%; border-radius: var(--r); margin-bottom: 26px; display: block; }

@media (max-width: 640px) {
  .exam-foot .btn { width: 100%; }
  .player { padding: 16px; gap: 14px; }
  .play-btn { width: 48px; height: 48px; }
}

/* ---------- copies à corriger ---------- */

.answer-block {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 10px 0 0;
  font-size: var(--fs-3);
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
}

/* ---------- enregistrement vocal ---------- */

.recorder {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 22px;
}

.recorder .play-btn { color: var(--red); background: var(--surface); border-color: var(--border); }

.recorder .play-btn:hover { border-color: var(--red); }
