/* FlowIoT — mises en situation (/cas-usage/)
   Complément à style.css : réutilise les mêmes variables (:root), le même
   header et les mêmes boutons. Ne redéfinit ici que la scène interactive. */

html, body { height: 100%; }
body.uc-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== Header en version statique (la landing l'utilise en fixed) ===== */
.header--static {
  position: relative;
  padding: 10px 0;
  background: rgba(10, 15, 31, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 40;
}
.header--static .brand img { height: 56px; }

/* ===== Animations d'entrée (rejouées à chaque changement de cas d'usage) ===== */
@keyframes uc-enter-left {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes uc-enter-right {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes uc-enter-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes uc-enter-pop {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
.uc-anim-right { animation: uc-enter-right .55s var(--ease) both; }
.uc-anim-up    { animation: uc-enter-up .5s var(--ease) both; }
.uc-anim-pop   { animation: uc-enter-pop .4s var(--ease) both; }

/* ===== Scène ===== */
.uc {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===== Illustration + étapes ===== */
.uc__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 16px 24px;
}
.uc__figure {
  position: relative;
  animation: uc-scene-float 7s ease-in-out infinite;
  width: 100%;
  max-width: 880px;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uc__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 28px 56px rgba(110, 63, 224, .22))
          drop-shadow(0 8px 20px rgba(200, 64, 166, .13));
  transition: opacity .3s var(--ease), transform .3s var(--ease), filter .3s var(--ease);
}
.uc__img.is-out {
  opacity: 0;
  transform: translateX(-30px);
  filter: blur(4px);
}
.uc__img.is-in {
  opacity: 0;
  transform: translateX(30px);
  filter: blur(6px);
}
@keyframes uc-scene-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.uc__steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.uc__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  animation: uc-hint 2.5s ease-in-out infinite;
}
.uc__hint[hidden] { display: none; }
@keyframes uc-hint {
  0%, 100% { opacity: 0; transform: translateY(4px); }
  25%, 75% { opacity: 1; transform: translateY(0); }
}
.uc__dots { display: flex; align-items: center; gap: 12px; }
.uc__dot { animation: uc-enter-up .45s var(--ease) both; }
.uc__dot:nth-child(2) { animation-delay: .06s; }
.uc__dot:nth-child(3) { animation-delay: .12s; }
.uc__dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, .3);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.uc__dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  transition: background .25s var(--ease);
}
.uc__dot:hover { border-color: var(--border-strong); }
.uc__dot[aria-current="true"] {
  background: rgba(110, 63, 224, .2);
  border-color: rgba(155, 123, 238, .5);
  color: #9B7BEE;
}
.uc__dot[aria-current="true"]::before {
  background: linear-gradient(90deg, #9B7BEE, var(--magenta));
}

/* ===== Cartel (haut droite) ===== */
.uc__cartel {
  position: absolute;
  top: 24px; right: 24px;
  z-index: 5;
  width: 236px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(12, 18, 38, .72);
  border: 1px solid var(--uc-accent-soft, var(--border));
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}
.uc__cartel-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--uc-accent, var(--cyan));
}
.uc__cartel-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  background-image: var(--uc-gradient, var(--grad-brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.uc__cartel-desc {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.uc__cartel-sep { height: 1px; background: var(--uc-accent-soft, var(--border)); }
.uc__cartel-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.uc__cartel-list li {
  position: relative;
  padding-left: 12px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text);
}
.uc__cartel-list li::before {
  content: '';
  position: absolute;
  top: 7px; left: 0;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--uc-accent, var(--cyan));
}
.uc__cartel-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--emerald);
  background: rgba(31, 224, 163, .12);
}

/* ===== Carte dashboard (bas gauche) ===== */
.uc__dash {
  position: absolute;
  left: 5%;
  bottom: 48px;
  z-index: 3;
  width: 340px;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.uc__dash[data-hidden="true"] {
  transform: translateX(-400px);
  opacity: 0;
  pointer-events: none;
}
.uc__dash-tab,
.uc__dash-handle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(14, 21, 48, .85);
  border: 1px solid rgba(110, 63, 224, .25);
  color: var(--text-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.uc__dash-tab {
  position: absolute;
  top: -31px; left: 16px;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}
.uc__dash-tab::before,
.uc__dash-handle::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9B7BEE;
}
.uc__dash-tab svg { transition: transform .3s var(--ease); }
.uc__dash[data-hidden="true"] .uc__dash-tab svg { transform: rotate(180deg); }

.uc__dash-handle {
  position: absolute;
  left: 0; bottom: 30%;
  z-index: 3;
  border-left: none;
  border-radius: 0 12px 12px 0;
  writing-mode: vertical-rl;
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: none;
}
.uc__dash-handle[data-visible="true"] {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.uc__card {
  border-radius: var(--radius);
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
  overflow: hidden;
  background: rgba(14, 21, 48, .75);
  border: 1px solid rgba(110, 63, 224, .25);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(110, 63, 224, .08);
  backdrop-filter: blur(20px);
  animation: uc-float 4s ease-in-out infinite;
}
@keyframes uc-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.uc__card.uc-anim-left {
  animation: uc-enter-left .6s var(--ease) both, uc-float 4s ease-in-out infinite .6s;
}
/* Seuil dépassé : la carte se souligne en rouge et la pastille bat. */
.uc__card.is-alert {
  border-color: rgba(255, 90, 110, .45);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 90, 110, .18);
}
@keyframes uc-alert {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}
.uc__pill.is-alert { animation: uc-alert 1.6s ease-in-out infinite; }
.uc__card-chrome {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.uc__card-chrome span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.uc__card-chrome span:nth-child(1) { background: #FF5A6E; }
.uc__card-chrome span:nth-child(2) { background: var(--amber); }
.uc__card-chrome span:nth-child(3) { background: var(--emerald); }
.uc__card-head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.uc__card-head h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.uc__card-head p { font-size: 0.72rem; color: var(--text-muted); }
.uc__card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 20px;
}

/* Ligne titre + pastille d'état */
.uc__metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.uc__metric-index {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--text-muted);
}
.uc__metric-name { font-size: 0.85rem; font-weight: 700; }
.uc__pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Donut */
.uc__donut { position: relative; width: 160px; height: 160px; }
.uc__donut svg { transform: rotate(-90deg); }
.uc__donut-track { fill: none; stroke-width: 24; }
.uc__donut-value {
  fill: none;
  stroke-width: 24;
  stroke-linecap: butt;
  transition: stroke-dasharray .7s var(--ease), stroke .4s var(--ease);
}
.uc__donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.uc__donut-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.uc__donut-num {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.uc__donut-unit { font-size: 0.66rem; color: var(--text-muted); }

/* Légende */
.uc__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}
.uc__legend div { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-muted); }
.uc__legend i {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.uc__legend b { color: var(--text); font-weight: 600; }

.uc__sep { width: 100%; height: 1px; background: rgba(110, 63, 224, .2); }

/* Tuiles secondaires */
.uc__tiles { display: flex; gap: 8px; width: 100%; }
.uc__tile {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 63, 224, .25);
  background: rgba(110, 63, 224, .18);
}
.uc__tile--accent {
  border-color: rgba(200, 64, 166, .2);
  background: rgba(200, 64, 166, .15);
}
.uc__tile-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.uc__tile-value { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.uc__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.uc__row span { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.uc__row b { font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.uc__note { font-size: 0.72rem; line-height: 1.5; color: var(--text-muted); text-align: center; }

/* ===== Pin + bulle explicative ===== */
.uc__pin-wrap {
  position: absolute;
  left: 62%; bottom: 42%;
  z-index: 3;
}
.uc__pin-line {
  position: absolute;
  bottom: 100%; left: 50%;
  width: 1px; height: 48px;
  transform: translateX(-50%);
  background: linear-gradient(to top, var(--cyan), transparent);
}
.uc__pin {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: radial-gradient(circle, var(--cyan), #00B4C0);
  box-shadow: 0 0 16px rgba(0, 212, 224, .4);
  cursor: pointer;
  animation: uc-pulse 2s ease-in-out infinite;
}
.uc__pin::after {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text);
}
.uc__pin[aria-expanded="false"] {
  background: rgba(14, 21, 48, .85);
  box-shadow: none;
}
@keyframes uc-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.uc__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  pointer-events: none;
  animation: uc-burst .6s ease-out forwards;
}
@keyframes uc-burst {
  from { transform: scale(.5); opacity: .8; }
  to   { transform: scale(2.8); opacity: 0; }
}

.uc__callout {
  position: absolute;
  top: calc(100% + 16px);
  left: calc(100% + 16px);
  width: 300px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: rgba(12, 18, 38, .92);
  border: 1px solid rgba(0, 212, 224, .27);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 212, 224, .13);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.uc__callout::before {
  content: '';
  position: absolute;
  top: -7px; left: -7px;
  width: 12px; height: 12px;
  transform: rotate(45deg);
  background: rgba(12, 18, 38, .92);
  border: 1px solid rgba(0, 212, 224, .27);
  border-bottom: none;
  border-right: none;
}
.uc__pin[aria-expanded="false"] ~ .uc__callout,
.uc__pin[aria-expanded="false"] ~ .uc__pin-line {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.uc__callout.uc-anim-up,
.uc__mobile.uc-anim-up { animation: uc-enter-up .45s var(--ease) both; }
.uc__callout-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.uc__callout-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}
.uc__callout h3 { font-size: 0.9rem; font-weight: 700; }
.uc__callout p { font-size: 0.76rem; line-height: 1.6; color: var(--text-soft); }

/* Éléments réservés aux écrans étroits */
.uc__mobile,
.uc__switch { display: none; }

/* ===== Écrans étroits ===== */
@media (max-width: 1100px) {
  body.uc-body { overflow: auto; }
  .uc { overflow: visible; }
  .uc__pin-wrap,
  .uc__dash-handle { display: none; }

  .uc__stage {
    position: relative;
    inset: auto;
    padding: 24px 16px 8px;
  }
  .uc__figure { min-height: 240px; }
  .uc__img { max-height: 42vh; }

  .uc__cartel,
  .uc__dash {
    position: relative;
    inset: auto;
    left: auto; right: auto; bottom: auto; top: auto;
    width: min(100%, 420px);
    margin: 0 auto 20px;
    transform: none;
    opacity: 1;
  }
  .uc__dash[data-hidden="true"] { transform: none; opacity: 1; pointer-events: auto; }
  .uc__dash-tab { display: none; }
  .uc__card { animation: none; }

  .uc__switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: min(100%, 420px);
    margin: 16px auto 0;
    padding: 0 4px;
  }
  .uc__switch a {
    flex: 1 1 auto;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
  }
  .uc__switch a[aria-current="page"] {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-strong);
  }

  .uc__mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(100%, 420px);
    margin: 0 auto 20px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: rgba(12, 18, 38, .92);
    border: 1px solid rgba(0, 212, 224, .27);
  }
  .uc__mobile h3 { font-size: 0.9rem; font-weight: 700; }
  .uc__mobile p { font-size: 0.78rem; line-height: 1.6; color: var(--text-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .uc__card, .uc__pin, .uc__ring, .uc__hint,
  .uc__figure, .uc__cartel, .uc__dot, .uc__pill,
  .uc-anim-left, .uc-anim-right, .uc-anim-up, .uc-anim-pop { animation: none; }
  .uc__img, .uc__donut-value, .uc__dash, .uc__callout, .uc__card { transition: none; }
}
