/*
 * IMMGO — Charte : jetons de design (couleurs, typographie, espaces, rayons, ombres), remise à zéro et texte
 * Auteur : Jacks Ngalangala
 */

/* ─── Police embarquée (Inter, licence OFL, voir fonts/LICENCE-OFL.txt) ─── */
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-semibold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-bold.woff2') format('woff2');
}
/* Police à empattements proposée aux marques des espaces (Lora, licence OFL, voir fonts/LICENCE-OFL-LORA.txt) */
@font-face {
  font-family: 'Lora';
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/lora-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/lora-bold.woff2') format('woff2');
}

:root {
  /* Couleurs de marque */
  --or: #bba460; /* or du logo officiel : action principale, élément actif */
  --or-fonce: #a48d4c; /* survol de l'action principale */
  --or-texte: #7a6528; /* or lisible sur fond clair (liens, valeurs) : contraste 5,6 sur blanc */
  --or-chiffre: #94793a; /* or des grands chiffres sur fond clair : contraste 4,2 (≥ 3 pour un grand texte) */
  --or-pale: #f4eedd; /* fond d'un élément actif ou choisi */
  --or-trait: #e2d6b0; /* bord d'un élément choisi */
  --or-sur-nuit: #bba460; /* or posé comme texte sur fond sombre (contraste 8 sur la nuit) */

  /* Fonds et surfaces (thème clair) */
  --fond: #f6f4f0; /* beige des écrans */
  --surface: #ffffff; /* cartes, champs, fenêtres */
  --surface-douce: #faf8f4; /* zone secondaire dans une carte */
  --trait: #e7e2d8; /* bords et séparateurs */
  --trait-fort: #d6cfc2; /* bord d'un champ */

  /* Textes */
  --texte: #1a1a1a;
  --texte-second: #5f5a4f;
  --texte-faible: #7d776a; /* légendes, jamais pour une information essentielle */
  --texte-sur-or: #1a1a1a;

  /* Sombre (authentification, en-tête mobile, barre latérale web) */
  --nuit: #161616;
  --nuit-surface: #222222;
  --nuit-surface-haute: #2c2c2c;
  --nuit-trait: #383838;
  --nuit-texte: #f5f2ea;
  --nuit-texte-second: #b4ad9f;

  /* Couleurs sémantiques : texte foncé + fond pâle, toujours avec une icône ou un libellé */
  --succes: #2e7d4f;
  --succes-pale: #e6f4ec;
  --attention: #9a6410;
  --attention-pale: #fdf1d8;
  --danger: #b3261e;
  --danger-fonce: #93201a;
  --texte-sur-danger: #ffffff;
  --danger-pale: #fce8e6;
  --info: #2f62a8;
  --info-pale: #e7effa;
  --neutre: #5f5a4f;
  --neutre-pale: #efece6;

  /* Typographie : échelle en px pour être identique au mobile */
  --police: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --police-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --taille-legende: 13px; /* écrans de gestion seulement, jamais le texte client */
  --taille-petit: 14px;
  --taille-corps: 16px; /* minimum du texte destiné au client */
  --taille-grand: 18px;
  --taille-titre-3: 20px;
  --taille-titre-2: 24px;
  --taille-titre-1: 30px;
  --taille-affiche: 40px; /* montant ou chiffre vedette */
  --interligne: 1.5;
  --interligne-titre: 1.2;
  --graisse-normale: 400;
  --graisse-moyenne: 500;
  --graisse-forte: 600;
  --graisse-titre: 700;

  /* Espaces (grille de 4 px) */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 20px;
  --e-6: 24px;
  --e-8: 32px;
  --e-10: 40px;
  --e-12: 48px;
  --e-16: 64px;

  /* Rayons */
  --r-petit: 8px;
  --r-moyen: 12px; /* boutons, champs */
  --r-grand: 16px; /* cartes */
  --r-tres-grand: 24px; /* fenêtres, feuilles mobiles */
  --r-pilule: 999px;

  /* Ombres (douces, chaudes) */
  --ombre-1: 0 1px 2px rgba(40, 32, 16, 0.06);
  --ombre-2: 0 2px 8px rgba(40, 32, 16, 0.06), 0 1px 2px rgba(40, 32, 16, 0.04);
  --ombre-3: 0 12px 32px rgba(40, 32, 16, 0.14), 0 2px 6px rgba(40, 32, 16, 0.06);
  --anneau: 0 0 0 3px rgba(187, 164, 96, 0.4); /* focus clavier */

  /* Dimensions */
  --hauteur-controle: 48px; /* boutons et champs : cible tactile confortable */
  --hauteur-controle-petit: 36px;
  --largeur-barre-laterale: 256px;
  --hauteur-entete: 72px;
  --hauteur-onglets-mobile: 72px;
  --largeur-lecture: 640px;
  --largeur-contenu: 1200px;

  /* Mouvement */
  --duree: 160ms;
  --courbe: cubic-bezier(0.2, 0, 0, 1);

  /* Points de rupture (rappel, les @media ne lisent pas les variables) :
     mobile < 600px ≤ tablette < 1024px ≤ bureau < 1440px ≤ large */
}

/* ─── Remise à zéro ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Police de la marque d'un espace (portail de ses clients, vitrine) : posée par ui/marque-espace.js */
html[data-police='serif'] {
  --police: var(--police-serif);
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police);
  font-size: var(--taille-corps);
  line-height: var(--interligne);
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
dl,
dd {
  margin: 0;
  padding: 0;
}
ul,
ol {
  list-style: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--or-texte);
  text-decoration: none;
  font-weight: var(--graisse-moyenne);
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: none;
  box-shadow: var(--anneau);
}
[hidden] {
  display: none !important;
}

/* ─── Texte ─── */
.titre-1 {
  font-size: var(--taille-titre-1);
  line-height: var(--interligne-titre);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.02em;
}
.titre-2 {
  font-size: var(--taille-titre-2);
  line-height: var(--interligne-titre);
  font-weight: var(--graisse-titre);
  letter-spacing: -0.015em;
}
.titre-3 {
  font-size: var(--taille-titre-3);
  line-height: 1.3;
  font-weight: var(--graisse-forte);
}
.surtitre {
  font-size: var(--taille-legende);
  font-weight: var(--graisse-forte);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-faible);
}
.texte-second {
  color: var(--texte-second);
}
.texte-petit {
  font-size: var(--taille-petit);
}
.chiffre {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.affiche {
  font-size: var(--taille-affiche);
  line-height: 1.1;
  font-weight: var(--graisse-titre);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.lecteur-seul {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Empilements utilitaires de la charte (pas de style= dans les écrans) ─── */
.pile {
  display: flex;
  flex-direction: column;
  gap: var(--e-4);
}
.pile-serree {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
}
.pile-large {
  display: flex;
  flex-direction: column;
  gap: var(--e-8);
}
.rangee {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  flex-wrap: wrap;
}
.rangee-espacee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
}
.grille-auto {
  display: grid;
  gap: var(--e-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
