/* Composants partagés (CSS simple, complète Tailwind CDN) */
:root { --ink: #0f1b2d; --amber: #f59e0b; }
h1, h2, h3, .font-display { font-family: 'Archivo', 'Inter', sans-serif; }

.btn-primary, .btn-dark, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: .75rem; padding: .7rem 1.1rem; font-weight: 600; font-size: .95rem;
  transition: transform .08s ease, background-color .15s ease, opacity .15s; cursor: pointer;
  min-height: 44px;
}
.btn-primary:active, .btn-dark:active, .btn-ghost:active, .btn-danger:active { transform: scale(.98); }
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: #fbbf24; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #21344f; }
.btn-ghost { background: transparent; color: #334155; border: 1px solid #cbd5e1; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
button:disabled { opacity: .5; cursor: not-allowed; }

.card { background: #fff; border-radius: 1rem; box-shadow: 0 1px 2px rgba(15,27,45,.06), 0 4px 16px rgba(15,27,45,.05); border: 1px solid #e2e8f0; }

.field { display: block; }
.field span { display: block; font-size: .85rem; font-weight: 600; color: #334155; margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: .7rem; padding: .7rem .85rem; font-size: 1rem;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.25); }

.nav-link { padding: .5rem .75rem; border-radius: .6rem; font-weight: 600; font-size: .92rem; color: #cbd5e1; white-space: nowrap; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: var(--ink); background: var(--amber); }
.mnav-link { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .55rem 0 .5rem; font-size: .7rem; font-weight: 600; }
.mnav-link.active { color: var(--amber); }
.mnav-link svg { width: 22px; height: 22px; }
/* En-tête : jamais de chevauchement (libellés courts sur écran moyen, textes tronqués plutôt que superposés) */
@media (min-width: 768px) and (max-width: 1023px) { .nav-link { padding: .45rem .55rem; font-size: .88rem; } }
.mnav-link { min-width: 0; }
.mnav-link span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 380px) { .mnav-link { font-size: .64rem; } .mnav-link svg { width: 20px; height: 20px; } }
@media (max-width: 340px) { .mnav-link { font-size: .58rem; } .mnav-link span { padding: 0; } }

.chip { border: 1px solid #cbd5e1; border-radius: 999px; padding: .45rem 1rem; font-weight: 600; font-size: .9rem; background: #fff; min-height: 40px; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.uv-card { text-align: left; border: 2px solid #e2e8f0; border-radius: 1rem; padding: .9rem 1rem; background: #fff; transition: border-color .15s, box-shadow .15s; }
.uv-card:hover { border-color: #94a3b8; }
.uv-card.active { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }

.opt { width: 100%; text-align: left; display: flex; gap: .8rem; align-items: flex-start; border: 2px solid #e2e8f0; border-radius: .9rem; padding: .85rem 1rem; background: #fff; transition: border-color .12s, background-color .12s; font-size: 1rem; line-height: 1.4; }
.opt:hover:not(:disabled) { border-color: #94a3b8; background: #f8fafc; }
.opt .letter { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .55rem; background: #f1f5f9; font-weight: 700; color: #334155; font-size: .9rem; }
.opt.selected { border-color: var(--ink); background: #f1f5f9; }
.opt.selected .letter { background: var(--ink); color: #fff; }
.opt.correct { border-color: #16a34a; background: #f0fdf4; }
.opt.correct .letter { background: #16a34a; color: #fff; }
.opt.wrong { border-color: #dc2626; background: #fef2f2; }
.opt.wrong .letter { background: #dc2626; color: #fff; }
.opt:disabled { cursor: default; }

.bar { height: .55rem; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; transition: width .4s ease; }

.qdot { width: 2.1rem; height: 2.1rem; border-radius: .5rem; font-size: .8rem; font-weight: 700; border: 1px solid #cbd5e1; background: #fff; color: #475569; }
.qdot.done { background: #e2e8f0; }
.qdot.current { outline: 3px solid var(--amber); outline-offset: 1px; }

.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.opt:disabled { opacity: 1; }
.opt:disabled:not(.correct):not(.wrong) { opacity: .55; }

/* SSIAP 1 : questions à cases à cocher (une ou plusieurs bonnes réponses) */
.opt-multi { align-items: center; }
.opt-multi .box { flex: none; width: 1.55rem; height: 1.55rem; border: 2px solid #94a3b8; border-radius: .4rem; background: #fff; display: grid; place-items: center; transition: background-color .12s, border-color .12s; }
.opt-multi.selected .box, .opt-multi.checked .box { background: var(--ink); border-color: var(--ink); }
.opt-multi.selected .box::after, .opt-multi.checked .box::after { content: "✓"; color: #fff; font-weight: 800; font-size: .95rem; line-height: 1; }
.opt-multi.correct.checked .box { background: #16a34a; border-color: #16a34a; }
.opt-multi.wrong.checked .box { background: #dc2626; border-color: #dc2626; }
.opt-multi .tag:empty { display: none; }
.opt-multi .tag { flex: none; border-radius: .4rem; padding: .1rem .45rem; font-size: .72rem; font-weight: 800; }
.opt-multi.correct .tag { background: #16a34a; color: #fff; }
.opt-multi.wrong .tag { background: #dc2626; color: #fff; }
.opt.missed { border-style: dashed; }
.opt-multi.missed .tag { background: #fff; color: #15803d; border: 1.5px solid #16a34a; }
