/* CVR reconstruction progress */

.bb__progress {
  margin-top: 15px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(143, 184, 201, 0.28);
  background:
    linear-gradient(180deg, rgba(143, 184, 201, 0.055), rgba(5, 10, 16, 0.72)),
    #050a10;
}

.bb__progress[hidden] { display: none; }

.bb__progress-head,
.bb__progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bb__progress-label {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bb__progress-track {
  position: relative;
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(143, 184, 201, 0.26);
  background: #03070b;
}

.bb__progress-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 10px,
    rgba(3, 7, 11, 0.55) 10px 12px
  );
}

.bb__progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--rust), var(--amber));
  box-shadow: 0 0 16px rgba(242, 166, 90, 0.38);
  transition: width 0.12s linear;
}

.bb__progress-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: bb-scan 2.4s linear infinite;
}

@keyframes bb-scan {
  from { transform: translateX(-130%); }
  to { transform: translateX(430%); }
}

.bb__progress-meta {
  margin-top: 7px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bb__progress-meta span:first-child {
  color: var(--amber);
  font-weight: 600;
}

.bb__steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(143, 184, 201, 0.12);
  background: rgba(143, 184, 201, 0.12);
}

.bb__steps li {
  min-width: 0;
  padding: 7px 4px;
  background: #050a10;
  color: rgba(143, 184, 201, 0.34);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
  transition: color 0.16s ease, background 0.16s ease;
}

.bb__steps li.is-done { color: var(--ice); }

.bb__steps li.is-active {
  color: var(--amber);
  background: rgba(242, 166, 90, 0.08);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.bb__progress-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.bb__progress-note--fine {
  margin-top: 5px;
  color: var(--faint);
  font-size: 8px;
}

.bb__progress.is-done {
  border-color: rgba(242, 166, 90, 0.42);
}

.bb__progress.is-done .bb__progress-label,
.bb__progress.is-done .bb__progress-meta span:first-child {
  color: var(--amber-bright);
}

.bb__progress.is-done .bb__progress-scan { display: none; }

.bb__progress.is-stalled {
  border-color: rgba(196, 85, 61, 0.44);
}

.bb__progress.is-stalled .bb__progress-meta span:first-child {
  color: var(--rust);
}

/* Inputs and the preview during the reconstruction */

.bb__upload.is-missing,
.bb__field input.is-missing {
  border-color: var(--rust);
  box-shadow: 0 0 0 2px rgba(196, 85, 61, 0.16);
}

.bb__frame {
  overflow: hidden;
}

.bb__frame canvas {
  display: block;
  transition: filter 0.35s ease;
}

.bb__frame.is-rendering canvas {
  filter: saturate(0.65) brightness(0.62) contrast(1.05);
}

.bb__frame-scan {
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  left: 7px;
  z-index: 2;
  display: block;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bb__frame.is-rendering .bb__frame-scan { opacity: 1; }

.bb__frame-scan::before {
  content: "";
  position: absolute;
  top: -22%;
  right: 0;
  left: 0;
  height: 22%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(242, 166, 90, 0.12),
    rgba(242, 166, 90, 0.48),
    transparent
  );
  animation: bb-scanline 2.8s linear infinite;
}

@keyframes bb-scanline {
  from { top: -24%; }
  to { top: 102%; }
}

.bb__frame.is-ready {
  animation: bb-ready 1.5s ease-out;
}

@keyframes bb-ready {
  0% { box-shadow: 0 0 0 rgba(242, 166, 90, 0); }
  35% { box-shadow: 0 0 38px rgba(242, 166, 90, 0.34); }
  100% { box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5); }
}

@media (max-width: 520px) {
  .bb__progress { padding: 12px 10px 10px; }
  .bb__steps li { padding: 6px 2px; font-size: 7px; }
  .bb__progress-label,
  .bb__progress-meta,
  .bb__progress-note { font-size: 8px; }
  .bb__progress-note--fine { font-size: 8px; }
}
