/* ==========================================================================
   Component: Progress
   Description: Bars, striped fills, and step indicators
   ========================================================================== */

/* --- Base progress bar --- */
.progress {
  width: 100%;
  height: var(--soul-progress-height, 6px);
  background-color: var(--surface-sunken);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out);
}

/* --- Size variants --- */
.progress--lg {
  height: 10px;
}

.progress--sm {
  height: 4px;
}

/* --- Striped variant --- */
.progress--striped .progress__bar {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

/* --- Animated stripe motion --- */
.progress--animated .progress__bar {
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

/* --- Step indicator (labeled stepper) --- */
.progress-step {
  display: flex;
  align-items: flex-start;
  padding: var(--space-4) 0;
}

.progress-step__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.progress-step__dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-primary);
  background-color: var(--surface-base);
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.progress-step__dot--complete {
  background-color: var(--accent-primary);
  color: white;
}

/* The current (in-progress) step — accent ring with a soft halo to mark
   "you are here", distinct from upcoming (plain ring) and complete (filled).
   Presentational; driven by the existing completed index in _progress.html.erb. */
.progress-step__dot--current {
  background-color: var(--accent-subtle);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

.progress-step__label {
  margin-top: var(--space-1-5);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  white-space: nowrap;
}

/* --- Connector line --- */
/* Connectors are neutral until the step they trail is complete, so the
   filled run reads as progress made. Neutral via token → warm-correct in The
   Study; the --complete state (set in _progress.html.erb on i < completed)
   carries the accent. */
.progress-step__connector {
  flex: 1;
  height: 2px;
  background-color: var(--border-default);
  margin-top: 14px; /* vertically center with 28px dot */
  min-width: 24px;
}
.progress-step__connector--complete {
  background-color: var(--accent-primary);
}

@media (prefers-reduced-motion: reduce) {
  .progress__bar {
    transition: none;
  }

  .progress--animated .progress__bar {
    animation: none;
  }

  .progress-step__dot {
    transition: none;
  }
}
