/* La seule feuille de style de l'app : aucune police, image ni ressource
   venue d'ailleurs (docs/SECURITE.md, § 3). Pensée d'abord pour le téléphone
   (3c, séance 3) : une colonne, des cibles d'au moins 44 pixels sous le doigt,
   des textes de 16 pixels au moins (le téléphone ne zoome pas dans un champ),
   aucun défilement de côté ; un écran plus large garde la même colonne. */

:root {
  --fond: #fbfaf7;
  --texte: #1f1d1a;
  --discret: #6b665e;
  --accent: #2f5d50;
  --alerte-fond: #fbeaea;
  --alerte-texte: #7a1f1f;
  --note-fond: #eef3f1;
  --bord: #d9d4ca;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1b1a18;
    --texte: #ece8e1;
    --discret: #a39d92;
    --accent: #8fc3b2;
    --alerte-fond: #3b2222;
    --alerte-texte: #f2c4c4;
    --note-fond: #233029;
    --bord: #3a3732;
  }
}

* { box-sizing: border-box; }

html { font-size: 100%; }

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

.entete {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bord);
}

.nom-app {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

a { color: var(--accent); }

.sorties {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.sorties form { margin: 0; }

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 { font-size: 1.5rem; margin-top: 0.5rem; }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }

.formulaire {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label { font-weight: 600; }
label.case { font-weight: normal; }

input, textarea, button {
  font: inherit;
  color: inherit;
}

input[type="password"], input:not([type]), input[type="text"], textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--bord);
  border-radius: 0.4rem;
  background: transparent;
}

button {
  align-self: flex-start;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--fond);
  cursor: pointer;
}

button.discret {
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--discret);
  border: 1px solid var(--bord);
}

.alerte {
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  background: var(--alerte-fond);
  color: var(--alerte-texte);
}

/* Les avertissements de Mickael (D15). */
.avertissements {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  border: 1px solid var(--alerte-texte);
  background: var(--alerte-fond);
}

.avertissements h2 {
  margin-top: 0;
  color: var(--alerte-texte);
}

.note {
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  background: var(--note-fond);
}

.liste { padding-left: 1.2rem; }

.lien-donne { overflow-wrap: anywhere; }

/* La page d'une question, sa réponse et son rapport (3b) ; la mise en page des renvois vient en 3c. */
.question {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reponse p, .verifiee p { overflow-wrap: anywhere; }

.renvois, .code { color: var(--discret); font-size: 0.9rem; }

.verifiee {
  margin: 1rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bord);
}

/* L'historique commun (3c) : chaque question, avec sa réponse, comme sur sa page. */
.historique {
  margin: 0;
  padding: 0;
  list-style: none;
}

.historique .element {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bord);
}

.historique .note { display: block; }

/* Le geste sur un renvoi (3c) : fermé, il suit le texte de l'affirmation ; ouvert, le message cité vient dessous. */
.affirmation { margin: 1rem 0; overflow-wrap: anywhere; }
.affirmation > p, .affirmation > details.renvoi { display: inline; margin: 0; }
.affirmation > details.renvoi[open] { display: block; margin-top: 0.5rem; }

details.renvoi > summary {
  display: inline;
  list-style: none;
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline dotted;
}

details.renvoi > summary::-webkit-details-marker { display: none; }

.message {
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--bord);
}

.message blockquote {
  margin: 0.5rem 0;
  white-space: pre-line;
}

.message .traduction { margin: 0.5rem 0 0; }

/* L'original, à un geste (3c). */
details.original { margin: 0.5rem 0; }
details.original > summary { color: var(--accent); cursor: pointer; }

/* D16 : la question à reposer ou à annuler, en évidence. */
.choix {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  border: 1px solid var(--accent);
  background: var(--note-fond);
}

.choix h2 { margin-top: 0; }

.boutons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.boutons form, .boutons p { margin: 0; }

/* Le téléphone d'abord (3c, séance 3). */
main { overflow-wrap: anywhere; }

nav a {
  display: inline-block;
  padding: 0.6rem 0;
  min-height: 2.75rem;
}

button {
  min-height: 2.75rem;
  touch-action: manipulation;
}

button.discret { min-height: 2.75rem; padding: 0.5rem 0.9rem; }

button:disabled { opacity: 0.5; cursor: default; }

details > summary {
  padding: 0.5rem 0;
  min-height: 2.75rem;
}

/* Une cible de 44 pixels sous le doigt, comme les boutons (vérification complète de la 3c, ES-7 : en ligne, le geste
   faisait 36 pixels, et min-height ne s'applique pas à un élément en ligne). */
details.renvoi > summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.1rem;
  vertical-align: middle;
}

.formes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.formes > p { margin: 0; }

.formes a[download] {
  display: inline-block;
  padding: 0.6rem 0;
}

textarea { font-size: 1rem; }

@media (min-width: 40rem) {
  .entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
  }

  .nom-app { margin: 0; }
  .sorties { margin-top: 0; }
}

/* La page d'un profil (3d-2, séance 3) : les deux profils, puis les sections à cocher, une par ligne, chacune une cible
   de 44 pixels sous le doigt. */
nav.profils { margin: 0 0 1rem; }
nav.profils a[aria-current="page"] { font-weight: 600; text-decoration: none; color: var(--texte); }

.sections-du-profil fieldset,
.signaler fieldset {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bord);
  border-radius: 0.4rem;
}

.sections-du-profil label,
.signaler fieldset label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
}

.sections-du-profil input[type="checkbox"] { width: 1.25rem; height: 1.25rem; flex: none; }

/* « Signaler une erreur » (D22, 3e, séance 2) : les genres et les phrases visées, une par ligne, comme les sections d'un
   profil ; une phrase longue passe à la ligne. La note sur la réponse, discrète mais lisible. */
.signaler input[type="radio"] { width: 1.25rem; height: 1.25rem; flex: none; }
.signaler fieldset label { align-items: flex-start; padding: 0.35rem 0; overflow-wrap: anywhere; }
ul.signalements { list-style: none; margin: 0.5rem 0; padding: 0; }
