/* Identité STI Maintenance (bleu, sobre, technique). Contrastes WCAG 2.1 AA, mobile-first dès 320 px.
   Le gris de marque #798995 (3,6:1) n'est jamais utilisé pour du petit texte : --muted le remplace. */
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/source-sans-3-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }
:root {
  --ink: #0f1a24;
  --muted: #45545f;
  --bg: #edf0f2;
  --card: #ffffff;
  --line: #c9d1d8;
  --steel: #1a73ae;       /* bleu primaire STI */
  --steel-dark: #042438;  /* bleu profond STI */
  --navy: #1d306f;
  --accent: #1a73ae;
  --teal: #4a746f;        /* vert STI */
  --danger: #b42318;      /* hors palette STI : réservé aux alertes et aux actions destructives */
  --ok: #1b6e3c;
  --focus: #1d4ed8;
  --radius: 5px;
  --s1: #b42318; --s2: #c2410c; --s3: #a16207; --s4: #3f7d3a; --s5: #1b6e3c;
  font-size: 17px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
h1, h2, h3 { color: var(--navy); font-weight: 600; line-height: 1.15; }
h1 { font-size: 1.75rem; margin: 0 0 .75rem; }
h2 { font-size: 1.3rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .75rem; }
a { color: var(--steel); }
code { background: #e6e9ed; padding: .1rem .35rem; border-radius: 3px; word-break: break-all; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 62rem; margin: 0 auto; padding: 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--steel); color: #fff; padding: .75rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-header { background: #fff; color: var(--ink); border-bottom: 4px solid var(--steel); box-shadow: 0 1px 0 var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: 1rem; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--navy); }
.logo { display: block; height: 2.1rem; width: auto; max-width: 70vw; }
.admin-nav { display: flex; gap: 1rem; align-items: center; }
.admin-nav a, .link-btn { color: var(--steel); background: none; border: 0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; padding: .5rem; border-radius: var(--radius); }
.admin-nav a:hover, .link-btn:hover { text-decoration: underline; }
main { padding-top: 1rem; padding-bottom: 3rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1rem; margin-bottom: 1rem; }
.card.narrow { max-width: 34rem; margin-left: auto; margin-right: auto; }
.card.danger { border-color: var(--danger); }
.notice { border-left: 4px solid var(--accent); background: #e8f1f8; padding: .75rem 1rem; margin: 1rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.warning-box { border: 2px solid var(--danger); background: #fdecea; padding: .75rem 1rem; border-radius: 4px; margin: 1rem 0; }
.warning-box h2 { margin-top: 0; color: var(--danger); }
.flash { padding: .75rem 1rem; border-radius: 4px; border: 1px solid; margin: 0 0 1rem; }
.flash-ok { background: #e8f5ec; border-color: var(--ok); }
.flash-error { background: #fdecea; border-color: var(--danger); }
.error { color: var(--danger); font-weight: 600; }

label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
input, select, textarea { width: 100%; font: inherit; padding: .7rem .75rem; border: 2px solid #7b8794; border-radius: 4px; background: #fff; color: var(--ink); min-height: 3rem; }
textarea { min-height: 7rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.5rem; height: 1.5rem; min-height: 0; flex: none; margin: .15rem 0 0; accent-color: var(--steel); }
.code-input { font-size: 1.6rem; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.check { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400; margin: 1rem 0; }
fieldset { border: 1px solid var(--line); border-radius: 4px; padding: .5rem 1rem; margin: 1rem 0; }
legend { font-weight: 600; padding: 0 .35rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: .6rem 1.25rem; font: inherit; font-weight: 600; text-decoration: none; background: #fff; color: var(--steel); border: 2px solid var(--steel); border-radius: 4px; cursor: pointer; }
.btn:hover { background: #e6ecf2; }
.btn-primary { background: var(--steel); color: #fff; }
.btn-primary:hover { background: var(--steel-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-small { min-height: 2.5rem; padding: .3rem .75rem; font-size: .9rem; }
.btn-block { display: flex; width: 100%; margin-top: 1.25rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
form.inline { display: inline; margin: 0; }

/* questionnaire */
progress { width: 100%; height: 1rem; accent-color: var(--accent); }
.kicker { color: var(--muted); font-weight: 600; margin: .75rem 0 0; }
.question-text { font-size: 1.25rem; margin: .5rem 0; }
.evidence { background: #eef3f8; border-left: 4px solid var(--steel); padding: .6rem .8rem; font-style: italic; }
.scale { border: 0; padding: 0; margin: 1rem 0; }
.choice { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400; margin: .5rem 0; padding: .8rem; min-height: 3.5rem; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; }
.choice:hover { border-color: var(--steel); }
.choice:has(input:checked) { border-color: var(--steel); background: #e6ecf2; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice .num { font-weight: 700; font-size: 1.25rem; width: 1.5rem; flex: none; }
.choice strong { display: block; }
.choice small { color: var(--muted); font-size: .9rem; }
.nav-row { display: flex; gap: .75rem; margin-top: 1rem; }
.nav-row .btn { flex: 1; }
.save-status { min-height: 1.5rem; color: var(--ok); font-size: .9rem; }
.save-status.error { color: var(--danger); }
.counter { text-align: right; color: var(--muted); font-size: .85rem; }

.review-dim h2 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: .25rem; }
.review-list { list-style: none; padding: 0; margin: 0; }
.review-list li { display: flex; flex-direction: column; gap: .35rem; padding: .6rem 0; border-bottom: 1px dotted var(--line); }
.review-a { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* scores */
.score-pill { display: inline-block; min-width: 2.2rem; text-align: center; padding: .1rem .55rem; border-radius: 99px; color: #fff; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); } .s4 { background: var(--s4); } .s5 { background: var(--s5); }
.score-block { text-align: center; margin: .5rem 0 1rem; }
.score-number { font-size: 3.5rem; font-weight: 800; line-height: 1; margin: 0; color: var(--steel); }
.score-max { font-size: 1.25rem; font-weight: 400; color: var(--muted); }
.score-level { font-size: 1.4rem; margin: .25rem 0; }
.chart-box { position: relative; max-width: 32rem; margin: 0 auto 1rem; }
.rank { padding-left: 1.5rem; }
.rank li { margin: .35rem 0; }
.two-col { display: grid; gap: 1rem; }
.plain { list-style: none; padding: 0; }
.plain li { padding: .5rem 0; border-bottom: 1px dotted var(--line); display: flex; gap: .75rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }

/* tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { background: #e6e9ed; }
.table .num { text-align: right; white-space: nowrap; }
.table tbody th { font-weight: 600; }
.dist { display: block; width: 12rem; height: 1.1rem; }
.dist rect.s1 { fill: var(--s1); } .dist rect.s2 { fill: var(--s2); } .dist rect.s3 { fill: var(--s3); } .dist rect.s4 { fill: var(--s4); } .dist rect.s5 { fill: var(--s5); }
.dist rect { background: none; }

/* animateur */
.session-head { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; }
.qr { background: #fff; border: 1px solid var(--line); padding: .5rem; max-width: 100%; height: auto; }
.code-label { margin: 0; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.code-big { font-family: ui-monospace, Consolas, monospace; font-size: 2.5rem; font-weight: 800; letter-spacing: .2em; margin: 0 0 .5rem; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 99px; font-size: .85rem; font-weight: 700; border: 2px solid var(--steel); }
.badge-open { background: #e8f5ec; border-color: var(--ok); color: var(--ok); }
.badge-published { background: var(--steel); color: #fff; }
.badge-archived { border-color: var(--muted); color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .75rem; text-align: center; }
.tile p { margin: 0; }
.tile-n { font-size: 2rem; font-weight: 800; color: var(--steel); }
.grid-form { display: grid; gap: .5rem 1rem; }
.statements { padding-left: 1.2rem; }
.statements li { margin: .75rem 0; }
.legend { font-size: .85rem; }

/* projection */
body.projection { background: var(--steel-dark); color: #fff; }
.projection a { color: #fff; }
.projection .muted { color: #c7d0da; }
.projection main { max-width: 90rem; padding-top: .5rem; }
.proj-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; opacity: .85; }
.proj-bar select { width: auto; min-height: 2.5rem; padding: .3rem; }
.projection .btn { background: transparent; color: #fff; border-color: #c7d0da; }
.projection .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.projection .btn:hover { background: rgba(255,255,255,.12); }
.lobby { text-align: center; padding: 1rem 0; }
.lobby h1 { font-size: 2.5rem; }
.lobby-sub { font-size: 1.5rem; color: #c7d0da; }
.lobby-row { display: flex; gap: 3rem; justify-content: center; align-items: center; flex-wrap: wrap; text-align: left; }
.code-huge { font-family: ui-monospace, Consolas, monospace; font-size: 5rem; font-weight: 800; letter-spacing: .2em; margin: 0; }
.join-url { font-size: 1.5rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.pcard { background: #fff; color: var(--ink); border-radius: 8px; padding: 1.25rem 1.5rem; }
.pcard h2 { margin-top: 0; color: var(--steel); }
.pcard .big, .discussion .big { font-size: 4.5rem; font-weight: 800; line-height: 1; margin: 0; color: var(--steel); }
.pcard .level { font-size: 1.75rem; font-weight: 700; margin-top: .5rem; }
.pcard .rank { font-size: 1.25rem; }
.discuss { background: #eef3f8; border-left: 6px solid var(--accent); padding: .5rem 1rem; margin-top: 1rem; font-size: 1.1rem; }
.discussion { background: #fff; color: var(--ink); border-radius: 8px; padding: 1.25rem 1.5rem; }
.discussion .btn { background: #fff; color: var(--steel); border-color: var(--steel); }
.discussion .btn-primary { background: var(--steel); color: #fff; }
.discussion .muted { color: var(--muted); }
.discussion a { color: var(--steel); }
.d-grid { display: grid; gap: 1.5rem; }
.d-q { margin: .5rem 0; }

/* rapport imprimable */
body.report { background: #fff; }
.report-top { display: grid; gap: 1rem; align-items: center; }

@media (min-width: 40rem) {
  h1 { font-size: 1.9rem; }
  .card { padding: 1.5rem; }
  .two-col, .d-grid { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .review-list li { flex-direction: row; justify-content: space-between; }
  .review-q { flex: 1; }
  .grid-form { grid-template-columns: 1fr 1fr; align-items: end; }
  .grid-form fieldset, .grid-form button { grid-column: auto; }
  .report-top { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 64rem) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .pcard.wide { grid-column: span 2; }
}
@media print {
  .no-print, .proj-bar { display: none !important; }
  body, body.report { background: #fff; }
  .card { border: 0; padding: 0; }
  .report-page { break-inside: avoid-page; }
  .table tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: background .12s; } }

/* mode discussion : distributions grand format */
#d-dist .dist { width: 100%; height: 2rem; margin: .25rem 0 1rem; }
.lobby-sub { margin-bottom: 1.5rem; }

/* identité : logo sur fond blanc (le texte gris du logo manque de contraste sur fond sombre) */
.logo-chip { display: inline-block; background: #fff; padding: .6rem 1.25rem; border-radius: var(--radius); margin: 0 0 1.25rem; }
.logo-chip .logo { height: 3rem; }
.report-logo { height: 2.5rem; margin-bottom: 1rem; }
.projection h1 { color: #fff; }
.btn { border-radius: var(--radius); }
.btn-primary:hover { background: var(--steel-dark); border-color: var(--steel-dark); }
.projection .btn-primary:hover { background: #155d8c; border-color: #155d8c; }
.score-number, .tile-n, .pcard .big, .discussion .big { color: var(--navy); }
.projection .pcard .muted, .projection .discussion .muted { color: var(--muted); }

/* pages live (PowerPoint) : s'adaptent au cadre, fond blanc ou ?theme=dark */
body.live { margin: 0; background: #fff; color: var(--ink); overflow: hidden; }
body.live.dark { background: var(--steel-dark); color: #fff; }
.live-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 3vmin; text-align: center; }
.live-block { max-width: 100%; }
.live-h { font-size: clamp(1.6rem, 7vmin, 4rem); margin: 0 0 2vmin; color: var(--navy); }
.live-big { font-size: clamp(3.5rem, 28vmin, 16rem); font-weight: 700; line-height: 1; margin: 0; color: var(--navy); }
.live-of { font-size: .3em; font-weight: 400; color: var(--muted); }
.live-level { font-size: clamp(1.6rem, 8vmin, 4.5rem); font-weight: 600; margin: 1vmin 0; color: var(--steel); }
.live-sub { font-size: clamp(1.1rem, 4vmin, 2.2rem); color: var(--muted); margin: 1vmin 0; }
.live-msg { font-size: clamp(1.3rem, 5vmin, 2.6rem); color: var(--muted); }
.live-rank { text-align: left; font-size: clamp(1.2rem, 5.5vmin, 3rem); padding-left: 1.4em; margin: 0 auto; max-width: 90vw; }
.live-rank li { margin: 1.4vmin 0; }
.live-chart { width: min(96vw, 94vh); }
.live-q { margin: 2vmin auto; max-width: 90vw; text-align: left; }
.live-qtext { font-size: clamp(1rem, 3.4vmin, 1.8rem); margin: 0 0 .5vmin; }
.live-q .dist { width: 100%; height: clamp(1.4rem, 5vmin, 3rem); }
.live-dist { font-size: clamp(.9rem, 3vmin, 1.5rem); color: var(--muted); }
.live-qr { display: flex; gap: 4vmin; align-items: center; justify-content: center; flex-wrap: wrap; }
.live-qr img { width: min(40vh, 40vw); height: auto; background: #fff; padding: .5rem; }
.live-label { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: clamp(.9rem, 3vmin, 1.4rem); }
.live-code { font-family: ui-monospace, Consolas, monospace; font-size: clamp(2.5rem, 14vmin, 8rem); font-weight: 700; letter-spacing: .15em; margin: 0; color: var(--navy); }
.live-url { font-size: clamp(1rem, 4vmin, 2rem); margin: 0; }
.live.dark .live-h, .live.dark .live-big, .live.dark .live-code { color: #fff; }
.live.dark .live-level { color: #8cc4ea; }
.live.dark .live-sub, .live.dark .live-msg, .live.dark .live-dist, .live.dark .live-label, .live.dark .live-of { color: #c7d0da; }
