/* Portail client : ligne d'avancement segmentee + animations natives (aucune bibliotheque). */

/* ---------- Ligne d'avancement : une etape = un point, relie a la suivante ---------- */
.parcours { list-style: none; display: flex; padding: 0; margin: 0 0 30px; }
.etape { position: relative; flex: 1; min-width: 0; padding-top: 0; }
.etape:last-child { flex: 0 0 auto; }
.etape-lien { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-decoration: none; color: var(--text-muted); font-size: 13px; line-height: 17px; padding-right: 10px; }
.etape-point { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-faint); box-shadow: 0 0 0 5px var(--bg); position: relative; z-index: 1; transition: scale .2s cubic-bezier(.34,1.56,.64,1); }
.etape-lien:hover .etape-point { scale: 1.12; }
.etape-lien:hover .etape-nom { color: var(--text); }
.etape--fini .etape-point { background: var(--yellow); color: #000000; border-color: var(--yellow); }
.etape--actif .etape-point { background: var(--yellow); color: #000000; border-color: var(--yellow); animation: halo 2.4s ease-in-out infinite; }
.etape--actif .etape-nom { color: var(--text); font-weight: 600; }
.etape--avenir .etape-nom { color: var(--text-faint); }
.etape-ligne { position: absolute; top: 14px; left: 30px; right: 0; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.etape-ligne i { display: block; height: 100%; width: 100%; background: var(--yellow); transform-origin: left; transform: scaleX(0); }
.etape--fini .etape-ligne i { transform: scaleX(1); }
.js .etape-point { opacity: 0; }
.js .etape--fini .etape-ligne i { transform: scaleX(0); }
.js .reveal { opacity: 0; }

/* ---------- Animations natives ---------- */
html { scroll-behavior: smooth; }
.phase { scroll-margin-top: 20px; }
.phase:target { animation: flash 1.4s ease; }

/* entree echelonnee de la page */
.main > * { animation: monter .65s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--n, 0) * 80ms); }
.main > :nth-child(2) { --n: 1; } .main > :nth-child(3) { --n: 2; } .main > :nth-child(4) { --n: 3; } .main > :nth-child(5) { --n: 4; }
/* blocs plus bas : apparaissent au defilement (classe ajoutee par portail.js) */
.reveal { animation: none !important; }

.jauge-barre div { transform-origin: left; animation: remplissage 1.2s cubic-bezier(.2,.7,.2,1) .3s both; position: relative; overflow: hidden; }
.jauge-barre div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-100%); animation: reflet 2.8s ease-in-out 1.6s infinite; }

.js .jauge-barre div { animation: none; transform: scaleX(0); }
.jalon--fait .jalon-point::after { animation: pop-coche .45s cubic-bezier(.34,1.56,.64,1) both; }
.phase--actif { animation: monter .65s cubic-bezier(.2,.7,.2,1) both, lueur 3.2s ease-in-out 1s infinite; }
.panel { transition: border-color .25s, transform .25s, box-shadow .25s; }
.phase:hover { transform: translateY(-2px); }
.bouton { transition: transform .12s, filter .15s, box-shadow .2s; }
.bouton:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(var(--accent-rgb,249,192,65),.25); }
.bouton:active { transform: scale(.97); }

/* trait de lecture en haut de page (suit le defilement, navigateurs recents) */
@supports (animation-timeline: scroll()) {
  body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--yellow); transform-origin: left; transform: scaleX(0); animation: lecture linear both; animation-timeline: scroll(root); z-index: 50; }
}

/* petite celebration quand de nouveaux points sont valides */
.eclat { position: fixed; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; z-index: 60; }
.felicitation { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 14px 20px; border-radius: 14px; background: rgba(var(--accent-rgb,249,192,65),.1); border: 1px solid rgba(var(--accent-rgb,249,192,65),.5); font-size: 14.5px; }
.felicitation strong { color: var(--yellow); }
.felicitation-icone { font-size: 22px; animation: tada 1.2s ease .5s both; }

.apercu { background: rgba(var(--accent-rgb,249,192,65),.14); border-bottom: 1px solid rgba(var(--accent-rgb,249,192,65),.5); padding: 10px 20px; text-align: center; font-size: 13.5px; color: var(--text); }

@keyframes monter { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop-coche { 0% { opacity: 0; transform: rotate(45deg) scale(0); } 100% { opacity: 1; transform: rotate(45deg) scale(1); } }
@keyframes remplir { from { opacity: 0; transform: scale(.55); } }
@keyframes pop { 0% { opacity: 0; transform: scale(0) rotate(-30deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes remplissage { from { transform: scaleX(0); } }
@keyframes reflet { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes halo { 0%, 100% { box-shadow: 0 0 0 4px var(--bg), 0 0 12px rgba(var(--accent-rgb,249,192,65),.5); } 50% { box-shadow: 0 0 0 4px var(--bg), 0 0 24px rgba(var(--accent-rgb,249,192,65),.95); } }
@keyframes respire { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb,249,192,65),.45); } 50% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb,249,192,65),0); } }
@keyframes lueur { 0%, 100% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb,249,192,65),.08), 0 14px 40px rgba(var(--accent-rgb,249,192,65),.04); } 50% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb,249,192,65),.25), 0 14px 50px rgba(var(--accent-rgb,249,192,65),.14); } }
@keyframes flash { 0%, 100% { background: var(--surface); } 30% { background: rgba(var(--accent-rgb,249,192,65),.12); } }
@keyframes lecture { to { transform: scaleX(1); } }
@keyframes tada { 0% { transform: scale(1); } 15% { transform: scale(1.3) rotate(-10deg); } 30% { transform: scale(1.3) rotate(10deg); } 45% { transform: scale(1.2) rotate(-6deg); } 60%, 100% { transform: scale(1) rotate(0); } }

@media (max-width: 760px) {
  .parcours { flex-direction: column; gap: 16px; }
  .etape, .etape:last-child { flex: none; }
  .etape-lien { flex-direction: row; align-items: center; gap: 12px; }
  .etape-ligne { display: none; }
  .seg-bulle { white-space: normal; width: max-content; max-width: 70vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .js .etape-point, .js .reveal { opacity: 1 !important; }
  .js .etape--fini .etape-ligne i, .js .jauge-barre div { transform: none !important; }
}

/* ---------- Detail des etapes : blocs pliables ---------- */
.phase > summary { list-style: none; cursor: pointer; }
.phase > summary::-webkit-details-marker { display: none; }
.phase > summary h2 { margin: 0; }
.phase[open] > summary h2 { margin-bottom: 14px; }
.phase-chevron { width: 9px; height: 9px; border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint); transform: rotate(45deg); margin: -3px 2px 0 12px; transition: transform .25s cubic-bezier(.34,1.56,.64,1), border-color .2s; flex-shrink: 0; }
.phase[open] .phase-chevron { transform: rotate(225deg); margin-top: 3px; border-color: var(--yellow); }
.phase > summary:hover .phase-chevron { border-color: var(--yellow); }
.phase-corps { animation: monter .45s cubic-bezier(.2,.7,.2,1) both; }
.phase:not([open]) { padding-top: 18px; padding-bottom: 18px; }
.phase:not([open]):hover { border-color: rgba(var(--accent-rgb,249,192,65),.35); }
.phase:not([open])::after { display: none; }

/* Interactions */
.phase-corps { overflow: hidden; }
.js .phase-corps { animation: none; }
.phase > summary:active h2 { transform: scale(.995); }
.jalon { transition: background .2s, padding-left .2s; border-radius: 8px; }
.jalon:hover { background: rgba(255,255,255,.04); padding-left: 8px; }
.etape-lien { position: relative; }
.etape-lien::after { content: attr(data-info); position: absolute; left: 0; top: calc(100% + 6px); background: #1C1C1C; border: 1px solid rgba(var(--accent-rgb,249,192,65),.45); color: var(--text); font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 9px; white-space: nowrap; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; z-index: 5; box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.etape-lien:hover::after, .etape-lien:focus-visible::after { opacity: 1; transform: none; }
.etape:last-child .etape-lien::after { left: auto; right: 0; }
@media (max-width: 760px) { .etape-lien::after { display: none; } }
.alerte .bouton--alerte { transition: transform .15s, box-shadow .2s; }
.alerte .bouton--alerte:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 28px rgba(0,0,0,.4); }

/* Notification de paiement : toujours rouge, toujours la première chose visible (collée en haut quand on défile) */
.alerte--attente { background: rgba(229,72,59,0.12); border-color: rgba(229,72,59,0.7); box-shadow: inset 0 1px 0 rgba(229,72,59,0.5), 0 18px 50px -20px rgba(229,72,59,0.4); }
.alerte--attente .alerte-icone { background: #e5483b; color: #FFFFFF; animation-name: pulse; }
.alerte--attente .bouton--alerte { background: #e5483b; color: #FFFFFF; }
.alerte { position: sticky; top: 12px; z-index: 30; background-color: rgba(28,28,28,0.92); backdrop-filter: blur(8px); }
.alerte--attente, .alerte--retard { background-image: linear-gradient(rgba(229,72,59,0.14), rgba(229,72,59,0.14)); }
@media (max-width: 760px) { .alerte { position: static; } }

/* Léger tremblement de la notification de paiement : une fois à l'apparition, discret ensuite (voir portail.js) */
@keyframes tremble { 0%, 100% { translate: 0 0; } 15% { translate: -5px 0; } 30% { translate: 5px 0; } 45% { translate: -4px 0; } 60% { translate: 3px 0; } 78% { translate: -2px 0; } }
.alerte { animation: monter .65s cubic-bezier(.2,.7,.2,1) both, tremble .8s ease-in-out 1.1s 1 both; }
@media (prefers-reduced-motion: reduce) { .alerte { animation: none; } }

/* Rendez-vous de l'atelier stratégique : date sous l'étape et mot discret dans son bloc */
.atelier-note { margin: 0 0 14px; padding: 12px 16px; border-left: 3px solid var(--yellow); background: rgba(var(--accent-rgb,249,192,65),0.06); border-radius: 0 10px 10px 0; color: var(--text-muted); font-size: 14px; line-height: 22px; }
.atelier-note strong { color: var(--text); }
.atelier-note a { color: var(--yellow); }

/* Etape en cours : un trait de lumiere fait le tour du bloc en permanence, sur un halo qui respire. */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.phase--actif { position: relative; border-color: rgba(var(--accent-rgb,249,192,65),.35); }
.phase--actif::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 62%, rgba(var(--accent-rgb,249,192,65),.35) 78%, var(--yellow) 92%, #fff 97%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: tour 5s linear infinite;
}
@keyframes tour { to { --angle: 360deg; } }
@keyframes lueur { 0%, 100% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb,249,192,65),.10), 0 10px 40px rgba(var(--accent-rgb,249,192,65),.08); } 50% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb,249,192,65),.30), 0 14px 64px rgba(var(--accent-rgb,249,192,65),.24); } }
@media (prefers-reduced-motion: reduce) { .phase--actif::before { animation: none; background: rgba(var(--accent-rgb,249,192,65),.5); } }

/* Notification de reglement : deux feux rouges opposes tournent autour du cadre, comme un gyrophare discret. */
.alerte::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 8%, rgba(255,92,76,.95) 16%, transparent 28%, transparent 58%, rgba(255,92,76,.95) 66%, transparent 78%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: tour 3.4s linear infinite;
}
.alerte--attente, .alerte--retard { animation: monter .65s cubic-bezier(.2,.7,.2,1) both, tremble .8s ease-in-out 1.1s 1 both, halo-rouge 3.4s ease-in-out infinite; }
@keyframes halo-rouge { 0%, 100% { box-shadow: 0 0 0 1px rgba(229,72,59,.15), 0 10px 40px -12px rgba(229,72,59,.30); } 50% { box-shadow: 0 0 0 1px rgba(229,72,59,.35), 0 14px 56px -8px rgba(229,72,59,.55); } }
@media (prefers-reduced-motion: reduce) { .alerte::before { animation: none; background: rgba(229,72,59,.6); } .alerte--attente, .alerte--retard { animation: none; } }

/* Rendez-vous de l'atelier sous l'etape : tuile jour / mois + heure */
.etape-date { display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; padding: 4px 10px 4px 4px; border-radius: 10px; border: 1px solid rgba(var(--accent-rgb,249,192,65),.35); background: linear-gradient(135deg, rgba(var(--accent-rgb,249,192,65),.12), rgba(var(--accent-rgb,249,192,65),.03)); }
.rdv-tuile { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 30px; padding: 3px 0 2px; border-radius: 7px; background: var(--yellow); color: #000; line-height: 1; }
.rdv-tuile b { font-size: 14px; font-weight: 800; letter-spacing: -.5px; }
.rdv-tuile i { margin-top: 1px; font-style: normal; font-size: 8px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.rdv-texte { display: flex; flex-direction: column; gap: 2px; text-align: left; line-height: 1.1; }
.rdv-texte strong { font-size: 12.5px; font-weight: 700; color: var(--text); letter-spacing: -.2px; white-space: nowrap; }
.rdv-texte small { font-size: 10px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.rdv-texte small::first-letter { text-transform: uppercase; }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.etape-date--passe { gap: 6px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--yellow); border-color: rgba(var(--accent-rgb,249,192,65),.25); background: rgba(var(--accent-rgb,249,192,65),.06); }
.etape-date--passe .ico { width: 1.15em; height: 1.15em; margin: 0; flex-shrink: 0; }
