/*
 * One scale of tokens, declared once. The page is deliberately self-contained: it is served outside
 * the web application, so borrowing that application's stylesheet would tie an external tool to the
 * game's own screens.
 */
:root {
  --fond: #12161c;
  --fond-bloc: #1b2129;
  --trait: #2d3742;
  --texte: #e7ecf2;
  --texte-faible: #9fb0c0;
  --accent: #4da3ff;
  --ok: #57c98a;
  --attention: #e8b84b;
  --erreur: #ff7b72;
  --rayon: 6px;
  --espace: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: var(--espace);
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

main {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 22px;
}

h2,
legend {
  font-size: 17px;
  margin: 0 0 var(--espace);
}

.intro,
.aide {
  color: var(--texte-faible);
  font-size: 13px;
}

section,
fieldset {
  margin: var(--espace) 0;
  padding: var(--espace);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond-bloc);
}

fieldset:disabled {
  opacity: 0.55;
}

/*
 * An author `display` beats the browser's own `[hidden]` rule whatever the specificity, so a hidden
 * row would keep the `display: flex` below and stay on screen. Declared before it, and once.
 */
[hidden] {
  display: none !important;
}

.champ,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 var(--espace);
}

.champ > label {
  flex: 0 0 130px;
  font-weight: 600;
}

.champ.case > label {
  flex: 0 1 auto;
  font-weight: 400;
}

/* max-width, not width: the control stays full width on a narrow screen. */
input,
select {
  flex: 1 1 220px;
  max-width: 420px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond);
  color: var(--texte);
  font: inherit;
}

input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 22px;
}

.aide {
  flex: 1 1 100%;
}

button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--rayon);
  background: var(--accent);
  color: #06121f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  border-color: var(--trait);
  background: var(--trait);
  color: var(--texte-faible);
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.statut:empty {
  display: none;
}

.statut {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--fond);
  font-size: 14px;
}

.journal {
  max-height: 45vh;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond);
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 13px;
}

.entree {
  white-space: pre-wrap;
}

.entree.info {
  color: var(--texte-faible);
}

.entree.ok {
  color: var(--ok);
}

.entree.warn {
  color: var(--attention);
}

.entree.error {
  color: var(--erreur);
}

.bilan {
  margin: var(--espace) 0 0;
  font-weight: 600;
}

.journal:empty::after {
  content: "Aucun envoi : connecter le client, puis rapporter une lecture.";
  color: var(--texte-faible);
  font-family: inherit;
}

@media (max-width: 480px) {
  .champ > label {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    animation: none;
    transition: none;
  }
}
