/* Styles propres aux pages : connexion/activation, utilisateurs, paramètres, classements, journal, mot de passe.
   Les couleurs viennent des variables de style.css (valeurs de repli ci-dessous). Aucun style en ligne, rayons <= 4px. */
:root { --pg-line: var(--line, #d9dfe8); --pg-muted: var(--muted, #5d6b7e); --pg-ink: var(--ink, #14202e); --pg-acc: var(--blue, #1e7b4f); --pg-red: var(--red, #b3261e); --pg-soft: #f6f7f9; }

/* ---------- connexion / activation ---------- */
body.auth { background: #fff; }
.auth-wrap { min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 400px; background: #fff; padding: 8px 4px; animation: pg-in .22s ease-out both; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 22px; }
.auth-logo { width: 84px; height: 84px; object-fit: contain; }
.auth-brand b { display: block; font-size: 15px; letter-spacing: .04em; }
.auth-brand small { display: block; color: var(--pg-muted); font-size: 12px; margin-top: 2px; }
.auth-card h1 { font-size: 21px; text-align: center; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--pg-muted); margin: 0 0 22px; font-size: 14px; }
.auth-card .form-actions { margin-top: 18px; }
.auth-card .block-btn { width: 100%; }
.auth-foot { text-align: center; color: var(--pg-muted); font-size: 12px; margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--pg-line); }
.linkbtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; background: none; border: 0; padding: 14px 8px 4px; color: var(--pg-acc); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- éléments communs ---------- */
.pg-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.pg-bar .grow { flex: 1 1 220px; max-width: 360px; }
.pg-bar input[type=search] { width: 100%; }
.pg-note { color: var(--pg-muted); font-size: 14px; margin: 0 0 14px; max-width: 78ch; }
.pg-callout { border: 1px solid var(--pg-line); background: var(--pg-soft); border-radius: 3px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }
.pg-panel { border: 1px solid var(--pg-line); border-radius: 3px; background: #fff; padding: 16px; margin: 0 0 16px; }
.pg-panel h2, .pg-panel h3 { margin: 0 0 10px; font-size: 16px; }
.pg-panel .form-actions, .pg-panel .pg-actions { margin-top: 14px; }
.pg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pg-form { max-width: 520px; }
.pg-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.pg-check input { margin-top: 3px; }

.pg-seg { display: inline-flex; border: 1px solid var(--pg-line); border-radius: 3px; overflow: hidden; background: #fff; max-width: 100%; overflow-x: auto; }
.pg-seg button { background: #fff; color: var(--pg-ink); border: 0; border-right: 1px solid var(--pg-line); border-radius: 0; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background-color .15s; }
.pg-seg button:last-child { border-right: 0; }
.pg-seg button[aria-pressed=true], .pg-seg button[aria-selected=true] { background: var(--pg-ink); color: #fff; }

.pg-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--pg-line); margin: 0 0 18px; overflow-x: auto; }
.pg-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; padding: 10px 14px; font: inherit; font-size: 14px; color: var(--pg-muted); cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s; }
.pg-tabs button[aria-selected=true] { color: var(--pg-ink); border-bottom-color: var(--pg-ink); font-weight: 600; }

/* ---------- tableaux ---------- */
.pg-tablewrap { border: 1px solid var(--pg-line); border-radius: 3px; background: #fff; overflow-x: auto; margin: 0 0 16px; animation: pg-in .2s ease-out both; }
.pg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pg-table th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--pg-muted); background: var(--pg-soft); padding: 9px 12px; border-bottom: 1px solid var(--pg-line); white-space: nowrap; }
.pg-table td { padding: 10px 12px; border-bottom: 1px solid var(--pg-line); vertical-align: middle; }
.pg-table tbody tr:last-child td { border-bottom: 0; }
.pg-table tbody tr { transition: background-color .15s; }
.pg-table .num, .pg-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pg-table .c, .pg-table th.c { text-align: center; }
.pg-table small { display: block; color: var(--pg-muted); font-size: 12px; }
.pg-table tr.me td { background: #f1f6f3; }
.pg-table select { padding: 5px 8px; font-size: 14px; min-width: 130px; }
.pg-row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.pg-ib { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; gap: 6px; background: #fff; color: var(--pg-ink); border: 1px solid var(--pg-line); border-radius: 3px; font: inherit; font-size: 13px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.pg-ib.danger { color: var(--pg-red); }
.pg-ib:focus-visible { outline: 2px solid var(--pg-acc); outline-offset: 1px; }
.pg-matrix td.c input { width: 18px; height: 18px; accent-color: var(--pg-acc); cursor: pointer; }
.pg-matrix td:first-child { min-width: 200px; }
.pg-state { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pg-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pg-muted); }
.pg-state.ok::before { background: var(--green, #1b7f46); }
.pg-state.wait::before { background: var(--amber, #b26a00); }
.pg-state.off::before { background: var(--pg-red); }

/* ---------- classements ---------- */
.pg-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin: 0 0 18px; max-width: 640px; }
.pg-pod { border: 1px solid var(--pg-line); border-radius: 3px; background: #fff; padding: 12px 10px; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; animation: pg-in .25s ease-out both; }
.pg-pod .rk { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-pod .nm { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pg-pod .vl { font-size: 13px; color: var(--pg-muted); }
.pg-pod.r1 { min-height: 150px; border-color: var(--pg-ink); }
.pg-pod.r2 { min-height: 124px; }
.pg-pod.r3 { min-height: 104px; }
.pg-me { border: 1px solid var(--pg-line); background: var(--pg-soft); border-radius: 3px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
.pg-me b { font-variant-numeric: tabular-nums; }
.pg-rank { width: 44px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--pg-muted); }
.pg-meter { display: block; width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 2px; background: #e8ebf0; overflow: hidden; }
.pg-meter::-webkit-progress-bar { background: #e8ebf0; border-radius: 2px; }
.pg-meter::-webkit-progress-value { background: var(--pg-ink); border-radius: 2px; transition: width .25s; }
.pg-meter::-moz-progress-bar { background: var(--pg-ink); border-radius: 2px; }
.pg-meter.ok::-webkit-progress-value { background: var(--green, #1b7f46); }
.pg-meter.ok::-moz-progress-bar { background: var(--green, #1b7f46); }
.pg-goal { display: grid; gap: 4px; min-width: 150px; font-size: 13px; }

@keyframes pg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
  .pg-grid2 { grid-template-columns: 1fr; }
  .pg-podium { gap: 8px; }
  .pg-pod { padding: 10px 6px; }
  /* tableaux empilés : une fiche par ligne */
  .pg-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pg-stack, .pg-stack tbody, .pg-stack tr, .pg-stack td { display: block; width: 100%; }
  .pg-stack tr { border-bottom: 1px solid var(--pg-line); padding: 8px 0; }
  .pg-stack tbody tr:last-child { border-bottom: 0; }
  .pg-stack td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .pg-stack td::before { content: attr(data-l); color: var(--pg-muted); font-size: 12px; text-align: left; flex: none; }
  .pg-stack td.nolabel::before { content: none; }
  .pg-stack td.num { text-align: right; }
  .pg-stack .pg-row-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .pg-tablewrap, .pg-pod { animation: none; }
  .pg-seg button, .pg-tabs button, .pg-ib, .pg-table tbody tr, .pg-meter::-webkit-progress-value { transition: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pg-table th.plain { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--pg-ink); background: transparent; border-bottom: 1px solid var(--pg-line); }
.pg-matrix tbody tr:last-child th.plain { border-bottom: 0; }
h2.pg-h { font-size: 16px; margin: 22px 0 10px; }
.pg-panel h2:not(:first-child) { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--pg-line); }

/* ---------- photos de profil ---------- */
.av { flex: none; display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; background: #e8edf3; color: #1f3a5f; font-weight: 650; overflow: hidden; }
.av-sm { width: 24px; height: 24px; font-size: 10px; }
.av-md { width: 34px; height: 34px; font-size: 13px; }
.av-lg { width: 64px; height: 64px; font-size: 22px; }
.av-xl { width: 96px; height: 96px; font-size: 30px; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell small { display: block; }
.pg-pod .av { margin: 0 auto 4px; }
.photo-ctl { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.photo-actions small { flex-basis: 100%; color: #5b6573; }
.photo-box { margin-bottom: 16px; }


/* ---------- survol réservé aux pointeurs précis (souris) : pas de :hover collant au toucher ---------- */
@media (hover: hover) {
  .linkbtn:hover { text-decoration-thickness: 2px; }
  .pg-seg button:hover { background: var(--pg-soft); }
  .pg-tabs button:hover { color: var(--pg-ink); }
  .pg-table tbody tr:hover { background: #fafbfc; }
  .pg-ib:hover { background: var(--pg-soft); border-color: #b8c0cc; }
}

/* ---------- tactile : cibles >= 44 px, champs >= 16 px (placé en fin de fichier pour l'emporter sur les règles ci-dessus) ---------- */
@media (pointer: coarse), (max-width: 1100px) { .pg-table select, .pg-form input, .pg-form select { font-size: 16px; } }
@media (pointer: coarse), (max-width: 900px) {
  .pg-ib { min-width: 44px; height: 44px; }
  .pg-table select { min-height: 44px; }
  .pg-seg button, .pg-tabs button { min-height: 44px; }
  .linkbtn { min-height: 44px; }
  .pg-table td a { display: inline-flex; align-items: center; min-height: 44px; }
  .pg-check { align-items: center; min-height: 44px; }
  .pg-matrix td.c { padding: 0; }
  .pg-matrix td.c input { width: 24px; height: 24px; }
  .pg-row-actions { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .pg-panel { padding: 14px; }
  .pg-bar .grow { max-width: none; flex-basis: 100%; }
  .pg-bar .pg-seg { width: 100%; }
  .pg-seg button { flex: 1; padding-left: 8px; padding-right: 8px; }
  .pg-podium { max-width: none; }
  .pg-table select { min-width: 0; width: 100%; }
}
@media (hover: none) { .pg-ib:active { background: var(--pg-soft); } }

/* Liste déroulante du domaine d'infraction (pages Graphiques et Domaines d'infraction) */
.dom-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-weight: 600; }
.dom-pick select { min-width: min(100%, 360px); max-width: 100%; }
