:root {
  --rouge: #a3282b;
  --noir: #14171c;
  --fond: #f4f5f7;
  --trait: #e2e4e8;
  --texte: #1c1f24;
  --vert: #2e7d32;
  --vert-fond: #eaf6ec;
  --rouge-fond: #fbeaea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  background: var(--fond);
  color: var(--texte);
}

.topbar {
  background: var(--noir);
  color: #fff;
  padding: 22px 24px;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  letter-spacing: .04em;
}

.brand span { color: var(--rouge); margin: 0 2px; }
.brand small { font-size: .6rem; letter-spacing: .25em; color: #9aa0a8; margin-left: 6px; }

.brand-sub { color: #a9adb4; font-size: .88rem; margin-top: 6px; }

.view { max-width: 640px; margin: 36px auto; padding: 0 16px 60px; }

.card {
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 30px;
}

h1 { font-family: Georgia, serif; margin-top: 0; }
h2 { font-size: 1.2rem; line-height: 1.4; margin: 4px 0 20px; }

.intro { color: #545b64; font-size: .92rem; }

form label { display: block; margin: 18px 0; font-size: .9rem; font-weight: 600; }
form input {
  width: 100%;
  padding: 11px 13px;
  margin-top: 7px;
  border: 1px solid var(--trait);
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 400;
}
form input:focus { outline: 2px solid var(--rouge); outline-offset: 1px; }

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 7px;
  border: 1px solid var(--trait);
  background: #fff;
  color: var(--texte);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  margin-top: 6px;
  margin-right: 8px;
}
.btn:hover { filter: brightness(0.97); }
.btn-primaire { background: var(--rouge); color: #fff; border-color: var(--rouge); }

.progress { color: #6b7280; font-size: .82rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }

.options { display: grid; gap: 10px; margin: 0 0 20px; }

.option {
  text-align: left;
  padding: 13px 16px;
  border: 1px solid var(--trait);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: .95rem;
  transition: border-color .15s;
}
.option:hover:not(:disabled) { border-color: var(--rouge); }
.option:disabled { cursor: default; }
.option.is-correct { border-color: var(--vert); background: var(--vert-fond); font-weight: 600; }
.option.is-wrong { border-color: var(--rouge); background: var(--rouge-fond); }

.score { color: #6b7280; font-size: .88rem; font-weight: 600; }

.feedback { margin-top: 20px; padding: 16px 18px; border-radius: 9px; }
.feedback.is-correct { background: var(--vert-fond); }
.feedback.is-wrong { background: var(--rouge-fond); }
.feedback p:first-child { font-weight: 700; margin-top: 0; }
.feedback .explication { color: #4b5563; font-size: .88rem; margin-bottom: 14px; }

.score-final { font-size: 2.6rem; font-weight: 700; color: var(--rouge); margin: 4px 0 12px; }

.table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.table th {
  text-align: left; padding: 8px 10px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: #6b7280; border-bottom: 2px solid var(--trait);
}
.table td { padding: 10px; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.table tr:first-child td { font-weight: 700; }

.loading { text-align: center; color: #6b7280; padding: 60px 0; }
.error-msg { color: var(--rouge); font-size: .88rem; margin-top: 10px; }

@media (prefers-color-scheme: dark) {
  body { background: #101215; color: #e8e9eb; }
  .card { background: #181b20; border-color: #2a2e35; }
  .btn { background: #181b20; color: #e8e9eb; border-color: #2a2e35; }
  .option { background: #181b20; border-color: #2a2e35; color: #e8e9eb; }
  form input { background: #101215; border-color: #2a2e35; color: #e8e9eb; }
  .table th, .table td { border-color: #2a2e35; }
}
