/* ===========================================================================
   La Brig'ads — socle visuel commun local et figé

   Adaptation auditée du cockpit Restaurant. Aucun import externe, aucune
   dépendance de production. Les composants métier vivent dans
   hebergement.css ; les substitutions de couleur dans theme-hebergement.css.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/instrument-sans-var.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --famille-texte: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --famille-titre: "Bricolage Grotesque", "Instrument Sans", sans-serif;

  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 24px;
  --e-6: 32px;
  --e-7: 48px;
  --e-8: 64px;

  --t-xs: .75rem;
  --t-s: .875rem;
  --t-m: 1rem;
  --t-l: 1.125rem;
  --t-xl: 1.375rem;
  --t-2xl: clamp(1.9rem, 4vw, 3rem);

  --rayon-s: 9px;
  --rayon: 13px;
  --rayon-l: 16px;
  --hauteur-barre: 68px;
  --largeur-rail: 236px;
  --gouttiere-repere: 82px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-masse: cubic-bezier(.32, .72, 0, 1);
  --duree: 180ms;

  /* Compatibilité avec les rendus métier historiques, sans conserver leur DA. */
  --papier: var(--surface);
  --papier-bureau: var(--fond);
  --papier-double: var(--surface-douce);
  --papier-creux: #F8FAFB;
  --encre: var(--texte);
  --encre-douce: var(--texte-doux);
  --crayon: #71838C;
  --filet: var(--bord);
  --filet-fort: var(--bord-fort);
  --tampon: var(--ko);
  --tampon-lavis: var(--ko-lavis);
  --visa: var(--ok);
  --visa-lavis: var(--ok-lavis);
  --releve: var(--ombre);
  --releve-haut: var(--ombre-haute);
  --duree-visa: 220ms;
  --sortie: var(--ease-out);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--famille-texte);
  font-size: var(--t-m);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  color: var(--marine-nuit);
  font-family: var(--famille-titre);
  line-height: 1.12;
  letter-spacing: -.025em;
  text-wrap: balance;
}

a { color: var(--marine); text-underline-offset: .18em; }
a:hover { color: var(--marine-fonce); }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--bord-fort);
  border-radius: var(--rayon-s);
  background: var(--surface);
  color: var(--texte);
  padding: 9px 12px;
  line-height: 1.4;
  transition: border-color var(--duree) ease, box-shadow var(--duree) ease;
}

textarea { min-height: 112px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #657882; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--marine); }

:focus-visible {
  outline: 3px solid var(--jaune);
  outline-offset: 3px;
  border-radius: var(--rayon-s);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  border-color: var(--marine);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, .48);
}

[hidden] { display: none !important; }

.hors-ecran {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.evitement {
  position: fixed;
  z-index: 300;
  top: 10px;
  left: 12px;
  padding: 11px 16px;
  border-radius: var(--rayon-s);
  background: var(--marine-nuit);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--duree) var(--ease-out);
}
.evitement:focus { transform: none; }

.imprime {
  color: var(--texte-doux);
  font-size: var(--t-xs);
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1.35;
  text-transform: uppercase;
}
.imprime--s { font-size: var(--t-s); }
.chiffre { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.prose { max-width: 70ch; }

/* Identité reprise du cockpit Restaurant. */
.identite {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.identite__pique { width: 38px; height: 38px; flex: none; }
.identite__mot {
  font-family: var(--famille-titre);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
.identite__mot em { color: var(--jaune); font-style: normal; }
.identite__verticale {
  display: block;
  margin-top: 4px;
  color: currentColor;
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .16em;
  opacity: .68;
  text-transform: uppercase;
}

.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--marine);
  border-radius: var(--rayon-s);
  background: var(--marine);
  color: #fff;
  padding: 9px 16px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  transition: background var(--duree) ease, border-color var(--duree) ease,
              transform var(--duree) var(--ease-out), opacity var(--duree) ease;
}
.bouton:hover { background: var(--marine-fonce); border-color: var(--marine-fonce); color: #fff; }
.bouton:active { transform: scale(.98); }
.bouton--discret { background: transparent; color: var(--marine); border-color: var(--bord-fort); box-shadow: none; }
.bouton--discret:hover { background: var(--marine-lavis); color: var(--marine-fonce); border-color: var(--marine); }
.bouton--texte { background: transparent; border-color: transparent; color: var(--marine); box-shadow: none; text-decoration: underline; }
.bouton[disabled], .bouton[aria-disabled="true"] { opacity: .48; cursor: not-allowed; transform: none; }
.bouton[aria-busy="true"] { opacity: .68; cursor: progress; }

.mention {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-douce);
  color: var(--texte-doux);
  padding: 3px 9px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.mention--pilote { background: #FFF2CD; color: #684B00; }
.mention--fiction { background: var(--ko-lavis); color: var(--ko); }
.mention--indisponible { background: #E9EDF0; color: #55656D; }

/* Retour de geste : même logique que les toasts Restaurant. */
.accuses,
#toasts {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: calc(var(--hauteur-barre) + env(safe-area-inset-bottom) + 16px);
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.accuse,
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 10px;
  background: rgba(6, 36, 44, .96);
  color: #fff;
  padding: 12px 16px;
  font-size: .9rem;
  font-weight: 650;
  box-shadow: 0 8px 30px rgba(6, 36, 44, .30);
  animation: toast-arrive .3s var(--ease-out) both;
}
.toast.erreur { background: #7E211D; }
.toast.part { animation: toast-part .3s ease forwards; }
@keyframes toast-arrive { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-part { to { opacity: 0; transform: translateY(8px); } }

.ossature,
.squelette {
  display: block;
  border-radius: 7px;
  background: linear-gradient(100deg, #E8EEF1 38%, #F8FAFB 50%, #E8EEF1 62%);
  background-size: 220% 100%;
  animation: miroite 1.25s linear infinite;
}
.ossature { height: .78em; }
.ossature--court { width: 34%; }
.ossature--moyen { width: 62%; }
.ossature--long { width: 88%; }
.squelette { min-height: 96px; }
@keyframes miroite { to { background-position: -220% 0; } }

.confirmation {
  width: min(34rem, calc(100vw - 32px));
  max-width: none;
  border: 0;
  border-radius: var(--rayon-l);
  background: var(--surface);
  color: var(--texte);
  padding: 0;
  box-shadow: 0 24px 70px rgba(6, 36, 44, .30);
}
.confirmation::backdrop { background: rgba(6, 36, 44, .62); }
.confirmation__corps { padding: 24px; }
.confirmation__titre { margin-bottom: 16px; font-size: 1.45rem; }
.confirmation__liste li { padding: 10px 0; border-bottom: 1px solid var(--bord); font-size: .9rem; }
.confirmation__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--bord);
  border-radius: 0 0 var(--rayon-l) var(--rayon-l);
  background: var(--surface-douce);
  padding: 16px 24px;
}

.installation-app[hidden] { display: none !important; }
.installation-app {
  position: fixed;
  z-index: 110;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  border-radius: var(--rayon-l);
  background: var(--surface);
  color: var(--texte);
  padding: 16px 56px 16px 16px;
  box-shadow: 0 16px 44px rgba(6,36,44,.24), 0 3px 10px rgba(6,36,44,.12);
  animation: installation-arrive .35s var(--ease-out) both;
}
.installation-app__contenu { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 12px; align-items: start; }
.installation-app__icone { width: 48px; height: 48px; border-radius: 12px; }
.installation-app__titre { margin: 1px 0 3px; color: var(--marine); font-family: var(--famille-titre); font-weight: 800; }
.installation-app__texte { margin: 0; color: var(--texte-doux); font-size: .84rem; line-height: 1.45; }
.installation-app__action { margin-top: 12px; }
.installation-app__fermer {
  position: absolute; top: 8px; right: 8px;
  display: grid; width: 44px; height: 44px; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--texte-doux);
}
.installation-app__fermer:hover { background: var(--fond); color: var(--marine); }
@keyframes installation-arrive { from { opacity: 0; transform: translateY(18px); } }

@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
  }
  body::before {
    content: "";
    position: fixed;
    z-index: 210;
    top: 0; right: 0; left: 0;
    height: env(safe-area-inset-top);
    background: var(--marine-nuit);
    pointer-events: none;
  }
  #toasts, .accuses { bottom: calc(var(--hauteur-barre) + env(safe-area-inset-bottom) + 16px); }
}

@media (min-width: 900px) {
  .accuses, #toasts { bottom: 20px; }
}

@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: max(16px, 1em) !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .ossature, .squelette { background-position: 50% 0; }
}

@media (display-mode: standalone) {
  .installation-app { display: none !important; }
}

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #111 !important; padding: 0 !important; }
  body::before, .sans-impression, .installation-app, .accuses, #toasts { display: none !important; }
  a { color: #111 !important; text-decoration: none; }
  * { box-shadow: none !important; text-shadow: none !important; }
}
