/* Protec Quiz — styles (identité Protection Civile : bleu, orange, bleu nuit). Mobile d'abord, barre latérale à partir de 900 px. */
:root {
  --pc-bleu: #03468c; --nuit: #0b2340; --nuit2: #13335c; --orange: #f28c00; --orange-fonce: #d97a00;
  --vert: #1e8e3e; --vert-clair: #e7f6ec; --rouge: #c62828; --rouge-clair: #fdecec; --jaune-clair: #fff4e0;
  --gris: #eef2f7; --gris2: #d8e0e8; --texte: #1b2733; --texte2: #5b6b7b; --fond: #f4f7fa; --rayon: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
a { color: var(--pc-bleu); }
.cache { display: none !important; }

/* Logo : le logo officiel est rond ; on le présente dans un disque blanc pour faire disparaître son fond carré (sans le modifier). */
.logo { border-radius: 50%; object-fit: cover; box-shadow: 0 2px 12px rgba(0,0,0,.30); }

/* Structure */
.app { min-height: 100%; display: flex; }
.lateral { display: none; }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.entete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: linear-gradient(135deg, var(--nuit) 0%, var(--nuit2) 100%); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.entete .logo { width: 34px; height: 34px; }
.marque { font-weight: 800; letter-spacing: .4px; font-size: 17px; }
.marque span { color: var(--orange); }
.marque .version { font-size: 11px; font-weight: 600; letter-spacing: 0; opacity: .75; }
.lateral .bas .version { margin-top: 6px; font-size: 11px; opacity: .8; }
.entete .titre { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .retour { background: none; border: 0; color: #fff; font-size: 22px; padding: 2px 8px 2px 0; cursor: pointer; }
.vue { flex: 1; padding: 16px; width: 100%; max-width: 980px; margin: 0 auto; padding-bottom: 90px; }
.nav-bas { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: #fff; border-top: 1px solid var(--gris2);
  padding-bottom: env(safe-area-inset-bottom); }
.nav-bas a { flex: 1; text-align: center; text-decoration: none; color: var(--texte2); font-size: 11px; padding: 8px 0 9px; }
.nav-bas a .ico { display: block; font-size: 20px; line-height: 1.2; }
.nav-bas a.actif { color: var(--orange); font-weight: 700; }

@media (min-width: 900px) {
  .lateral { display: flex; flex-direction: column; width: 250px; flex: none; background: linear-gradient(180deg, var(--nuit) 0%, #0e2c52 100%); color: #fff;
    position: sticky; top: 0; height: 100vh; padding: 16px 12px; }
  .lateral .haut { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
  .lateral .logo { width: 44px; height: 44px; }
  .lateral a { display: flex; align-items: center; gap: 10px; color: #dfe8f3; text-decoration: none; padding: 10px 12px; border-radius: 10px; margin: 2px 0; font-size: 15px; }
  .lateral a:hover { background: rgba(255,255,255,.08); }
  .lateral a.actif { background: var(--pc-bleu); color: #fff; font-weight: 700; }
  .lateral .section { margin: 18px 6px 6px; padding: 8px 10px; border-radius: 10px; background: var(--orange); color: #fff; font-weight: 700; font-size: 14px; }
  .lateral .bas { margin-top: auto; padding: 10px 6px; font-size: 13px; color: #b8c7d8; }
  .nav-bas { display: none; }
  .entete .logo, .entete .marque { display: none; }
  .vue { padding: 24px 28px; }
}

/* Éléments */
.carte { background: #fff; border-radius: var(--rayon); padding: 14px; box-shadow: 0 1px 4px rgba(11,35,64,.08); margin-bottom: 12px; }
.carte h2, .carte h3 { margin: 0 0 6px; color: var(--nuit); }
.carte h2 { font-size: 18px; } .carte h3 { font-size: 16px; }
.petit { font-size: 13px; color: var(--texte2); }
.grille { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille.deux { grid-template-columns: 1fr 1fr; } .grille.trois { grid-template-columns: repeat(3, 1fr); } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700;
  font-size: 15px; cursor: pointer; text-decoration: none; background: var(--gris); color: var(--nuit); }
.btn.plein { width: 100%; }
.btn.orange { background: var(--orange); color: #fff; } .btn.orange:hover { background: var(--orange-fonce); }
.btn.bleu { background: var(--pc-bleu); color: #fff; }
.btn.vert { background: var(--vert); color: #fff; }
.btn.rouge { background: var(--rouge); color: #fff; }
.btn.contour { background: #fff; border: 1px solid var(--gris2); }
.btn.petit-btn { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions .btn { flex: 1; min-width: 140px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 14px; }
input[type=text], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #c7d0da; border-radius: 10px; background: #fff; font-size: 16px; color: var(--texte); }
textarea { min-height: 90px; resize: vertical; }
.message { padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; background: #eaf2fc; color: var(--nuit); font-size: 14px; }
.message.erreur { background: var(--rouge-clair); color: #8a1c1c; }
.message.succes { background: var(--vert-clair); color: #17652f; border: 1px solid #9fd8ae; text-align: center; font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; vertical-align: middle; background: var(--gris); color: var(--texte2); }
.badge.actif { background: var(--vert-clair); color: var(--vert); } .badge.pause { background: var(--jaune-clair); color: #a35600; }
.badge.desactive, .badge.archive, .badge.retiree { background: #e9edf2; color: #66717d; } .badge.suspendue, .badge.alerte { background: var(--rouge-clair); color: var(--rouge); }
.barre { height: 8px; background: #e3e8ee; border-radius: 8px; overflow: hidden; margin: 8px 0 4px; }
.barre i { display: block; height: 100%; background: var(--vert); border-radius: 8px; transition: width .3s; }
.barre.bleue i { background: var(--pc-bleu); }
.barre.rouge i { background: var(--rouge); }
.chiffres { display: flex; gap: 10px; flex-wrap: wrap; }
.chiffre { flex: 1; min-width: 90px; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 4px rgba(11,35,64,.08); }
.chiffre b { display: block; font-size: 22px; color: var(--nuit); }
.chiffre span { font-size: 12px; color: var(--texte2); }
.repli > summary { cursor: pointer; font-weight: 700; color: var(--nuit); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary::after { content: '▾'; transition: transform .2s; }
.repli[open] > summary { margin-bottom: 10px; }
.repli[open] > summary::after { transform: rotate(180deg); }
.repli .repli { box-shadow: none; border: 1px solid #e3e8ee; margin-top: 10px; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.puce { border: 1px solid #cfd8e3; background: #fff; color: var(--nuit); border-radius: 20px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.puce.actif { background: var(--nuit); border-color: var(--nuit); color: #fff; font-weight: 600; }
th.triable { cursor: pointer; user-select: none; white-space: nowrap; }
th.triable .fleche { color: #b6c0cc; }
th.trie, th.trie .fleche { color: var(--nuit); }
.vide { text-align: center; color: var(--texte2); padding: 30px 10px; }
.chargement { text-align: center; padding: 40px; color: var(--texte2); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #e6ebf0; vertical-align: top; }
th { color: var(--texte2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.tableau { overflow-x: auto; }

/* Accueil */
.bonjour { background: linear-gradient(135deg, var(--pc-bleu) 0%, var(--nuit) 100%); color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px; }
.bonjour .logo { width: 56px; height: 56px; flex: none; }
.bonjour h1 { margin: 0; font-size: 21px; } .bonjour p { margin: 3px 0 0; opacity: .85; font-size: 14px; }
.quiz-carte { display: flex; gap: 12px; align-items: flex-start; }
.pastille { width: 46px; height: 46px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 19px; }
.quiz-carte .corps { flex: 1; min-width: 0; }

/* Jeu */
.progression-jeu { display: flex; justify-content: space-between; font-size: 13px; color: var(--texte2); gap: 10px; flex-wrap: wrap; }
.score-direct { font-weight: 700; color: var(--vert); }
.enonce { font-size: 19px; font-weight: 700; color: var(--nuit); line-height: 1.35; margin: 10px 0 6px; white-space: pre-wrap; }
.theme { display: inline-block; font-size: 12px; font-weight: 600; color: var(--pc-bleu); background: #e8f0fa; border-radius: 20px; padding: 2px 10px; }
.prop { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--gris2); border-radius: 14px;
  padding: 13px; margin-top: 9px; font-size: 16px; cursor: pointer; color: var(--texte); }
.prop .lettre { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #b9c4cf; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.prop.choisie { border-color: var(--pc-bleu); background: #eef4fb; } .prop.choisie .lettre { background: var(--pc-bleu); border-color: var(--pc-bleu); color: #fff; }
.prop.bonne { border-color: var(--vert); background: var(--vert-clair); } .prop.bonne .lettre { background: var(--vert); border-color: var(--vert); color: #fff; }
.prop.fausse { border-color: var(--rouge); background: var(--rouge-clair); } .prop.fausse .lettre { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.prop:disabled { cursor: default; }
/* choix multiples : cases CARRÉES (convention des cases à cocher) ; ronds = une seule réponse */
.prop.case .lettre { border-radius: 6px; }
/* pagination de la banque de questions */
.pagination { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pagination .pages { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pagination .page { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; border: 1.5px solid var(--gris2); background: #fff; font-weight: 700; cursor: pointer; color: var(--nuit); }
.pagination .page.actuelle { background: var(--pc-bleu); border-color: var(--pc-bleu); color: #fff; }
.pagination .page:disabled:not(.actuelle) { opacity: .35; cursor: default; }
.pagination select, .pagination input { padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--gris2); width: auto; margin: 0; }
.prop.case.bonne:not(.cochee) .lettre { background: #fff; color: var(--vert); } /* correction : bonne case oubliée = carré vide */
.consigne-multiple { font-size: 14px; font-weight: 700; color: var(--pc-bleu); background: #eef4fb; border-radius: 10px; padding: 8px 12px; margin: 4px 0 10px; }
/* textes longs (questions, réponses, explications) : retour à la ligne propre, jamais de débordement */
.prop > span:last-child { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.enonce, .carte, .message, td { overflow-wrap: anywhere; }
.bandeau { border-radius: 12px; padding: 12px 14px; font-weight: 800; color: #fff; margin-top: 4px; }
.bandeau.ok { background: var(--vert); } .bandeau.ko { background: var(--rouge); } .bandeau.neutre { background: var(--pc-bleu); }
.lien-discret { background: none; border: 0; color: var(--texte2); font-size: 13px; cursor: pointer; padding: 10px; display: block; margin: 8px auto 0; text-decoration: underline; }
.anneau { width: 130px; height: 130px; border-radius: 50%; margin: 6px auto 12px; display: flex; align-items: center; justify-content: center; }
.anneau div { width: 104px; height: 104px; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anneau strong { font-size: 27px; color: var(--nuit); }

/* Connexion */
.ecran-connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 30% 10%, #1d4e86 0%, var(--nuit) 60%); }
.boite-connexion { width: min(94vw, 420px); color: #fff; }
.boite-connexion .logo { width: 104px; height: 104px; display: block; margin: 0 auto 14px; }
.boite-connexion h1 { text-align: center; margin: 0; font-size: 34px; } .boite-connexion h1 span { color: var(--orange); }
.boite-connexion .sous { text-align: center; opacity: .85; margin: 4px 0 24px; }
.boite-connexion .carte { color: var(--texte); }
.boite-connexion .note { text-align: center; font-size: 12px; opacity: .8; margin-top: 14px; }
.logo-37 { display: block; margin: 22px auto 0; max-width: 260px; width: 80%; background: #fff; border-radius: 10px; padding: 8px 12px; }

/* Bandeau de mise à jour de l'application */
.maj { position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 9; background: var(--nuit); color: #fff; border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.maj span { flex: 1; font-size: 14px; }
@media (min-width: 900px) { .maj { left: auto; right: 20px; bottom: 20px; width: 380px; } }
td.mots { overflow-wrap: normal; word-break: normal; min-width: 90px; }
