/* T4b-1 ROUND 4 (helper H72, 2026-10-15): the quote flow's SCANNING ANIMATION (owner, PM 0110Z s3; the TA's VA-5), in the hologram style.
   Self-contained: this file and quote-scan.js (the upload reveal) plus one panel in each template.
     - upload  (/start, customer/index.html): #upload-scan, revealed when the form submits: a scanning bar while the file uploads;
     - slicing (customer/slicing.html): "Analysing part" while the part is sliced (slicing.js, unchanged, goes to the price at once);
     - re-slice (customer/quote_t4c.html): the same bar, small, inside the existing "Re-slicing your part" status;
     - the price LOCKS IN (customer/quote_t4c.html): a short settle on the total (the settle spring) and one scan line across it.
   VA-5: the animation NEVER delays the price. Nothing here holds a form, a poll or a redirect; the price is in the page from its
   first paint, and the settle never hides it (no opacity, visibility, clip or colour change: only a small scale and a line).
   prefers-reduced-motion: EVERY animation rule below exists only under (prefers-reduced-motion: no-preference), so under reduce the
   panels show and hide with zero frames, and the price simply appears.
   Tokens only (webapp/static/tokens.css). The panel is a dark hologram card even on the legacy light reading sheet (its own surface:
   every text colour below is the on-glass set, measured on --c-glass-menu). */

.qscan {
  display: flex; align-items: center; gap: var(--s-3); margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4); max-width: 26rem;
  background-color: var(--c-glass-menu); background-image: linear-gradient(180deg, var(--c-glass-tint), transparent 60%);
  color: var(--c-on-glass); border: var(--bw-1) solid var(--c-holo-edge); border-radius: var(--r-1); box-shadow: var(--glow-1);
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: var(--fw-medium); line-height: var(--lh-snug);
  letter-spacing: var(--ls-label); text-transform: uppercase;
}
.qscan[hidden] { display: none; }
.qscan__bed {
  position: relative; flex: none; display: block; width: var(--scan-w); height: var(--scan-h); overflow: hidden;
  background-color: var(--c-void); border: var(--bw-1) solid var(--c-holo-edge-soft); border-radius: var(--r-1);
  background-image: linear-gradient(var(--c-grid-major) var(--bw-1), transparent var(--bw-1)),
    linear-gradient(90deg, var(--c-grid-major) var(--bw-1), transparent var(--bw-1));
  background-size: var(--s-2) var(--s-2), var(--s-2) var(--s-2);
}
.qscan__bar {
  position: absolute; left: 0; right: 0; top: 0; display: block; height: var(--bw-2);
  background-color: var(--c-orange-tint); box-shadow: var(--glow-1);
}
.qscan__label { color: var(--c-orange-on-glass); }
/* the small one inside the re-slicing status line */
.qscan--inline { display: inline-flex; margin: 0 var(--s-2) 0 0; padding: 0; max-width: none; vertical-align: middle;
  background: none; border: 0; box-shadow: none; }
.qscan--inline .qscan__bed { --scan-h: var(--s-5); --scan-w: var(--s-6); }

/* the price locks in: the scan line needs the total as its box */
#q-totalbar .t4c-price { position: relative; transform-origin: left center; }

@media (prefers-reduced-motion: no-preference) {
  .qscan:not([hidden]) .qscan__bar { animation: qscan-sweep var(--d-scan) var(--ease-standard) infinite alternate; }
  #q-totalbar .t4c-price { animation: qscan-lock var(--d-spring-settle) var(--ease-spring-settle) both; }
  #q-totalbar .t4c-price::after {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--bw-2); pointer-events: none;
    background-color: var(--c-holo-edge-strong); box-shadow: var(--glow-1);
    animation: qscan-lock-line var(--d-slow) var(--ease-standard) both;
  }
}
@keyframes qscan-sweep { from { transform: translateY(0); } to { transform: translateY(calc(var(--scan-h) - var(--bw-2) * 2)); } }
/* the settle: scale only (the price is readable on every frame) */
@keyframes qscan-lock { from { transform: scale(1.06); } to { transform: none; } }
@keyframes qscan-lock-line { from { top: 0; opacity: 1; } to { top: 100%; opacity: 0; } }
