/* d.css : support D, démo de l'espace d'un salarié (/entreprises/demo/).
   L'espace d'Alex est montré dans un téléphone, posé sur une bande anis à bulles (charte happyfizz.fr, rajeunie) :
   à gauche ce que regarde le DRH, à droite l'écran du salarié.
   Seulement ce que hf.css n'a pas. Les couleurs vives restent des aplats ; le texte est gris foncé.
   Animations : seulement si le lecteur ne les a pas réduites ; la page est complète sans elles. */

.d-page { position: relative; background: var(--blanc); padding-block: 0 3.5rem; }
.d-page + .pied { margin-top: 0; }

/* La bande anis du haut, à bord courbe, derrière le titre et le haut du téléphone */
.d-fond {
  position: absolute; inset: 0 0 auto 0; height: clamp(24rem, 20rem + 12vw, 31rem); overflow: hidden;
  background: var(--anis);
  border-radius: 0 0 50% 50% / 0 0 clamp(1.5rem, 4vw, 4rem) clamp(1.5rem, 4vw, 4rem);
}
@media (min-width: 960px) { .d-fond { height: 43rem; } }
.d-fond .bulles span:nth-child(1) { width: 10rem; height: 10rem; left: -3.5rem; top: -3.5rem; }
.d-fond .bulles span:nth-child(2) { width: 3.5rem; height: 3.5rem; left: 7.5rem; top: 1rem; opacity: 0.65; }
.d-fond .bulles span:nth-child(3) { width: 1.75rem; height: 1.75rem; left: 12rem; top: 4.5rem; }
.d-fond .bulles span:nth-child(4) { width: 7rem; height: 7rem; left: 38%; bottom: -2.5rem; opacity: 0.3; }
.d-fond .bulles span:nth-child(5) { width: 2.5rem; height: 2.5rem; left: 46%; top: 2rem; background: var(--turq); opacity: 0.95; }
.d-fond .bulles span:nth-child(6) { width: 13rem; height: 13rem; right: -5rem; top: 6rem; opacity: 0.3; }
.d-fond .bulles span:nth-child(7) { width: 1.5rem; height: 1.5rem; left: 3%; bottom: 3.5rem; background: var(--mauve); opacity: 0.95; }

.d-scene { position: relative; display: grid; gap: 2rem; align-items: start; padding-top: clamp(1.75rem, 1.25rem + 2.5vw, 3.5rem); }
.d-scene > * { min-width: 0; }
@media (min-width: 960px) {
  .d-scene { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: 4.5rem; }
  .d-guide { position: sticky; top: 4.5rem; }
}
.d-page h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); line-height: 1; }
.d-h1-suite { display: block; width: fit-content; margin-top: 0.18em; padding: 0.06em 0.22em 0.1em; background: var(--encre); color: var(--blanc); }
.d-chapo { font-size: 1.0625rem; max-width: 34rem; }
.d-guide .encadre { background: var(--blanc); border-left-color: var(--encre); box-shadow: var(--ombre); }

/* Les repères du DRH : une bulle par point à regarder */
.d-reperes { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.d-reperes li { position: relative; display: flex; flex-direction: column; gap: 0.1rem; padding-left: 2.75rem; }
.d-reperes li::before { content: ""; position: absolute; left: 0; top: 0.1rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--blanc); }
.d-reperes strong { font-family: var(--police-titre); font-size: 1.1875rem; font-weight: 700; line-height: 1.2; }
.d-vous { padding: 1rem 1.25rem; background: var(--encre); color: var(--blanc); }

/* ---------- Le téléphone ---------- */
.d-cadre { position: relative; }
.d-tel {
  position: relative; display: flex; flex-direction: column; gap: 0.85rem;
  padding: 0.85rem 0.85rem 0; background: var(--fond);
  border: 3px solid var(--encre); border-radius: 1.5rem; overflow: clip;
}
@media (min-width: 960px) {
  .d-tel { padding-top: 0; border-width: 12px; border-radius: 3rem; box-shadow: 0 50px 80px -45px rgba(0, 0, 0, 0.7), 14px 14px 0 var(--turq); }
}
.d-tel-haut { display: flex; justify-content: center; padding-top: 0.6rem; }
.d-encoche { width: 6.5rem; height: 1.4rem; border-radius: 999px; background: var(--encre); }
@media (max-width: 959px) { .d-tel-haut { display: none; } }

/* Dans le téléphone : une application, donc des cartes rondes et serrées */
.d-tel .carte { padding: 1rem; border: 0; border-radius: 1.25rem; gap: 0.7rem; box-shadow: 0 8px 22px -16px rgba(0, 0, 0, 0.45); }
.d-tel .carte.c-anis, .d-tel .carte.c-mauve { border-top: 0; }
.d-tel h2 { font-size: 1.75rem; text-transform: none; }
.d-tel h3 { font-size: 1.1875rem; }
.d-tel .bouton-contour { align-self: stretch; border-radius: 999px; font-size: 0.9375rem; }
.d-tel .pastille { font-size: 0.8125rem; }

/* D1 · Accueil */
.d-accueil { display: flex; align-items: center; gap: 0.85rem; padding: 0.5rem 0.15rem 0; }
.d-accueil-texte { gap: 0.3rem; min-width: 0; }
.d-avatar {
  flex: 0 0 auto; width: 3.75rem; height: 3.75rem; border-radius: 50%; background: var(--c);
  display: grid; place-items: center; font-family: var(--police-titre); font-weight: 700; font-size: 1.6rem; color: var(--encre);
}
.d-avatar.d-petit { width: 2.5rem; height: 2.5rem; font-size: 1.0625rem; }

/* D2 · L'anneau des séances et les phases */
.d-avance { display: flex; align-items: center; gap: 1rem; }
.d-avance-texte { gap: 0.15rem; }
.d-anneau { flex: 0 0 auto; }
.d-anneau-fond { stroke: var(--fond); }
.d-anneau-fait { stroke: var(--turq); stroke-dashoffset: 0; }
.d-anneau-texte { font-family: var(--police-titre); font-size: 28px; font-weight: 700; fill: var(--encre); }

.d-phases { list-style: none; padding: 0; display: flex; flex-direction: column; }
.d-phase { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: 0 0 1rem 2.4rem; }
.d-phase:last-child { padding-bottom: 0; }
.d-phase::before {
  content: ""; position: absolute; left: 0; top: 0.1rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--blanc); border: 2px dashed var(--bord-fort);
}
.d-phase::after { content: ""; position: absolute; left: calc(0.75rem - 1.5px); top: 1.85rem; bottom: 0.15rem; width: 3px; background: var(--fond); }
.d-phase:last-child::after { display: none; }
.d-phase > strong { font-family: var(--police-titre); font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.d-faite::before { background: var(--turq); border: 0; }
.d-faite::after { background: var(--turq); }
.d-en-cours::before { background: var(--anis); border: 0; }
.d-phase .pastille { margin-top: 0.25rem; }

/* D3 · Le rendez-vous : une petite page de calendrier */
.d-rdv { display: flex; align-items: center; gap: 0.9rem; }
.d-date {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; line-height: 1.05;
  min-width: 3.9rem; padding: 0.4rem 0.6rem 0.5rem; background: var(--blanc); border-radius: 0.9rem;
  border-top: 8px solid var(--encre); font-family: var(--police-titre); font-size: 0.8125rem; font-weight: 500; text-transform: uppercase;
}
.d-date strong { font-size: 2rem; font-weight: 700; }

/* D4 · Une tâche : la case est dessinée, elle ne se coche pas (démonstration) */
.d-tache { padding-left: 2.1rem; position: relative; }
.d-tache::before { content: ""; position: absolute; left: 0; top: 50%; width: 1.3rem; height: 1.3rem; margin-top: -0.65rem; border: 2px solid var(--bord-fort); border-radius: 6px; background: var(--blanc); }
.d-tache-faite::before { background: var(--turq); border-color: var(--turq); }
.d-tache-faite::after { content: ""; position: absolute; left: 0.45rem; top: 50%; width: 0.35rem; height: 0.7rem; margin-top: -0.5rem; border: solid var(--encre); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.d-sous-titre { margin: 1rem 0 0.25rem; font-size: 0.9375rem; color: var(--encre-douce, inherit); }

/* D5 · Les documents : une feuille au coin plié devant chaque ligne */
.d-doc { position: relative; padding-left: 2.6rem; }
.d-doc::before {
  content: ""; position: absolute; left: 0.15rem; top: 50%; width: 1.5rem; height: 1.9rem; margin-top: -0.95rem;
  background: linear-gradient(225deg, var(--blanc) 0.42rem, var(--turq) 0.42rem); border-radius: 3px;
}
.d-doc-attente::before { background: linear-gradient(225deg, var(--blanc) 0.42rem, var(--bord) 0.42rem); }

/* D6 · Qui a le droit de lire : oui, oui, oui, non */
.d-lecteurs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.d-lecteurs li { position: relative; padding: 0.35rem 0.8rem 0.35rem 2rem; background: var(--blanc); border-radius: 999px; font-weight: 600; font-size: 0.875rem; }
.d-lecteurs li::before { content: ""; position: absolute; left: 0.55rem; top: 50%; width: 1.05rem; height: 1.05rem; margin-top: -0.525rem; border-radius: 50%; background: var(--turq); }
.d-lecteurs .d-oui::after { content: ""; position: absolute; left: 0.9rem; top: 50%; width: 0.3rem; height: 0.55rem; margin-top: -0.38rem; border: solid var(--encre); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.d-lecteurs .d-non { background: var(--encre); color: var(--blanc); }
.d-lecteurs .d-non::before { background: var(--blanc); }
.d-lecteurs .d-non::after { content: ""; position: absolute; left: 0.72rem; top: 50%; width: 0.7rem; height: 2.5px; margin-top: -1px; background: var(--encre); transform: rotate(-45deg); }

/* D7 · Ce que reçoit l'employeur : trois feuilles */
.d-pieces { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.d-pieces li { position: relative; padding: 0.55rem 2rem 0.55rem 0.8rem; background: var(--fond); font-weight: 600; }
.d-pieces li::after { content: ""; position: absolute; top: 0; right: 0; width: 1.1rem; height: 1.1rem; background: linear-gradient(225deg, var(--blanc) 50%, var(--gris) 50%); }

/* D8 · Contacts */
.d-contact > :nth-child(2) { flex: 1 1 9rem; min-width: 0; }
.d-contact > :first-child { flex: 0 0 auto; }

/* La barre du bas : reste collée en bas de l'écran tant qu'on est dans l'espace d'Alex */
.d-onglets {
  position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem;
  margin-inline: -0.85rem; padding: 0.4rem 0.6rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: var(--blanc); box-shadow: 0 -8px 20px -14px rgba(0, 0, 0, 0.4);
}
.d-onglets a {
  display: flex; align-items: center; justify-content: center; min-height: var(--cible);
  border-radius: 999px; font-family: var(--police-titre); font-weight: 700; text-transform: uppercase; font-size: 0.9375rem;
  text-decoration: none; color: var(--encre);
}
.d-onglets a:hover, .d-onglets a:focus-visible { background: var(--anis); }
.d-tel [id] { scroll-margin-top: 6rem; }

/* ---------- Mouvement ---------- */
@keyframes d-anneau { from { stroke-dashoffset: 113.1; } to { stroke-dashoffset: 0; } }
@keyframes d-pouls { 0% { box-shadow: 0 0 0 0 rgba(223, 220, 0, 0.8); } 100% { box-shadow: 0 0 0 0.7rem rgba(223, 220, 0, 0); } }
@keyframes d-monte { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes d-entre { from { opacity: 0; transform: translateY(26px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .d-guide > * { animation: d-monte 0.6s ease-out both; }
  .d-guide > :nth-child(2) { animation-delay: 0.08s; }
  .d-guide > :nth-child(3) { animation-delay: 0.16s; }
  .d-guide > :nth-child(4) { animation-delay: 0.24s; }
  .d-guide > :nth-child(5) { animation-delay: 0.32s; }
  .d-guide > :nth-child(6) { animation-delay: 0.4s; }
  .d-guide > :nth-child(7) { animation-delay: 0.48s; }
  .d-cadre { animation: d-entre 0.9s 0.15s ease-out both; }
  .d-anneau-fait { animation: d-anneau 1.3s 0.6s ease-out both; }
  .d-en-cours::before { animation: d-pouls 1.8s ease-out infinite; }
}

@media print {
  .d-fond, .d-onglets, .d-tel-haut { display: none; }
  .d-scene { padding-top: 0.5rem; }
  .d-h1-suite { display: inline; background: none; color: #000000; padding: 0; }
  .d-tel { border: 1px dashed #888888; border-radius: 8px; box-shadow: none; background: none; }
  .d-guide > *, .d-cadre, .d-anneau-fait { animation: none; opacity: 1; transform: none; }
  .d-vous { background: none; color: #000000; border: 1px solid #000000; }
  .d-guide { position: static; }
}

/* Sur la bande anis, les petites capitales passent en gris foncé (contraste) */
.d-guide > .etiquette { color: var(--encre); }

/* ---------- Dernière passe : des visages, et des repères qui suivent l'écran ---------- */
.d-avatar { overflow: hidden; }
img.d-avatar { object-fit: cover; object-position: 50% 12%; padding: 0; }
img.d-logo { object-fit: contain; background: var(--blanc); border: 1px solid var(--bord); padding: 0.2rem; }
.d-entre { font-size: 1.0625rem; }
/* Le repère du bloc affiché dans le téléphone s'allume ; une flèche à la main montre l'écran (ordinateur) */
.d-reperes li { transition: transform 0.3s ease; }
.d-reperes li::before { transition: transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
.d-fleche { display: none; }
@media (min-width: 960px) {
  .d-fleche { display: block; position: absolute; right: -4.25rem; top: -0.4rem; width: 5.5rem; height: 2.5rem; opacity: 0; transition: opacity 0.3s ease; }
  .d-fleche path { stroke-dashoffset: 1; transition: stroke-dashoffset 0.6s ease-out; }
  .d-reperes li.actif { transform: translateX(8px); }
  .d-reperes li.actif::before { transform: scale(1.35); }
  .d-reperes li.actif .d-fleche { opacity: 1; }
  .d-reperes li.actif .d-fleche path { stroke-dashoffset: 0; }
  .d-reperes li.actif .d-fleche path + path { transition-delay: 0.45s; }
  .d-reperes li:not(.actif) strong { color: var(--texte-2); }
  html:not(.js-anime) .d-reperes li strong { color: var(--encre); }
}
/* Téléphone : l'essentiel d'abord. Le titre, puis l'écran d'Alex ; les repères (utiles côte à côte) et le retour passent après. */
@media (max-width: 959px) {
  .d-guide { display: contents; }
  .d-cadre { order: 1; }
  .d-entre, .d-reperes { display: none; }
  .d-guide > p:last-child { order: 2; }
}
@keyframes d-salut { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 60% { transform: rotate(9deg); } }
@media (prefers-reduced-motion: no-preference) {
  .d-salut { animation: d-salut 1.1s 1s ease-in-out 2; }
  .d-contact:hover .d-avatar { transform: scale(1.12) rotate(-6deg); }
  .d-contact .d-avatar { transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
}

/* Accroche : ce que l'espace apporte, au salarié et à l'entreprise. Sur la bande anis, le surlignage est blanc. */
.d-promesse { font-family: var(--police-titre); font-size: clamp(1.25rem, 1rem + 1.2vw, 1.7rem); font-weight: 500; line-height: 1.35; max-width: 36rem; }
.d-pour { font-weight: 700; }
.d-surligne { background: linear-gradient(var(--blanc), var(--blanc)) no-repeat 0 90% / 100% 46%; padding-inline: 0.12em; }
@media (prefers-reduced-motion: no-preference) {
  .d-surligne { animation: d-trait 0.9s 0.6s ease-out both; }
}
@keyframes d-trait { from { background-size: 0 46%; } to { background-size: 100% 46%; } }
@media print { .d-surligne { background: none; animation: none; } }
