/* Alfred : interface sobre, d'après les Human Interface Guidelines d'Apple (presentations/DESIGN.md).
   Valeurs reprises de presentations/template/css/tokens.css. --accent : couleur du client dans son espace. */
:root {
  --accent: #0071e3;
  --accent-doux: color-mix(in oklab, var(--accent) 9%, white);
  --accent-fort: color-mix(in oklab, var(--accent) 82%, black);
  --encre: #1d1d1f;
  --encre-2: #424245;
  --discret: #636366;
  --ligne: #e5e5ea;
  --surface: #ffffff;
  --fond: #f5f5f7;
  --ok: #248a3d;
  --ok-doux: #e9f6ec;
  --attention: #b25000;
  --attention-doux: #fff4e5;
  --danger: #d70015;
  --danger-doux: #fdecee;
  --rayon: 18px;
  --rayon-s: 12px;
  --ombre: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 6%);
  --police: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --courbe: cubic-bezier(.25, .1, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 400 16px/1.5 var(--police);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent-fort); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 55%, white); outline-offset: 2px; }

h1 { font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; }
.surtitre { font-size: 13px; font-weight: 600; color: var(--discret); letter-spacing: .02em; text-transform: uppercase; }
.secondaire { color: var(--discret); }
.petit { font-size: 14px; }
.chiffres { font-variant-numeric: tabular-nums; }

/* Barre du haut : matière floutée, réservée à la navigation */
.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  min-height: 56px; padding: 6px max(16px, calc((100vw - 1120px) / 2));
  background: rgb(255 255 255 / 78%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--ligne);
}
.barre-marque { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--encre); text-decoration: none; font-weight: 600; }
.barre-logo { width: 28px; height: 28px; object-fit: contain; }
.barre-sep, .barre-nom { color: var(--discret); }
.barre-marque:only-child .barre-nom, .barre-marque > .barre-nom:first-child { color: var(--encre); }
.barre-menu { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.barre-menu a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 999px; color: var(--encre-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap;
}
.barre-menu a:hover { background: rgb(0 0 0 / 5%); }
.barre-menu a[aria-current="page"] { color: var(--encre); background: rgb(0 0 0 / 7%); font-weight: 600; }
.barre-compte { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 14px; }
.barre-qui { color: var(--discret); white-space: nowrap; }

.contenu { max-width: 1120px; margin: 0 auto; padding: 40px 16px 80px; display: grid; gap: 24px; }
.contenu.etroit { max-width: 480px; padding-top: 12vh; }

.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.entete > div { display: grid; gap: 6px; }
.entete-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fil { font-size: 14px; color: var(--discret); }
.fil a { color: var(--discret); text-decoration: none; }
.fil a:hover { text-decoration: underline; }

/* Cartes */
.carte { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 24px; display: grid; gap: 16px; align-content: start; }
.carte.centre { text-align: center; justify-items: center; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
a.carte { color: inherit; text-decoration: none; transition: transform .2s var(--courbe), box-shadow .2s var(--courbe); }
a.carte:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(0 0 0 / 5%), 0 14px 34px rgb(0 0 0 / 10%); }
a.carte:active { transform: scale(.99); }
.grille { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.deux { display: grid; gap: 24px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.pile { display: grid; gap: 24px; align-content: start; }

.identite { display: flex; align-items: center; gap: 14px; }
.vignette {
  flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--fond);
  display: grid; place-items: center; overflow: hidden; font-weight: 700; color: var(--discret);
}
.vignette img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.vignette.grande { width: 72px; height: 72px; border-radius: 18px; font-size: 22px; }

/* Boutons : gélules, 44 px de haut, une seule action principale par vue */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: rgb(0 0 0 / 6%); color: var(--encre);
  font: 600 15px/1 var(--police); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--courbe), background .15s var(--courbe);
}
.btn:hover { background: rgb(0 0 0 / 10%); }
.btn:active { transform: scale(.97); }
.btn.principal { background: var(--accent); color: #fff; }
.btn.principal:hover { background: var(--accent-fort); }
.btn:disabled, .btn[aria-disabled="true"] { background: rgb(0 0 0 / 4%); color: #8e8e93; cursor: not-allowed; transform: none; }
.bientot { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: rgb(0 0 0 / 6%); color: var(--discret); }
.lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-fort); font: 500 15px/1 var(--police); text-decoration: none; cursor: pointer; }
.lien:hover { text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Statuts : toujours écrits en toutes lettres, la couleur ne porte pas seule l'information */
.statut { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgb(0 0 0 / 6%); color: var(--encre-2); white-space: nowrap; }
.statut::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut.ok { background: var(--ok-doux); color: var(--ok); }
.statut.attente { background: var(--attention-doux); color: var(--attention); }
.statut.accent { background: var(--accent-doux); color: var(--accent-fort); }

.alerte, .succes, .info { padding: 12px 16px; border-radius: var(--rayon-s); font-size: 15px; }
.alerte { background: var(--danger-doux); color: var(--danger); }
.succes { background: var(--ok-doux); color: var(--ok); }
.info { background: var(--accent-doux); color: var(--accent-fort); }

/* Formulaires */
.formulaire { display: grid; gap: 10px; }
.formulaire label, .champ > label { font-size: 14px; font-weight: 600; color: var(--encre-2); }
.champs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.champ { display: grid; gap: 6px; align-content: start; }
.champ.large { grid-column: 1 / -1; }
.aide { font-size: 13px; color: var(--discret); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="file"], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid #c7c7cc; border-radius: var(--rayon-s); background: var(--surface); color: var(--encre);
  font: 400 16px/1.4 var(--police);
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in oklab, var(--accent) 45%, white); outline-offset: 0; border-color: var(--accent); }
.case { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-weight: 400; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.champ-code { font-size: 28px; font-weight: 700; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.formulaire .btn { margin-top: 8px; }
.actions-secondaires { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Listes de faits (libellé / valeur) */
.faits { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 15px; }
.faits dt { color: var(--discret); }
.faits dd { min-width: 0; overflow-wrap: anywhere; }
.liste > li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--ligne); }
.liste > li:first-child { border-top: 0; padding-top: 0; }
.liste > li:last-child { padding-bottom: 0; }
.liste-texte { display: grid; gap: 2px; min-width: 0; }
.vide { color: var(--discret); font-size: 15px; }

/* Onglets du projet */
.onglets { display: flex; gap: 4px; padding: 4px; background: rgb(0 0 0 / 6%); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; }
.onglets a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; color: var(--encre-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.onglets a[aria-current="page"] { background: var(--surface); color: var(--encre); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }

.bandeau { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--rayon-s); background: var(--attention-doux); color: var(--attention); font-size: 15px; font-weight: 500; }

/* Avancement d'un lot */
.jauge { height: 8px; border-radius: 999px; background: rgb(0 0 0 / 8%); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: inherit; background: var(--couleur-lot, var(--accent)); }

@media (max-width: 760px) {
  h1 { font-size: 26px; }
  .contenu { padding-top: 24px; gap: 16px; }
  .deux { grid-template-columns: 1fr; }
  .barre { gap: 8px; flex-wrap: wrap; }
  .barre-menu { order: 3; flex-basis: 100%; }
  .barre-qui { display: none; }
  .carte { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
