/* ASNAY — fondations communes (office et application).
 *
 * Couleurs relevées sur le logo (2026-10-18) :
 *   prune  #480A2F  texte de marque, en-têtes, actions principales
 *   rouge  #E82921  accent de marque (filets, état actif) — JAMAIS seul
 *                   pour signifier une erreur : les erreurs ont leur libellé
 *   bleu   #96B1CE  informations, éléments secondaires
 * Le rouge plein sert peu : sur un formulaire de contrôle, il se confondrait
 * avec « non conforme ».
 */

@font-face { font-family: 'Saira'; font-weight: 600; font-display: swap; src: url('/assets/fonts/saira-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Saira'; font-weight: 700; font-display: swap; src: url('/assets/fonts/saira-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  --prune: #480a2f;
  --prune-900: #2e061e;
  --prune-700: #5e1440;
  --prune-100: #f3e7ee;
  --rouge: #e82921;
  --rouge-ombre: #b31a15;
  --bleu: #96b1ce;
  --bleu-100: #e8eef6;
  --bleu-700: #3d5f86;

  --fond: #f8f5f7;
  --surface: #ffffff;
  --bord: #e4dce1;
  --bord-fort: #cbbfc6;
  --texte: #24141d;
  --texte-doux: #6b5a64;

  --ok: #1f7a4d;
  --ok-fond: #e5f4ec;
  --att: #8a5a00;
  --att-fond: #fdf2dc;
  --ko: #b31a15;
  --ko-fond: #fbe6e5;

  --rayon: 10px;
  --ombre: 0 1px 2px rgba(46, 6, 30, .06), 0 4px 16px rgba(46, 6, 30, .06);
  --titre: 'Saira', 'Segoe UI', system-ui, sans-serif;
  --corps: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* L'attribut hidden doit gagner contre tout display posé par une classe. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 15px/1.5 var(--corps);
}
h1, h2, h3 { font-family: var(--titre); font-weight: 700; color: var(--prune); margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--prune-700); }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .9em; }

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

/* ---------- Champs ---------- */
.champ { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.champ label { font-weight: 600; font-size: .9rem; }
.champ .aide { font-size: .82rem; color: var(--texte-doux); margin: 0; }
input, select, textarea {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--bord-fort);
  border-radius: 8px;
  padding: .65rem .75rem;
  min-height: 44px; /* cible tactile */
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--prune-700); outline: none; box-shadow: 0 0 0 3px var(--prune-100); }
textarea { min-height: 90px; resize: vertical; }
.prefixe { display: flex; align-items: stretch; }
.prefixe input { border-radius: 8px 0 0 8px; }
.prefixe span { display: flex; align-items: center; padding: 0 .75rem; background: var(--prune-100); border: 1px solid var(--bord-fort); border-left: 0; border-radius: 0 8px 8px 0; color: var(--texte-doux); white-space: nowrap; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem;
  font: 600 .95rem var(--corps);
  border-radius: 8px; border: 1px solid var(--bord-fort);
  background: var(--surface); color: var(--prune);
  cursor: pointer; text-decoration: none;
}
.bouton:hover { border-color: var(--prune-700); }
.bouton:disabled { opacity: .55; cursor: not-allowed; }
.bouton--plein { background: var(--prune); border-color: var(--prune); color: #fff; }
.bouton--plein:hover { background: var(--prune-700); }
.bouton--danger { color: var(--ko); border-color: #e7b5b3; }
.bouton--danger:hover { background: var(--ko-fond); border-color: var(--ko); }
.bouton--large { width: 100%; }
.bouton--discret { border-color: transparent; background: transparent; }

/* ---------- Messages, pastilles, toasts ---------- */
.message { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.message--erreur { background: var(--ko-fond); color: var(--ko); border: 1px solid #efc4c2; }
.message--info { background: var(--bleu-100); color: var(--bleu-700); border: 1px solid #cfdcec; }

.statut { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.statut--ok { background: var(--ok-fond); color: var(--ok); }
.statut--att { background: var(--att-fond); color: var(--att); }
.statut--ko { background: var(--ko-fond); color: var(--ko); }
.statut--neutre { background: #eee8ec; color: var(--texte-doux); }
.statut--info { background: var(--bleu-100); color: var(--bleu-700); }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: .8rem 1.1rem; border-radius: 10px;
  background: var(--prune-900); color: #fff; box-shadow: var(--ombre); z-index: 100;
  pointer-events: none;
}
.toast--erreur { background: var(--ko); }

/* ---------- Écran d'authentification ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth__boite { width: 100%; max-width: 420px; background: var(--surface); border-radius: 14px; box-shadow: var(--ombre); padding: 2rem 1.75rem; border-top: 4px solid var(--rouge); }
.auth__logo { display: block; width: 150px; height: auto; margin: 0 auto 1.25rem; }
.auth__sous-titre { text-align: center; color: var(--texte-doux); font-size: .9rem; margin-top: -.75rem; margin-bottom: 1.5rem; letter-spacing: .04em; text-transform: uppercase; }
.qr { display: flex; justify-content: center; margin: .75rem 0; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Consolas, monospace; text-align: center; background: var(--fond); border-radius: 8px; padding: .6rem; word-break: break-all; margin-bottom: 1rem; }
.code-input { font-size: 1.5rem; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
