/* QCM Accessibilité Web · styles partagés */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --ink: #15202b;
  --muted: #5b6b7c;
  --brand: #0a6b52;
  --brand-dark: #064d3b;
  --accent: #c45c26;
  --ok: #1b7f4e;
  --ko: #b42318;
  --border: #d7e0e8;
  --focus: #0b57d0;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(21, 32, 43, 0.08);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.12), transparent 40%),
    radial-gradient(circle at top right, rgba(196, 92, 38, 0.10), transparent 35%),
    var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--brand-dark); }

.wrap {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

h1 {
  margin: 0.2rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.meta {
  color: var(--muted);
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.module-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f8fbfa);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.module-link:hover,
.module-link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand);
  outline: none;
}

.module-link span {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.progress {
  color: var(--muted);
  font-size: 0.95rem;
}

.score-live {
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: #eef7f2;
  border: 1px solid #c6e4d4;
  display: none;
}

.score-live.show { display: block; }

.score-live__main {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.score-live__main strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
}

.score-live__pct {
  color: var(--muted);
  font-size: 0.95rem;
}

.score-live__sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.question-stage {
  min-height: 12rem;
}

.question {
  margin-bottom: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fcfefe;
}

.question h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
}

.choices {
  display: grid;
  gap: 0.5rem;
}

label.choice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}

label.choice:hover {
  border-color: #9db7aa;
}

label.choice:has(input:disabled) {
  cursor: default;
}

label.choice:focus-within {
  outline: 3px solid color-mix(in srgb, var(--focus) 40%, white);
  outline-offset: 1px;
}

label.choice.is-correct {
  border-color: var(--ok);
  background: #edf8f1;
}

label.choice.is-wrong {
  border-color: var(--ko);
  background: #fff2f1;
}

.feedback {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f0f4f8;
  color: var(--ink);
  display: none;
}

.feedback.show { display: block; }

.feedback.is-ok {
  background: #edf8f1;
  border: 1px solid #b7dfc6;
}

.feedback.is-ko {
  background: #fff2f1;
  border: 1px solid #f0c2bc;
}

.summary-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.summary-list .is-ok { color: var(--ok); }
.summary-list .is-ko { color: var(--ko); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

button,
.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button[hidden] {
  display: none !important;
}

button.primary,
.btn.primary {
  background: var(--brand);
  color: #fff;
}

button.primary:hover:not(:disabled),
.btn.primary:hover {
  background: var(--brand-dark);
}

button.secondary,
.btn.secondary {
  background: #e7eef3;
  color: var(--ink);
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.score {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: #eef7f2;
  border: 1px solid #c6e4d4;
  display: none;
}

.score.show { display: block; }

.score strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.3rem;
}

.nav-back {
  margin-bottom: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.code-block {
  margin: 0 0 1rem;
  border: 1px solid #c5d0da;
  border-radius: 10px;
  overflow: hidden;
  background: #15202b;
  color: #e8eef4;
}

.code-block__label {
  margin: 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9fb3c4;
  background: #1c2a38;
  border-bottom: 1px solid #2a3b4d;
}

.code-block pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre;
}

.code-block code {
  font-family: inherit;
  color: inherit;
}

.choice-code {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: #15202b;
  color: #e8eef4;
  overflow-x: auto;
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre;
}

.choice-code--inline {
  max-width: 100%;
}

label.choice:has(.choice-code) {
  align-items: flex-start;
}


.multi-hint {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #c5d4f0;
  color: #243447;
  font-size: 0.95rem;
}

.choice-letter {
  flex: 0 0 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e7eef3;
  font-weight: 700;
  font-size: 0.8rem;
  color: #314356;
}

label.choice.is-missed {
  border-color: #c45c26;
  background: #fff8ef;
  border-style: dashed;
}
