/* Launch progress. See static/components/launch_modal.js. */

.launch-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-2) 0;
}

.progress-allocation {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  align-items: flex-start;
}

.progress-status { min-height: 48px; }

.progress-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
}
.progress-title.is-failed { color: var(--danger); }

.progress-detail {
  margin: var(--space-2) 0 0;
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: var(--leading-snug);
}

/* ---- step rail ----------------------------------------------------------
   Five fixed stages. Knowing the sequence is finite and where you are in it is
   most of what makes a long wait tolerable. */
.step-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

/* align-items: center is load-bearing. Without it the column stretches its
   children, so the 9px dot pinned to the left edge while the label filled the
   full column width — every dot sat ~39px left of the label it belonged to, and
   the connecting line (drawn to 50%) pointed at nothing. Dot and label must
   share one centre. */
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

/* The connecting line, drawn behind each dot except the first. */
.step::before {
  content: "";
  position: absolute;
  top: calc(var(--space-3) + 4px);
  right: 50%;
  left: -50%;
  height: 1px;
  background: var(--border);
}
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-current::before { background: var(--graph); }

.step-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--border);
  border: 1px solid var(--border);
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}

.step-label {
  font-size: var(--text-sm);
  color: var(--text-subtle);
  line-height: var(--leading-snug);
  text-align: center;
}

.step.is-done .step-dot { background: var(--graph); border-color: var(--graph); }
.step.is-done .step-label { color: var(--text-muted); }

.step.is-current .step-dot {
  background: var(--graph);
  border-color: var(--graph);
  box-shadow: 0 0 0 4px var(--graph-soft);
}
.step.is-current .step-label { color: var(--text); font-weight: 600; }

.step.is-failed .step-dot {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent);
}
.step.is-failed .step-label { color: var(--danger); font-weight: 600; }

.launch-live-logs {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.launch-live-logs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.launch-live-logs h3,
.launch-live-logs h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
}

.launch-live-output {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: var(--space-3);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  /* Stack vertically: five labels do not fit side by side on a phone. */
  .step-rail { grid-template-columns: 1fr; gap: 0; }
  .step { flex-direction: row; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; }
  /* Row layout: labels run left-to-right beside the dot, so the centring the
     horizontal rail needs would leave ragged text here. */
  .step-label { text-align: left; }
  .step::before {
    top: -50%;
    bottom: 50%;
    left: 4px;
    right: auto;
    width: 1px;
    height: auto;
  }
}
