/* ==========================================================================
   AZIMUT PARTNERS — apercus.css
   Aperçus d'interfaces : petites interfaces dessinées par le code, purement
   décoratives (aria-hidden). Composant partagé par le catalogue des exemples
   concrets (cas-usage/index.html) et par la page d'accueil (index.html).

   Elles s'animent une fois, quand la carte qui les porte apparaît : cette carte
   a l'attribut « data-apparition » et reçoit la classe « est-visible » de site.js.
   Sans JavaScript, elles sont affichées dans leur état final.

   Sommaire
     0. Cadre commun : écran, en-tête, lignes, pastilles, notes
     1. Production : stock disponible face au besoin
     2. Chiffrage : le montant se calcule
     3. Compétences : niveau actuel, niveau cible
     4. Pilotage : trois indicateurs et un graphique
     5. Qualité / RSE : actions, preuves, échéances
     6. Administration : données extraites, pièces du dossier

   Dépend de socle.css.
   ========================================================================== */

/* 0. CADRE COMMUN */
.apercu {
  --alerte: #b42318;            /* texte d'une alerte dans un aperçu */
  --alerte-pale: #fdeceb;       /* fond d'une alerte dans un aperçu */
  padding: 18px 18px 0;
}

.apercu__ecran {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 128px;
  padding: 12px 14px 13px;
  border: 1px solid #dde6ef;
  border-radius: 12px;
  background: var(--blanc);
  box-shadow: 0 14px 24px -18px rgba(8, 36, 72, 0.38);
  color: var(--encre-douce);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.apercu__entete,
.apercu__ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.apercu__entete b {
  color: var(--marine);
  font-size: 0.8125rem;
  font-weight: 700;
}

.apercu__ligne b {
  color: var(--marine);
  font-weight: 700;
}

.apercu__pastille {
  padding: 2px 9px;
  border-radius: 999px;
  background: #e9eef5;
  color: #44547a;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.apercu__pastille--alerte {
  background: var(--alerte-pale);
  color: var(--alerte);
}

.apercu__pastille--accent {
  background: var(--turquoise-brume);
  color: #016c6a;
}

.apercu__note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #046a6e;
  font-size: 0.6875rem;
  font-weight: 600;
}

.apercu__note::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--turquoise-vif);
}

.apercu__note--alerte {
  color: var(--alerte);
}

.apercu__note--alerte::before {
  background: #d92d20;
}

/* 1. Production : stock disponible face au besoin */
.jauge {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
}

.jauge__plein {
  width: 80%;
  background: linear-gradient(90deg, #05a399, #018386);
  transform-origin: left center;
  transition: transform 1s var(--courbe) 0.35s;
}

.jauge__manque {
  flex: 1;
  background: repeating-linear-gradient(135deg, #f3b4ad 0 4px, var(--alerte-pale) 4px 8px);
  transition: opacity 0.5s 1.2s;
}

.js [data-apparition]:not(.est-visible) .jauge__plein {
  transform: scaleX(0);
}

.js [data-apparition]:not(.est-visible) .jauge__manque {
  opacity: 0;
}

/* 2. Chiffrage : le montant se calcule */
.apercu__ligne--total {
  padding-top: 8px;
  border-top: 1px solid #dde6ef;
  color: var(--marine);
  font-weight: 600;
}

.apercu__ligne--total b {
  color: var(--turquoise-fonce);
  font-size: 0.875rem;
  transition: opacity 0.6s 0.7s, transform 0.6s var(--courbe) 0.7s;
}

.js [data-apparition]:not(.est-visible) .apercu__ligne--total b {
  opacity: 0;
  transform: translateY(6px);
}

/* 3. Compétences : niveau actuel, niveau cible */
.niveau {
  display: inline-flex;
  gap: 4px;
}

.niveau i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #dfe6ee;
  transition: background-color 0.4s;
}

.niveau--actuel i:nth-child(-n+2) {
  background: var(--marine);
}

.niveau--cible i:nth-child(-n+4) {
  background: var(--turquoise);
}

.niveau--cible i:nth-child(1) { transition-delay: 0.5s; }
.niveau--cible i:nth-child(2) { transition-delay: 0.65s; }
.niveau--cible i:nth-child(3) { transition-delay: 0.8s; }
.niveau--cible i:nth-child(4) { transition-delay: 0.95s; }

.js [data-apparition]:not(.est-visible) .niveau--cible i {
  background: #dfe6ee;
}

/* 4. Pilotage : trois indicateurs et un graphique */
.tuiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tuiles span {
  position: relative;
  height: 24px;
  border-radius: 6px;
  background: #f1f5f9;
}

.tuiles span::before,
.tuiles span::after {
  content: "";
  position: absolute;
  left: 7px;
  height: 4px;
  border-radius: 2px;
}

.tuiles span::before {
  top: 6px;
  width: 44%;
  background: #c6d1df;
}

.tuiles span::after {
  top: 14px;
  width: 26%;
  background: var(--turquoise-vif);
}

.barres {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 44px;
  border-bottom: 1px solid #dde6ef;
}

.barres i {
  flex: 1;
  height: var(--h);
  border-radius: 3px 3px 0 0;
  background: #b5dedc;
  transform-origin: center bottom;
  transition: transform 0.7s var(--courbe);
}

.barres i:nth-child(1) { transition-delay: 0.35s; }
.barres i:nth-child(2) { transition-delay: 0.42s; }
.barres i:nth-child(3) { transition-delay: 0.49s; }
.barres i:nth-child(4) { transition-delay: 0.56s; }
.barres i:nth-child(5) { transition-delay: 0.63s; }
.barres i:nth-child(6) { transition-delay: 0.7s; }
.barres i:nth-child(7) { transition-delay: 0.77s; }

.barres .barres__forte {
  background: var(--turquoise);
}

.js [data-apparition]:not(.est-visible) .barres i {
  transform: scaleY(0);
}

/* 5. Qualité / RSE : actions, preuves, échéances */
.suivi {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Case de l'action */
.suivi i {
  position: relative;
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid #c1ccdb;
  border-radius: 50%;
  transition: background-color 0.35s, border-color 0.35s;
}

.suivi i::after {
  content: "";
  position: absolute;
  top: 1.5px;
  left: 4px;
  width: 3.5px;
  height: 7px;
  border: solid var(--blanc);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

.suivi--fait i {
  border-color: var(--turquoise);
  background: var(--turquoise);
}

/* Intitulé de l'action, figuré par un trait */
.suivi span {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #e3e9f1;
}

.suivi em {
  color: #56658a;
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.suivi--fait em {
  color: #046a6e;
}

.suivi:nth-child(2) i { transition-delay: 0.45s; }
.suivi:nth-child(3) i { transition-delay: 0.7s; }

.js [data-apparition]:not(.est-visible) .suivi--fait i {
  border-color: #c1ccdb;
  background: transparent;
}

/* 6. Administration : données extraites, pièces du dossier */
.extrait {
  width: 48%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #6cc7c2, #b5e3e0);
  transform-origin: left center;
  transition: transform 0.7s var(--courbe) 0.4s;
}

.extrait--court {
  width: 32%;
  transition-delay: 0.55s;
}

.js [data-apparition]:not(.est-visible) .extrait {
  transform: scaleX(0);
}

.pieces {
  display: inline-flex;
  gap: 5px;
}

.pieces i {
  width: 15px;
  height: 19px;
  border: 1.5px solid var(--turquoise);
  border-radius: 3px;
  background: var(--turquoise-pale);
}

.pieces .pieces__manque {
  border: 1.5px dashed #d92d20;
  background: var(--alerte-pale);
}
