/* VISTO BAT — charte Visto : noir #141313, rouge #EE1C41, gris #8A8384 / #D6CFD0 / #E2DEDF */
@font-face { font-family: "Archivo"; src: url(fonts/archivo-wdth.woff2) format("woff2-variations"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --noir: #141313; --rouge: #EE1C41; --rouge-fonce: #C9112F; --gris: #8A8384; --filet: #D6CFD0;
  --fond: #E2DEDF; --gris-noir: #CFC9CA; --blanc: #fff; --vert: #1E7F4F; --vert-fond: #E3F2EA;
  --rouge-fond: #FDE6EA; --attente-fond: #EEEAEB;
  --r: 0 18px 0 18px; --r-s: 0 12px 0 12px;
  --titre: "Archivo", "Arial Narrow", Arial, sans-serif;
  --texte: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--noir); font: 400 15px/1.55 var(--texte); }
a { color: var(--noir); }
img { max-width: 100%; }
.mono { font-family: var(--mono); }
.muted { color: var(--gris); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* En-tête */
.topbar { background: var(--noir); border-bottom: 4px solid var(--rouge); color: #fff; }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar-in.wide, .wrap.wide { max-width: 1320px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.logo { height: 38px; width: auto; display: block; }
.wordmark { font: 800 24px/1 var(--titre); font-stretch: 88%; letter-spacing: 1px; color: #fff; }
.brand-sub { font: 600 13px/1 var(--mono); color: var(--gris-noir); border-left: 1px solid #3a3637; padding-left: 12px; letter-spacing: 1px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--gris-noir); text-decoration: none; padding: 7px 12px; border-radius: var(--r-s); font-weight: 500; }
.nav a:hover { color: #fff; background: #262323; }
.nav a.on { color: #fff; background: var(--rouge); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--gris-noir); font-size: 14px; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--gris-noir); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { color: #fff; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.foot { text-align: center; color: var(--gris); font-size: 12px; padding: 0 16px 28px; }

h1, h2, h3 { font-family: var(--titre); font-stretch: 88%; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
.kicker { font: 500 12px/1 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--rouge); margin-bottom: 8px; }

.card { background: #fff; border-radius: var(--r); padding: 22px; margin-bottom: 18px; }
.card.tight { padding: 16px 18px; }
.card > :last-child { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } h1 { font-size: 25px; } .card { padding: 18px 16px; } }

.info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; background: var(--fond); border-radius: var(--r-s); padding: 14px 16px; font-size: 14px; margin: 0 0 16px; }
.info dt { font-weight: 600; }
.info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .info { grid-template-columns: 1fr; } .info dd { margin-bottom: 6px; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--noir); background: #fff; color: var(--noir); font: 600 15px/1.2 var(--texte); padding: 11px 18px; border-radius: var(--r-s); cursor: pointer; text-decoration: none; min-height: 46px; }
.btn:hover { background: var(--noir); color: #fff; }
.btn-red { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-red:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
.btn-dark { background: var(--noir); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }

/* Formulaires */
label.lbl, .lbl { display: block; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--gris); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; font: 400 16px/1.4 var(--texte); padding: 11px 12px; border: 1px solid var(--gris); border-radius: 6px; background: #fff; color: var(--noir);
}
input.mono { font-family: var(--mono); }
textarea { min-height: 96px; resize: vertical; }
input[type=file] { font: inherit; max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--rouge); }

.flash { padding: 12px 16px; border-radius: var(--r-s); margin-bottom: 18px; font-weight: 500; }
.flash-ok { background: var(--vert-fond); color: var(--vert); }
.flash-err { background: var(--rouge-fond); color: #9b0d25; }
.flash-warn { background: #FFF4D6; color: #7a5600; }
.err-box { background: var(--rouge-fond); border-left: 4px solid var(--rouge); padding: 12px 14px; margin-bottom: 16px; border-radius: 4px; }

/* Statuts */
.pill { display: inline-block; font: 600 12px/1 var(--texte); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.st-wait { background: var(--attente-fond); color: var(--noir); border: 1px solid var(--filet); }
.st-ok { background: var(--vert-fond); color: var(--vert); }
.st-ko { background: var(--rouge-fond); color: #B00D2C; }
.st-old { background: #f4f2f2; color: var(--gris); }

/* Tableaux */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: var(--r-s); background: #fff; font-weight: 500; font-size: 14px; }
.tabs a.on { background: var(--noir); color: #fff; }
.tabs .count { font-family: var(--mono); color: var(--gris); margin-left: 4px; }
.tabs a.on .count { color: var(--gris-noir); }
.tblwrap { overflow-x: auto; background: #fff; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 600 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .8px; color: var(--gris); padding: 14px 14px 10px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #efebec; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.rowlink { cursor: pointer; }
.tbl tr.rowlink:hover td { background: #faf8f8; }
.tbl .ref a { font-family: var(--mono); font-weight: 500; text-decoration: none; }
.empty { padding: 28px; text-align: center; color: var(--gris); }

/* Lien client */
.copyrow { display: flex; gap: 8px; }
.copyrow input { font-family: var(--mono); font-size: 13px; }
@media (max-width: 560px) { .copyrow { flex-direction: column; } }

/* Versions */
.version { border-top: 1px solid var(--filet); padding-top: 16px; margin-top: 16px; }
.version:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.vhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.vnum { font: 800 20px/1 var(--titre); font-stretch: 88%; }
.files { list-style: none; padding: 0; margin: 8px 0 0; }
.files li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--filet); font-size: 14px; }
.files li:last-child { border-bottom: 0; }
.files .sz { color: var(--gris); font-family: var(--mono); font-size: 12px; margin-left: auto; white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 6px 0 6px 16px; border-left: 2px solid var(--filet); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--gris); }
.timeline li.t-decision::before { background: var(--rouge); }
.timeline time { font-family: var(--mono); color: var(--gris); font-size: 12px; margin-right: 6px; }

/* Visionneuse PDF */
.pv { background: #fff; border-radius: var(--r); margin-bottom: 18px; }
.pv-bar { position: sticky; top: 0; z-index: 5; border-radius: 0 18px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--noir); color: #fff; }
.pv-bar .btn { min-height: 38px; padding: 6px 12px; font-size: 14px; border-color: #fff; }
.pv-bar .btn:not(.btn-red) { background: transparent; color: #fff; }
.pv-bar .btn:not(.btn-red):hover { background: #fff; color: var(--noir); }
.pv-bar .sm { display: none; }
.pv-zoom { font: 500 13px/1 var(--mono); min-width: 44px; text-align: center; color: var(--gris-noir); }
.pv-hint { flex-basis: 100%; font-size: 13px; color: #fff; background: var(--rouge); margin: 4px -12px -10px; padding: 8px 12px; }
.pv-scroll { overflow: auto; background: #5d5859; padding: 14px 14px 34px; max-height: 78vh; border-radius: 0 0 0 18px; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) { .pv-scroll { max-height: none; } }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 34px; margin: 0 auto; }
.pv-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); flex: none; }
.pv-page canvas { display: block; }
.pv-overlay { position: absolute; inset: 0; }
.pv.placing .pv-overlay { cursor: crosshair; touch-action: none; background: rgba(238, 28, 65, .04); }
.pv-pageno { position: absolute; right: 8px; bottom: -22px; font: 500 11px/1 var(--mono); color: #e7e2e3; }
.pv-rect { position: absolute; border: 2px solid var(--rouge); background: rgba(238, 28, 65, .10); pointer-events: none; }
.pv-badge { position: absolute; transform: translate(-50%, -50%); min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px 14px 14px 2px; background: var(--rouge); color: #fff; font: 600 13px/28px var(--mono); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; border: 2px solid #fff; }
.pv-badge.flash { animation: pvflash 1s ease 2; }
@keyframes pvflash { 50% { transform: translate(-50%, -50%) scale(1.5); } }
.pv-loading { color: #fff; padding: 40px; text-align: center; }

.annots { list-style: none; padding: 0; margin: 0; }
.annots li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #efebec; align-items: flex-start; }
.annots li:last-child { border-bottom: 0; }
.annots .num { flex: none; min-width: 28px; height: 28px; border-radius: 14px 14px 14px 2px; background: var(--rouge); color: #fff; font: 600 13px/28px var(--mono); text-align: center; cursor: pointer; border: 0; }
.annots .body { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; white-space: pre-wrap; }
.annots .pg { display: block; font: 500 11px/1.4 var(--mono); color: var(--gris); white-space: normal; }
.annots .acts { display: flex; gap: 6px; flex: none; }
.annots-empty { color: var(--gris); font-size: 14px; padding: 6px 0; }

/* Fenêtre de saisie d'une annotation */
.dlg-back { position: fixed; inset: 0; background: rgba(20, 19, 19, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
@media (min-width: 640px) { .dlg-back { align-items: center; } }
.dlg { background: #fff; border-radius: var(--r); padding: 20px; width: 100%; max-width: 480px; }
.dlg h3 { margin-bottom: 10px; }
.dlg .row { justify-content: flex-end; margin-top: 12px; }

/* Choix de la décision */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; border: 2px solid var(--filet); border-radius: var(--r-s); padding: 14px 14px 14px 46px; cursor: pointer; background: #fff; }
.choice input { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; accent-color: var(--rouge); margin: 0; }
.choice b { display: block; font-family: var(--titre); font-stretch: 88%; font-size: 18px; }
.choice span { font-size: 13px; color: var(--gris); }
.choice:has(input:checked) { border-color: var(--noir); box-shadow: inset 0 0 0 1px var(--noir); }
.choice.ok:has(input:checked) { border-color: var(--vert); box-shadow: inset 0 0 0 1px var(--vert); background: #F6FBF8; }
.choice.ko:has(input:checked) { border-color: var(--rouge); box-shadow: inset 0 0 0 1px var(--rouge); background: #FFF8F9; }
.dropzone { border: 2px dashed var(--gris); border-radius: var(--r-s); padding: 16px; text-align: center; background: #faf8f8; }
.dropzone.over { border-color: var(--rouge); background: #fff5f7; }
.dropzone input { margin-top: 8px; }
.picked { list-style: none; padding: 0; margin: 10px 0 0; text-align: left; font-size: 14px; }
.picked li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--filet); }

.status-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r); margin-bottom: 18px; }
.status-banner .ico { font-size: 28px; line-height: 1; }
.status-banner.ok { background: var(--vert-fond); color: var(--vert); }
.status-banner.ko { background: var(--rouge-fond); color: #9b0d25; }
.status-banner.wait { background: #fff; }
.status-banner.old { background: #fff; color: var(--gris); }
.status-banner .t { display: block; font-family: var(--titre); font-stretch: 88%; font-size: 19px; }

/* Fiche de preuve imprimable */
.proof { background: #fff; max-width: 820px; margin: 0 auto; padding: 32px; }
.proof h1 { font-size: 24px; }
.proof table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.proof th, .proof td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.proof th { width: 34%; font-weight: 600; }
.proof .hash { font-family: var(--mono); font-size: 11px; word-break: break-all; }
@media print {
  body { background: #fff; }
  .topbar, .foot, .noprint, .flash, .pv-bar, #answer { display: none !important; }
  .pv-scroll { max-height: none; overflow: visible; background: #fff; }
  .card, .pv { break-inside: avoid; }
  .wrap { padding: 0; max-width: none; }
  .proof { padding: 0; }
  .proof .phead { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.phead { background: var(--noir); border-bottom: 4px solid var(--rouge); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; color: var(--gris-noir); margin-bottom: 22px; font: 400 11px/1.5 var(--mono); }

/* Connexion / installation */
.narrow { max-width: 460px; margin: 30px auto; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; font-size: 14px; }
.checks li { padding: 4px 0; }
.checks .ok { color: var(--vert); font-weight: 600; }
.checks .ko { color: var(--rouge); font-weight: 600; }
@media (max-width: 560px) {
  .annots li { flex-wrap: wrap; }
  .annots .body { flex-basis: calc(100% - 40px); }
  .annots .acts { margin-left: 38px; }
  .pv-hint { font-size: 12px; padding: 6px 12px; }
  .pv-bar { gap: 6px; padding: 8px 10px; }
  .pv-bar .btn { padding: 6px 10px; }
  .pv-bar .lg { display: none; }
  .pv-bar .sm { display: inline; }
}
