/* PrimeO Liquid Blueprint — schéma dynamique du parcours eau */

.cfg-ux-schema-band {
  margin-bottom: 28px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(165deg, var(--po-card) 0%, var(--po-bg-alt) 100%);
  border: 1px solid var(--po-sep);
  box-shadow: 0 20px 60px rgba(13, 71, 127, 0.08);
  position: relative;
}
[data-theme="dark"] .cfg-ux-schema-band {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  background: linear-gradient(165deg, rgba(255,255,255,0.06) 0%, rgba(13,19,32,0.95) 100%);
}

.cfg-ux-schema-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px 0;
}
.cfg-ux-schema-head .eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--po-blue);
}
.cfg-ux-schema-head .schema-meta {
  font-size: 12px; color: var(--po-ink-3);
  display: flex; align-items: center; gap: 10px;
}
.cfg-ux-schema-head .schema-pct {
  font-weight: 700; color: var(--po-ink); font-variant-numeric: tabular-nums;
}
.cfg-ux-schema-head .schema-pct strong { color: var(--po-blue); }

.cfg-schema {
  position: relative;
  padding: 28px 18px 24px;
  min-height: 220px;
  --schema-flow: 0;
}
.cfg-schema::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,113,227,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,113,227,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 55%, #000 20%, transparent 75%);
  pointer-events: none;
  opacity: 0.55;
}
[data-theme="dark"] .cfg-schema::before {
  background-image:
    linear-gradient(rgba(106,161,245,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106,161,245,0.06) 1px, transparent 1px);
}

/* Silhouette évier — fond décoratif */
.cfg-schema-sink {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: min(420px, 72%); height: 56px; opacity: 0.07; pointer-events: none;
}
.cfg-schema-sink path { fill: var(--po-brand); }

.cfg-schema-pipes {
  position: absolute; left: 6%; right: 6%; top: 50%;
  width: 88%; height: 48px; transform: translateY(-50%);
  overflow: visible; pointer-events: none;
}
.cfg-schema-pipe-bg {
  fill: none; stroke: var(--po-sep); stroke-width: 6;
  stroke-linecap: round;
}
.cfg-schema-pipe-flow {
  fill: none; stroke: url(#schema-water-grad); stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: calc(1000 - (1000 * var(--schema-flow) / 100));
  transition: stroke-dashoffset 0.85s cubic-bezier(0.25, 0.1, 0.25, 1);
  filter: drop-shadow(0 0 6px rgba(0,113,227,0.35));
}
.cfg-schema-pipe-glow {
  fill: none; stroke: rgba(0,113,227,0.15); stroke-width: 14;
  stroke-linecap: round; stroke-dasharray: 1000;
  stroke-dashoffset: calc(1000 - (1000 * var(--schema-flow) / 100));
  transition: stroke-dashoffset 0.85s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cfg-schema-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.cfg-schema-particle {
  position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 50%;
  background: var(--po-blue); opacity: 0;
  box-shadow: 0 0 10px rgba(0,113,227,0.6);
  animation: schemaParticle 3.2s linear infinite;
  animation-delay: calc(var(--i) * 0.55s);
}
@keyframes schemaParticle {
  0% { left: 8%; opacity: 0; transform: translateY(-50%) scale(0.5); }
  8% { opacity: 0.9; }
  92% { opacity: 0.7; }
  100% { left: 92%; opacity: 0; transform: translateY(-50%) scale(1); }
}

.cfg-schema-nodes {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; padding: 0 2%;
  min-height: 168px;
}

.cfg-schema-node {
  flex: 1; max-width: 148px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: none; background: transparent; cursor: pointer;
  padding: 0; font-family: inherit; text-align: center;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.cfg-schema-node:not(.is-terminal):hover { transform: translateY(-4px); }
.cfg-schema-node.is-terminal { cursor: default; pointer-events: none; }

.cfg-schema-node-card {
  width: 100%; padding: 14px 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1.5px solid var(--po-sep);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s, transform 0.35s;
  position: relative; overflow: hidden;
}
[data-theme="dark"] .cfg-schema-node-card {
  background: rgba(255,255,255,0.06);
}
.cfg-schema-node-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(0,113,227,0.08), transparent 70%);
  opacity: 0; transition: opacity 0.35s;
}
.cfg-schema-node.is-active .cfg-schema-node-card::after { opacity: 1; }

.cfg-schema-node.is-idle:not(.is-pure-lit):not(.is-pure-wait) .cfg-schema-node-card { opacity: 0.72; }
.cfg-schema-node.is-pure-wait .cfg-schema-node-card {
  opacity: 0.85;
  border-color: rgba(0, 113, 227, 0.18);
}
.cfg-schema-node.is-active .cfg-schema-node-card {
  border-color: var(--po-blue);
  box-shadow: 0 0 0 1px var(--po-blue), 0 12px 36px rgba(0,113,227,0.18);
  transform: scale(1.04);
}
.cfg-schema-node.is-done .cfg-schema-node-card {
  border-color: rgba(52,199,89,0.45);
  background: rgba(52,199,89,0.06);
  box-shadow: 0 8px 24px rgba(52,199,89,0.12);
}
.cfg-schema-node.is-pure-lit .cfg-schema-node-card {
  opacity: 1;
  border-color: rgba(0,113,227,0.5);
  background: linear-gradient(160deg, rgba(0,113,227,0.12), rgba(52,199,89,0.08));
  box-shadow: 0 0 24px rgba(0,113,227,0.2);
  animation: purePulse 2.5s ease-in-out infinite;
}
.cfg-schema-node.is-pure-lit .cfg-schema-node-icon {
  background: linear-gradient(165deg, var(--po-blue), #34c759);
  border-radius: 50%;
  animation: pureIconBob 2.4s ease-in-out infinite;
}
.cfg-schema-node.is-pure-lit .cfg-schema-node-icon .apei {
  color: #fff;
  font-size: 20px;
}
.cfg-schema-node.is-pure-lit .cfg-schema-node-value {
  color: var(--po-blue);
  font-weight: 700;
}
.cfg-schema-sparkle {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #5ac8fa; top: 12px; left: 18px;
  animation: schemaSparkle 2s ease-in-out infinite;
  pointer-events: none;
}
.cfg-schema-sparkle.s2 { top: auto; bottom: 14px; right: 16px; left: auto; animation-delay: 0.6s; background: #34c759; }
.cfg-schema-sparkle.s3 { top: 50%; right: 8px; left: auto; animation-delay: 1.1s; width: 4px; height: 4px; }
@keyframes schemaSparkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes pureIconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes purePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,113,227,0.15); }
  50% { box-shadow: 0 0 32px rgba(52,199,89,0.25); }
}

.cfg-schema-node-icon {
  width: 44px; height: 44px; margin: 0 auto 8px;
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--po-bg-alt); transition: all 0.35s;
}
.cfg-schema-node-icon .apei { font-size: 22px; color: var(--po-brand); line-height: 1; }
.cfg-schema-node.is-active .cfg-schema-node-icon {
  background: rgba(0,113,227,0.12);
  box-shadow: inset 0 0 0 1px rgba(0,113,227,0.2);
}
.cfg-schema-node.is-active .cfg-schema-node-icon .apei { color: var(--po-blue); }
.cfg-schema-node.is-done .cfg-schema-node-icon {
  background: var(--po-green); border-radius: 50%;
}
.cfg-schema-node.is-done .cfg-schema-node-icon .apei { color: #fff; font-size: 18px; }

.cfg-schema-node-step {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10px; font-weight: 700; line-height: 18px;
  background: var(--po-bg-alt); color: var(--po-ink-3);
  border: 1px solid var(--po-sep);
}
.cfg-schema-node.is-done .cfg-schema-node-step { display: none; }
.cfg-schema-node.is-active .cfg-schema-node-step {
  background: var(--po-blue); color: #fff; border-color: var(--po-blue);
}

.cfg-schema-node-label {
  font-size: 11px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--po-ink); line-height: 1.2;
}
.cfg-schema-node-label .po-o { font-size: 0.92em; }
.cfg-schema-node-value {
  font-size: 10px; color: var(--po-ink-3); margin-top: 3px;
  line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cfg-schema-node.is-done .cfg-schema-node-value { color: var(--po-ink-2); font-weight: 500; }

/* Hardness tint on network node */
.cfg-schema-node[data-key="network"].hard-low .cfg-schema-node-icon { background: rgba(90,200,250,0.15); }
.cfg-schema-node[data-key="network"].hard-moderate .cfg-schema-node-icon { background: rgba(255,149,0,0.12); }
.cfg-schema-node[data-key="network"].hard-hard .cfg-schema-node-icon { background: rgba(255,59,48,0.1); }

/* Grade sub-modules (EasyFit + Cartouche) */
.cfg-schema-grade-split {
  display: flex; gap: 4px; margin-top: 6px; justify-content: center;
}
.cfg-schema-grade-chip {
  font-size: 9px; font-weight: 600; padding: 3px 6px; border-radius: 6px;
  background: var(--po-bg-alt); color: var(--po-ink-3); border: 1px solid var(--po-sep);
  transition: all 0.3s;
}
.cfg-schema-grade-chip.on {
  background: rgba(0,113,227,0.1); color: var(--po-blue); border-color: rgba(0,113,227,0.25);
}

/* Focus mode — phase active dims other nodes slightly */
.cfg-schema.is-focus .cfg-schema-node:not(.is-active):not(.is-done):not(.is-pure-lit) .cfg-schema-node-card {
  opacity: 0.55;
}

.cfg-ux-schema-band.is-config-complete .cfg-schema-pipe-flow,
.cfg-ux-schema-band.is-config-complete .cfg-schema-pipe-glow {
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(90, 200, 250, 0.45));
}
.cfg-ux-schema-band.is-config-complete .cfg-schema-particles .cfg-schema-particle {
  animation-duration: 2.2s;
}

.cfg-ux-schema-legend {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  padding: 0 22px 18px; font-size: 11px; color: var(--po-ink-3);
}
.cfg-ux-schema-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cfg-ux-schema-legend i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.cfg-ux-schema-legend .l-active { background: var(--po-blue); }
.cfg-ux-schema-legend .l-done { background: var(--po-green); }
.cfg-ux-schema-legend .l-flow { background: linear-gradient(90deg, var(--po-blue), var(--po-green)); width: 24px; border-radius: 4px; height: 4px; }

@media (max-width: 860px) {
  .cfg-schema-nodes { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .cfg-schema-node { flex: 0 0 120px; scroll-snap-align: center; }
  .cfg-schema { min-height: 200px; }
}
