/* ============================================================
   FLOWIRE — la fenêtre du logiciel « mode exploration » et la
   visite guidée en cartes.
   Même construction que la landing Wodz (lp_v5) : une fenêtre qui
   reprend le menu et la barre du haut du logiciel, dont le menu
   sert de navigation du site, de page module en page module.
   Gabarits : _gabarits/logiciel-menu.html, logiciel-barre.html,
   icones.html. Aperçus des cartes : _cartes/<nom>.html|css.
   ============================================================ */

.icones { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------
   1. La fenêtre
   ------------------------------------------------------------ */
.logiciel {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid #E8DAD3;
  border-radius: var(--r-grand);
  box-shadow: var(--ombre-fenetre);
  overflow: hidden;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  color: var(--encre-2);
}
/* Gras du cadre et du tableau de bord seulement : les écrans (.ec) ont leurs propres couleurs, texte clair sur fond sombre compris. */
.logiciel__titre b, .logiciel__menu b, .logiciel__barre b, .tdb b, .tdb strong { color: var(--encre); font-weight: 600; }
.logiciel svg { display: block; }

.logiciel__titre {
  display: flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--surface-4);
}
.logiciel__points { display: flex; gap: 7px; flex: none; }
.logiciel__points i { display: block; width: 10px; height: 10px; border-radius: 50%; background: #E3C2B9; }
.logiciel__points i:nth-child(2) { background: #EAD8BD; }
.logiciel__points i:nth-child(3) { background: #C4D0BF; }
.logiciel__url { min-width: 0; font-size: 13px; color: var(--encre-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logiciel__url b { color: var(--encre); }
.logiciel__mode {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--trait); border-radius: var(--r-pilule);
  background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--accent);
}
.logiciel__mode i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--sauge); }
.logiciel__mode i::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: var(--sauge); opacity: .25; animation: logiciel-souffle 3.2s ease-in-out infinite;
}
@keyframes logiciel-souffle { 0%, 100% { transform: scale(.5); opacity: 0; } 50% { transform: scale(1); opacity: .3; } }

.logiciel__corps { display: flex; align-items: stretch; }

/* ------------------------------------------------------------
   2. Le menu latéral : la navigation du site
   ------------------------------------------------------------ */
.logiciel__menu {
  flex: 0 0 228px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 12px 16px;
  background: var(--surface-2);
  border-right: 1px solid var(--surface-4);
}
.logiciel__studio { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.logiciel__logo {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--accent);
  font-size: 13px; font-weight: 600; color: #FFFFFF;
}
.logiciel__studio > span:last-child { display: flex; flex-direction: column; min-width: 0; font-size: 12px; color: var(--encre-3); line-height: 1.3; white-space: nowrap; }
.logiciel__studio b { font-size: 14px; }

.logiciel__item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 34px; padding: 6px 10px;
  border: 0; border-radius: 10px; background: none;
  font: inherit; font-size: 14px; font-weight: 500; text-align: left;
  color: #4E3D40; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.logiciel__item svg { width: 17px; height: 17px; flex: none; color: var(--encre-4); }
.logiciel__item:hover { background: #EFE2DC; color: var(--encre); }
.logiciel__item.est-actif { background: #EBDCD5; color: var(--encre); font-weight: 600; }
.logiciel__item.est-actif svg { color: var(--accent); }
.logiciel__item.est-actif::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.logiciel__item:focus-visible { outline-offset: 0; }

.logiciel__chevron { margin-left: auto; width: 12px !important; height: 12px !important; transition: transform .2s ease; }
.logiciel__groupe.est-ouvert .logiciel__chevron { transform: rotate(90deg); }
.logiciel__groupe:has(.est-actif) > .logiciel__groupe-bouton { color: var(--encre); font-weight: 600; }
.logiciel__sous { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px 18px; padding-left: 8px; border-left: 1px solid var(--trait); }
.logiciel__groupe.est-ouvert .logiciel__sous, html:not(.js) .logiciel__sous { display: flex; }
.logiciel__item--sous { min-height: 32px; font-size: 13.5px; }
.logiciel__item--sous.est-actif::before { left: -9px; }
.logiciel__appel { margin-top: auto; padding: 18px 2px 0; }
.logiciel__creer { min-height: 42px; padding: 10px 16px; font-size: 14px; }

/* ------------------------------------------------------------
   3. Barre du haut et zone d'écran
   ------------------------------------------------------------ */
.logiciel__principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.logiciel__barre {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--surface-4);
}
.logiciel__recherche {
  flex: 1; max-width: 320px; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--trait); border-radius: var(--r-pilule);
  background: var(--surface-2);
  color: var(--encre-3); white-space: nowrap; overflow: hidden;
}
.logiciel__recherche svg { width: 14px; height: 14px; flex: none; color: var(--encre-4); }
.logiciel__droite { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.logiciel__messages {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 6px 12px;
  border: 1px solid var(--trait); border-radius: var(--r-pilule);
  font-weight: 600; color: var(--encre); text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}
.logiciel__messages:hover { border-color: var(--trait-fort); background: var(--surface-2); color: var(--encre); }
.logiciel__messages svg { width: 15px; height: 15px; color: var(--encre-4); }
.logiciel__messages b { min-width: 20px; padding: 1px 6px; border-radius: var(--r-pilule); background: var(--accent); color: #FFFFFF; font-size: 11px; text-align: center; }
.logiciel__cloche { width: 32px; height: 32px; display: grid; place-items: center; color: var(--encre-4); }
.logiciel__cloche svg { width: 16px; height: 16px; }
.logiciel__moi { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--encre); white-space: nowrap; }
.logiciel__avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--sauge); color: #FFFFFF; font-size: 11px; font-weight: 600; }
.logiciel__ecran { flex: 1; min-width: 0; padding: 24px 26px 26px; }

/* Sans menu (téléphone, tablette) : l'écran seul, la navigation passe par l'en-tête du site. */
@media (max-width: 900px) {
  .logiciel__menu { display: none; }
  .logiciel__recherche, .logiciel__nom, .logiciel__cloche { display: none; }
  .logiciel__barre { padding: 10px 16px; }
  .logiciel__droite { margin-left: 0; width: 100%; justify-content: space-between; }
  .logiciel__ecran { padding: 18px 16px 20px; }
}
@media (max-width: 640px) {
  .logiciel__titre { padding: 0 14px; gap: 10px; }
  .logiciel__points { display: none; }
  .logiciel__url { font-size: 12px; }
  .logiciel__mode { padding: 4px 9px; font-size: 11px; }
}

/* ------------------------------------------------------------
   4. Tableau de bord (héros de l'accueil)
   ------------------------------------------------------------ */
.tdb { display: flex; flex-direction: column; gap: 16px; }

.tdb-bandeau {
  position: relative; overflow: hidden;
  padding: 18px 22px 18px;
  border: 1px solid var(--trait); border-radius: 20px;
  background: linear-gradient(110deg, #F6ECE7 0%, var(--surface) 58%);
}
.tdb-bandeau__forme { position: absolute; right: -40px; top: -30px; width: 230px; height: auto; fill: #EFE0DA; pointer-events: none; }
.tdb-bandeau > :not(.tdb-bandeau__forme) { position: relative; }
.tdb-bandeau__surtitre { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 12px; font-weight: 600; color: var(--encre-4); }
.tdb-point { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tdb-point::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--accent); opacity: 0; animation: logiciel-souffle 3.2s ease-in-out infinite; }
.tdb-bandeau__ligne { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; }
.tdb-bandeau__id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tdb-bandeau__logo {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 15px; background: var(--accent); color: #FFFFFF;
  font-size: 16px; font-weight: 600; box-shadow: 0 10px 22px -12px rgba(107, 82, 86, .7);
}
.tdb-bandeau__nom { display: flex; flex-direction: column; gap: 4px; font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--encre); white-space: nowrap; }
.tdb-bandeau__nom em { color: var(--encre-4); }
.tdb-bandeau__nom span { font-family: var(--sans); font-size: 12.5px; line-height: 1.3; color: var(--encre-3); }
.tdb-pouls { display: flex; gap: 0; padding: 4px 0; border-radius: 16px; background: rgba(255, 253, 251, .75); border: 1px solid var(--surface-4); }
.tdb-stat { display: flex; flex-direction: column; gap: 2px; min-width: 128px; padding: 6px 18px; }
.tdb-stat + .tdb-stat { border-left: 1px solid var(--surface-4); }
.tdb-stat > span { font-size: 12px; font-weight: 500; color: var(--encre-3); }
.tdb-stat b { font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; }
.tdb-stat i { font-style: normal; font-size: 12px; color: var(--encre-3); }
.tdb-tendance { display: inline-block; padding: 0 7px; border-radius: var(--r-pilule); background: var(--sauge-fond); color: var(--sauge) !important; font-weight: 600; }
i.tdb-tendance { align-self: flex-start; }

.tdb-section { display: flex; align-items: center; gap: 12px; margin: 2px 2px -6px; font-size: 12.5px; font-weight: 600; color: var(--encre-4); white-space: nowrap; }
.tdb-section i { flex: 1; height: 1px; background: var(--trait); }
.tdb-section__compte { font-weight: 500; color: var(--encre-3); }

.tdb-carte { min-width: 0; border: 1px solid var(--surface-4); border-radius: 18px; background: var(--surface); padding: 14px 16px; }
.tdb-carte--frise { padding: 10px 14px 12px; overflow-x: auto; }
.tdb-frise { position: relative; min-width: 680px; }
.tdb-frise__heures { position: relative; height: 16px; margin: 0 22px 6px 0; font-size: 11px; color: var(--encre-3); }
.tdb-frise__heures span { position: absolute; transform: translateX(-50%); }
.tdb-frise__heures span:first-child { transform: none; }
.tdb-frise__piste { position: relative; height: 104px; margin-right: 22px; }
.tdb-frise__trait { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--surface-4); }
.tdb-seance {
  position: absolute; z-index: 1; width: clamp(70px, 10.5%, 84px);
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 8px 7px;
  border-radius: 10px; background: var(--c-reformer, #EBDCD5);
  font-size: 11px; line-height: 1.25; color: var(--encre-2);
}
.tdb-seance b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdb-seance > span { display: flex; justify-content: space-between; gap: 4px; }
.tdb-seance em { font-style: normal; font-weight: 600; color: var(--encre); }
.tdb-seance > i { display: block; height: 3px; margin-top: 4px; border-radius: 3px; background: rgba(58, 42, 46, .12); overflow: hidden; }
.tdb-seance > i::after { content: ''; display: block; width: var(--f, 50%); height: 100%; border-radius: 3px; background: var(--accent); }
.tdb-seance--mat { background: #EDE5D8; }
.tdb-seance--yoga { background: #E1E5DC; }
.tdb-seance--yoga > i::after { background: var(--sauge); }
.tdb-seance--doux { background: #E9E0E9; }
.tdb-seance--doux > i::after { background: #6D5A6F; }
.tdb-seance--complet { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tdb-frise__maintenant { position: absolute; z-index: 0; top: -6px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--encre); }
.tdb-frise__maintenant::before { content: ''; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--encre); }

.tdb-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.tdb-carte__tete { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tdb-carte__icone { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--accent); }
.tdb-carte__icone svg { width: 16px; height: 16px; }
.tdb-carte__titre { display: flex; flex-direction: column; font-size: 14.5px; font-weight: 600; color: var(--encre); line-height: 1.25; }
.tdb-carte__titre small { font-size: 12px; font-weight: 500; color: var(--encre-3); }
.tdb-carte__lien, .tdb-carte__pied { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.tdb-carte__lien { margin-left: auto; }
.tdb-carte__lien:hover, .tdb-carte__pied:hover { color: var(--encre); text-decoration: underline; }
.tdb-carte__pied { display: inline-block; margin-top: 8px; }
.tdb-roster { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tdb-roster li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 6px 12px; border-radius: 12px; background: var(--surface-2); }
.tdb-avatars { display: flex; align-items: center; }
.tdb-avatars span {
  width: 26px; height: 26px; margin-left: -6px; display: grid; place-items: center;
  border: 2px solid var(--surface-2); border-radius: 50%; background: var(--accent);
  font-size: 9.5px; font-weight: 600; color: #FFFFFF;
}
.tdb-avatars span:nth-child(2) { background: var(--sauge); }
.tdb-avatars span:nth-child(3) { background: #5E4B4E; }
.tdb-avatars span:nth-child(4) { background: #6D5A6F; }
.tdb-avatars em { margin-left: 6px; font-style: normal; font-weight: 600; color: var(--encre-3); }
.tdb-auto { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pilule); background: var(--sauge-fond); font-size: 11.5px; font-weight: 600; color: var(--sauge); }
.tdb-auto i { width: 6px; height: 6px; border-radius: 50%; background: var(--sauge); animation: tdb-pouls 2s ease-in-out infinite; }
@keyframes tdb-pouls { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.tdb-flux { list-style: none; display: flex; flex-direction: column; }
.tdb-flux__ligne { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 7px 0 7px 16px; border-top: 1px solid var(--surface-4); font-size: 12.5px; }
.tdb-flux__ligne:first-child { border-top: 0; }
.tdb-flux__ligne::before { content: ''; position: absolute; left: 2px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tdb-flux__ligne--ok::before { background: var(--sauge); }
.tdb-flux__ligne--info::before { background: #8A7290; }
.tdb-flux__ligne--alerte::before { background: var(--alerte); }
.tdb-flux__ligne > span { flex: 1; min-width: 0; }
.tdb-flux__ligne time { flex: none; font-size: 11.5px; color: var(--encre-3); padding-top: 1px; }
.tdb-flux__ligne.est-nouveau { animation: tdb-arrivee .5s ease both; }
@keyframes tdb-arrivee { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  /* Sur téléphone, la frise dit déjà la journée : la carte de la prochaine séance s'efface. */
  .tdb-carte--prochaine { display: none; }
  .tdb-bandeau { padding: 16px; }
  .tdb-bandeau__forme { width: 150px; right: -50px; }
  .tdb-pouls { width: 100%; }
  .tdb-stat { min-width: 0; flex: 1; padding: 4px 10px; }
  .tdb-stat b { font-size: 18px; }
  .tdb-stat > span { font-size: 11px; }
}

/* ------------------------------------------------------------
   5. Pages modules : la fenêtre en tête de page
   ------------------------------------------------------------ */
.logiciel .logiciel__ecran.ec { font-size: 13px; }
.heros__ecran .logiciel { margin: 0 auto; }

/* ------------------------------------------------------------
   6. Visite guidée : grille de cartes avec aperçu
   ------------------------------------------------------------ */
.visite-grille {
  list-style: none;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px;
}
.visite-grille > li { grid-column: span 2; display: flex; min-width: 0; }
/* 17 cartes sur 3 colonnes : les deux dernières se centrent */
.visite-grille > li:nth-last-child(2):nth-child(3n + 1) { grid-column: 2 / span 2; }

.carte-module {
  position: relative;
  display: flex; flex-direction: column; width: 100%;
  background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--r-bloc);
  overflow: hidden;
  color: inherit; text-decoration: none;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.carte-module:hover {
  transform: translateY(-4px);
  border-color: var(--trait-fort);
  box-shadow: 0 34px 60px -38px rgba(52, 38, 42, .45);
  color: inherit;
}
.carte-module:focus-visible { outline-offset: 4px; border-radius: var(--r-bloc); }
.carte-module__ecran {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  container-type: inline-size;
  background: var(--surface-2);
  border-bottom: 1px solid var(--surface-4);
  font-size: 13px; line-height: 1.3; color: var(--encre-2);
}
.carte-module__ecran b, .carte-module__ecran strong { color: var(--encre); font-weight: 600; }
.carte-module__corps { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; }
.carte-module__titre { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--encre); }
.carte-module__titre svg { width: 19px; height: 19px; flex: none; color: var(--accent); }
.carte-module__texte { flex: 1; font-size: 0.95rem; line-height: 1.55; color: var(--encre-2); }
.carte-module__lien { display: inline-flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 0.95rem; font-weight: 600; color: var(--accent); }
.carte-module__lien svg { width: 15px; height: 15px; transition: transform .25s ease; }
.carte-module:hover .carte-module__lien svg { transform: translateX(3px); }

.visite-indice { display: none; }

@media (max-width: 1080px) {
  .visite-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .visite-grille > li, .visite-grille > li:nth-last-child(2):nth-child(3n + 1) { grid-column: span 2; }
  /* Sur 2 colonnes, la dernière carte reste seule : elle se centre. */
  .visite-grille > li:last-child:nth-child(odd) { grid-column: 2 / span 2; }
}

/* Téléphone : un rail que l'on fait glisser, avec sa position « 3 / 17 ». */
@media (max-width: 720px) {
  .visite-indice {
    display: flex; justify-content: flex-end; gap: 8px; margin: -8px 0 10px;
    font-size: 0.85rem; font-weight: 600; color: var(--accent);
  }
  .visite-indice [data-rail-pos] { color: var(--encre-3); font-weight: 500; }
  .visite-indice.est-au-bout { color: var(--encre-3); }
  .visite-grille {
    grid-template-columns: none;
    grid-auto-flow: column; grid-auto-columns: 84%;
    gap: 14px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 var(--gouttiere);
    margin: 0 calc(var(--gouttiere) * -1);
    padding: 4px var(--gouttiere) 14px;
    scrollbar-width: none;
  }
  .visite-grille::-webkit-scrollbar { display: none; }
  .visite-grille > li,
  .visite-grille > li:nth-last-child(2):nth-child(3n + 1),
  .visite-grille > li:last-child:nth-child(odd) { grid-column: auto; scroll-snap-align: start; }
  .carte-module:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logiciel__mode i::after, .tdb-point::after, .tdb-auto i { animation: none; }
  .carte-module, .carte-module__lien svg { transition: none; }
  .carte-module:hover { transform: none; }
  .tdb-flux__ligne.est-nouveau { animation: none; }
}

/* Briques communes aux aperçus des cartes (_cartes/*.css) */
.carte-module__ecran .tc-av {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #FFFFFF;
  font-size: 0.55rem; font-weight: 600;
}
.carte-module__ecran .tc-av:nth-child(4n+2) { background: var(--sauge); }
.carte-module__ecran .tc-av:nth-child(4n+3) { background: #5E4B4E; }
.carte-module__ecran .tc-av:nth-child(4n+4) { background: #6D5A6F; }
