/* Formulaire en étapes avec timeline (FERE & SANIYORO) */
form[data-steps] {
  --fs-primary: #0047ab;
  --fs-accent: #ff9100;
  --fs-line: #dde5f0;
  --fs-muted: #64748b;
  --fs-ink: #0f172a;
}

.fs-timeline {
  list-style: none;
  margin: 0 0 .9rem;
  padding: 0;
  display: flex;
  align-items: flex-start;
}
.fs-tl-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.fs-tl-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 3px;
  border-radius: 3px;
  background: var(--fs-line);
  transition: background .25s;
}
.fs-tl-item.is-done:not(:last-child)::after { background: var(--fs-primary); }
.fs-tl-dot {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--fs-line);
  background: #fff;
  color: var(--fs-muted);
  font: inherit;
  font-weight: 800;
  font-size: .95rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s;
}
.fs-tl-check { display: none; width: 20px; height: 20px; }
.fs-tl-item.is-done .fs-tl-dot { background: var(--fs-primary); border-color: var(--fs-primary); color: #fff; }
.fs-tl-item.is-done .fs-tl-num { display: none; }
.fs-tl-item.is-done .fs-tl-check { display: block; }
.fs-tl-item.is-active .fs-tl-dot { background: var(--fs-accent); border-color: var(--fs-accent); color: #fff; box-shadow: 0 0 0 6px rgba(255, 145, 0, .18); transform: scale(1.05); }
.fs-tl-label { margin-top: .45rem; font-size: .8rem; font-weight: 700; color: var(--fs-muted); line-height: 1.25; padding: 0 .2rem; }
.fs-tl-label small { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.fs-tl-item.is-active .fs-tl-label,
.fs-tl-item.is-done .fs-tl-label { color: var(--fs-ink); }

.fs-progress { height: 4px; border-radius: 4px; background: var(--fs-line); overflow: hidden; margin: 0 0 1.3rem; }
.fs-progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--fs-primary), var(--fs-accent)); transition: width .3s ease; }

form.fs-ready [data-step] { animation: fs-in .28s ease; }
form.fs-ready [data-step][hidden] { display: none !important; }
@keyframes fs-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.fs-nav { display: flex; justify-content: space-between; gap: .7rem; margin-top: 1.1rem; }
.fs-nav:only-child, .fs-nav > .fs-btn-next:only-child { margin-left: auto; }
.fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: 0 1.3rem;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.fs-btn:hover { transform: translateY(-1px); }
.fs-btn-next { margin-left: auto; background: var(--fs-primary); color: #fff; box-shadow: 0 8px 18px rgba(0, 71, 171, .22); }
.fs-btn-next:hover { background: #003a8c; }
.fs-btn-ghost { background: #fff; color: var(--fs-ink); border-color: var(--fs-line); }
.fs-btn-ghost:hover { border-color: var(--fs-primary); color: var(--fs-primary); }
[data-step-actions] .fs-nav { margin: 0 0 .8rem; }

/* Champs « chiffres clés » */
.fs-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.fs-count { display: flex; flex-direction: column; gap: .35rem; padding: .8rem .9rem; border: 1px solid var(--fs-line); border-radius: 14px; background: #f8fafc; }
.fs-count > span { font-size: .8rem; font-weight: 700; color: var(--fs-ink); display: flex; align-items: center; gap: .4rem; }
.fs-count > span i, .fs-count > span svg { color: var(--fs-primary); }
.fs-count input { width: 100%; border: 1px solid #d6dbe4; border-radius: 10px; height: 42px; padding: 0 .7rem; font: inherit; font-size: 1.05rem; font-weight: 700; background: #fff; box-sizing: border-box; }
.fs-count input:focus { outline: 2px solid rgba(0, 71, 171, .25); border-color: var(--fs-primary); }
.fs-count small { font-size: .72rem; color: var(--fs-muted); }

@media (max-width: 640px) {
  .fs-tl-label { font-size: 0; margin-top: .35rem; }
  .fs-tl-label small { font-size: .62rem; }
  .fs-tl-item.is-active .fs-tl-label { font-size: .74rem; }
  .fs-tl-dot { width: 34px; height: 34px; font-size: .85rem; }
  .fs-tl-item:not(:last-child)::after { top: 16px; left: calc(50% + 20px); right: calc(-50% + 20px); }
  .fs-nav { flex-wrap: wrap; }
  .fs-nav .fs-btn { flex: 1; }
}
