/* =========================================================
   Les quatre démos de la section Services.
   Elles partagent le même style d'application : fond clair,
   cartes blanches, pastilles de statut, une seule couleur d'accent.
   Toutes les tailles sont en « em » : la démo garde ses
   proportions sur tous les écrans.
   ========================================================= */
.scene-demo {
  --d-fond: #F3F5F9;
  --d-carte: #FFFFFF;
  --d-bord: #E2E7EE;
  --d-texte: #101828;
  --d-pale: #667085;
  --d-bleu: #1F7BFF;

  container-type: inline-size;
  position: relative;
  overflow: hidden;
  background: var(--d-fond);
  color: var(--d-texte);
  font-family: var(--police-texte);
  font-size: clamp(10px, 2.15cqw, 15px);
  line-height: 1.35;
}

.demo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  padding: 1.7em;
  box-sizing: border-box;
  visibility: hidden;
}

.demo.visible {
  visibility: visible;
}

.demo p {
  margin: 0;
}

/* ---------- Éléments communs ---------- */
.app-tete {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1em;
}

.app-titre {
  font-size: 1.35em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-sous {
  margin-top: 0.15em;
  font-size: 0.86em;
  color: var(--d-pale);
}

.carte {
  background: var(--d-carte);
  border: 1px solid var(--d-bord);
  border-radius: 0.7em;
}

.puce {
  display: inline-flex;
  align-items: center;
  padding: 0.28em 0.75em;
  border-radius: 999px;
  font-size: 0.8em;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.puce.gris {
  background: #EEF1F5;
  color: #566275;
}

.puce.bleu {
  background: #E5EFFF;
  color: #1557C2;
}

.puce.vert {
  background: #E2F4E9;
  color: #157A45;
}

@keyframes disparait {
  to {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes monte {
  from {
    opacity: 0;
    transform: translateY(1.2em);
  }
}

@keyframes apparait {
  from {
    opacity: 0;
  }
}

/* ---------- 1. Automatisation ---------- */
.tableau {
  overflow: hidden;
}

.t-ligne {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 7.5em;
  align-items: center;
  gap: 1em;
  padding: 0.95em 1.2em;
  border-top: 1px solid var(--d-bord);
}

.t-entete {
  padding-block: 0.7em;
  border-top: 0;
  background: #F8FAFC;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--d-pale);
}

.t-client {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-etat {
  position: relative;
  height: 1.8em;
}

.t-etat .puce {
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
}

.d-auto .ap {
  opacity: 0;
}

.joue .t-ligne .av {
  animation: disparait 0.25s calc(0.8s + var(--n) * 0.55s) forwards;
}

.joue .t-ligne .ap {
  opacity: 1;
  animation: pop 0.35s ease calc(0.85s + var(--n) * 0.55s) backwards;
}

/* La ligne s'éclaire un instant quand sa facture part. */
.joue .t-ligne:not(.t-entete) {
  animation: eclaire 0.9s ease calc(0.8s + var(--n) * 0.55s);
}

@keyframes eclaire {
  30% {
    background: #F2F7FF;
  }
}

.pied-demo {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1em;
  margin-top: auto;
}

.bilan {
  font-size: 1.05em;
  color: var(--d-pale);
}

.bilan b {
  color: var(--d-texte);
}

.joue .bilan {
  animation: apparait 0.5s ease 3.4s backwards;
}

.toast {
  display: grid;
  gap: 0.1em;
  padding: 0.8em 1.1em;
  border-radius: 0.6em;
  background: var(--d-texte);
  color: #FFFFFF;
  font-size: 0.9em;
  box-shadow: 0 0.6em 1.6em rgba(16, 24, 40, 0.18);
}

.toast span {
  color: #C7CEDA;
}

.joue .toast {
  animation: monte 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) 3s backwards;
}

/* ---------- 2. Logiciel sur mesure ---------- */
.kpi {
  font-size: 0.9em;
  color: var(--d-pale);
  text-align: right;
}

.kpi b {
  display: block;
  font-size: 1.5em;
  color: var(--d-texte);
}

.tableau-suivi {
  --haut-col: 2.4em;
  --h-fiche: 3em;
  --ecart: 0.6em;
  position: relative;
  flex: 1;
  min-height: 0;
}

.col-titre {
  position: absolute;
  top: 0;
  left: calc(var(--c) * 34.33%);
  width: 31.33%;
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--d-pale);
}

.col-titre span {
  padding: 0.05em 0.55em;
  border-radius: 999px;
  background: #E7EBF1;
  font-size: 0.9em;
}

.fiche {
  position: absolute;
  top: calc(var(--haut-col) + var(--r) * (var(--h-fiche) + var(--ecart)));
  left: calc(var(--c) * 34.33%);
  width: 31.33%;
  height: var(--h-fiche);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6em;
  padding: 0 0.9em 0 1.5em;
  box-sizing: border-box;
  background: var(--d-carte);
  border: 1px solid var(--d-bord);
  border-radius: 0.6em;
  overflow: hidden;
}

/* Le petit point de couleur de chaque colonne. */
.fiche::before {
  content: "";
  position: absolute;
  left: 0.65em;
  top: 50%;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  translate: 0 -50%;
}

.fiche.c0::before {
  background: #98A2B3;
}

.fiche.c1::before {
  background: var(--d-bleu);
}

.fiche.c2::before {
  background: #17A34A;
}

.fiche b {
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fiche span {
  color: var(--d-pale);
  font-variant-numeric: tabular-nums;
}

/* Au départ, les fiches sont des lignes d'un fichier Excel. */
.xl {
  position: absolute;
  inset: 0;
  border: 1px solid #C9D3CD;
  background:
    linear-gradient(90deg, transparent calc(55% - 1px), #D5DDD8 calc(55% - 1px), #D5DDD8 55%, transparent 55%),
    #FFFFFF;
  opacity: 0;
  pointer-events: none;
}

.xl-barre {
  height: var(--haut-col);
  display: flex;
  align-items: center;
  padding-inline: 0.9em;
  background: #1D6F42;
  color: #FFFFFF;
  font-size: 0.85em;
  font-weight: 600;
}

.joue .xl {
  opacity: 0;
  animation: excel 1.5s linear;
}

@keyframes excel {
  0%, 70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.joue .col-titre {
  animation: apparait 0.5s ease 1.2s backwards;
}

.joue .fiche {
  animation: range 0.9s cubic-bezier(0.7, 0, 0.2, 1) calc(1.05s + var(--t0) * 0.1s) backwards;
}

@keyframes range {
  from {
    left: 0;
    top: calc(var(--haut-col) + var(--t0) * 2.6em);
    width: 100%;
    height: 2.6em;
    border-radius: 0;
    border-color: #D5DDD8;
  }
}

/* ---------- 3. Site vitrine ---------- */
.d-site {
  align-items: center;
  justify-content: center;
  background: #E6EBF2;
}

.telephone {
  height: 100%;
  aspect-ratio: 9 / 17;
  max-width: 50%;
  padding: 0.55em;
  box-sizing: border-box;
  border-radius: 2.3em;
  background: #101828;
}

.tel-ecran {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  padding: 1em;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 1.8em;
  background: #FFFFFF;
}

.v-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6em;
  font-size: 0.85em;
}

/* Trois petits traits : le menu. */
.v-nav i {
  width: 1.2em;
  height: 0.8em;
  background: linear-gradient(#101828 0 2px, transparent 2px calc(50% - 1px), #101828 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px) calc(100% - 2px), #101828 calc(100% - 2px));
}

.v-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4em;
  padding: 1em;
  border-radius: 0.9em;
  background: #12324A;
  color: #FFFFFF;
}

.v-hero strong {
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.15;
}

.v-hero span {
  font-size: 0.78em;
  color: #B9C7D6;
}

.v-btn {
  padding: 0.85em;
  border-radius: 0.7em;
  background: var(--d-bleu);
  color: #FFFFFF;
  font-size: 0.9em;
  font-weight: 600;
  text-align: center;
}

.v-infos {
  display: grid;
  gap: 0.3em;
  font-size: 0.8em;
}

.v-infos p {
  display: flex;
  justify-content: space-between;
  padding-block: 0.45em;
  border-top: 1px solid var(--d-bord);
}

.v-infos span {
  color: var(--d-pale);
}

.v-vieux {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  padding: 2.2em 1em;
  background: #C0C0C0;
  color: #000080;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95em;
  opacity: 0;
}

.v-vieux u {
  color: #B00000;
  font-family: "Comic Sans MS", cursive;
  font-size: 1.15em;
}

.joue .v-vieux {
  animation: chute 0.8s cubic-bezier(0.55, 0, 0.8, 0.3) 0.9s backwards;
}

@keyframes chute {
  from {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  to {
    opacity: 1;
    transform: translateY(110%) rotate(7deg);
  }
}

.joue .v-nav,
.joue .v-hero,
.joue .v-btn,
.joue .v-infos {
  animation: monte 0.5s ease backwards;
}

.joue .v-nav {
  animation-delay: 1.4s;
}

.joue .v-hero {
  animation-delay: 1.55s;
}

.joue .v-btn {
  animation: monte 0.5s ease 1.7s backwards, presse 0.5s ease 3s 2;
}

.joue .v-infos {
  animation-delay: 1.85s;
}

@keyframes presse {
  50% {
    transform: scale(0.95);
  }
}

.notif {
  position: absolute;
  left: 1.7em;
  top: 1.7em;
  display: grid;
  gap: 0.1em;
  max-width: 24%;
  padding: 0.85em 1em;
  border-radius: 0.7em;
  background: #FFFFFF;
  box-shadow: 0 0.6em 1.8em rgba(16, 24, 40, 0.14);
  font-size: 0.9em;
}

.notif span {
  color: var(--d-pale);
}

.joue .notif {
  animation: monte 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) 4s backwards;
}

/* ---------- 4. Site transactionnel ---------- */
.vente-grille {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  gap: 1.2em;
}

.boutique {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: 1em;
}

/* Une illustration simple : une assiette et un gâteau, vus de haut. */
.produit-image {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  margin-bottom: 0.6em;
  border-radius: 0.5em;
  background: #F6EEE3;
}

.produit-image i {
  height: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #E4B26A;
  box-shadow: 0 0 0 0.5em #FFFFFF, 0 0 0 0.6em #E8DDCF;
}

.produit-nom {
  font-size: 1.15em;
  font-weight: 600;
}

.payer {
  position: relative;
  height: 2.8em;
  margin-top: 0.7em;
  border-radius: 0.6em;
  background: var(--d-texte);
  color: #FFFFFF;
  font-weight: 600;
}

.payer i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: normal;
}

.payer .pp {
  opacity: 0;
}

.joue .payer {
  animation: presse 0.35s ease 1.2s, devient-vert 0.3s ease 1.5s forwards;
}

@keyframes devient-vert {
  to {
    background: #157A45;
  }
}

.joue .payer .pa {
  animation: disparait 0.15s 1.5s forwards;
}

.joue .payer .pp {
  opacity: 1;
  animation: pop 0.3s 1.55s backwards;
}

.commandes {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.com-tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.9em 1em;
}

.ventes {
  font-size: 0.85em;
  color: var(--d-pale);
}

.ventes b {
  position: relative;
  display: inline-block;
  width: 4.4em;
  height: 1.2em;
  color: var(--d-texte);
  vertical-align: bottom;
}

.ventes i {
  position: absolute;
  right: 0;
  font-style: normal;
}

.ventes .v1 {
  opacity: 0;
}

.joue .ventes .v1 {
  opacity: 1;
  animation: disparait 0.2s 3s forwards;
}

.joue .ventes .v2 {
  animation: pop 0.35s 3.05s backwards;
}

.com-ligne {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7em;
  padding: 0.75em 1em;
  border-top: 1px solid var(--d-bord);
  font-size: 0.9em;
}

.com-ligne > span:first-child {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heure {
  color: var(--d-pale);
}

.com-ligne.nouvelle {
  background: #F2F7FF;
}

/* La nouvelle commande glisse en haut de la liste. */
.joue .com-ligne.nouvelle {
  animation: arrive-commande 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 2.3s backwards;
}

@keyframes arrive-commande {
  from {
    opacity: 0;
    margin-top: -2.9em;
  }
}

/* Sur téléphone, la fenêtre est plus haute pour garder le texte lisible. */
@media (max-width: 640px) {
  .fenetre .scene-demo {
    aspect-ratio: 10 / 11;
  }

  .demo {
    padding: 1.3em;
  }

  .notif {
    left: 1em;
    top: 1em;
    max-width: 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo * {
    animation: none !important;
    transition: none !important;
  }
}
