/**
 * [ai] Purpose: Reusable horizontal multi-step progress rail (not button cards).
 *
 * Consumers: partner status timeline; cancel-flow progress rail; any portal stepper.
 * Markup:
 *   <ol class="nllm-progress-stepper" aria-label="…">
 *     <li class="nllm-progress-stepper__item is-{todo|current|done}">
 *       <span class="nllm-progress-stepper__dot" aria-hidden="true"></span>
 *       <span class="nllm-progress-stepper__label">Label</span>
 *     </li>
 *   </ol>
 * Side effects: none. Tokens: --nllm-* / --pc-*.
 * Partner status also keeps .nllm-partner-status-timeline* as aliases.
 */

.nllm-progress-stepper,
.nllm-partner-status-timeline {
	list-style: none;
	margin: 0;
	padding: 0.35rem 0 0.15rem;
	display: flex;
	align-items: flex-start;
	width: 100%;
	gap: 0;
}

.nllm-progress-stepper__item,
.nllm-partner-status-timeline__item {
	display: flex;
	align-items: center;
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	/* Rail, not buttons/cards */
	border: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--nllm-text-subtle, #94a3b8);
	position: relative;
}

.nllm-progress-stepper__item:not(:last-child)::after,
.nllm-partner-status-timeline__item:not(:last-child)::after {
	content: "";
	display: block;
	flex: 1 1 auto;
	height: 2px;
	min-width: 0.75rem;
	margin: 0 0.45rem 0 0.35rem;
	align-self: center;
	background: var(--nllm-surface-soft, #334155);
	border-radius: 1px;
	transition: background-color 0.2s ease;
}

.nllm-progress-stepper__item.is-done:not(:last-child)::after,
.nllm-partner-status-timeline__item.is-done:not(:last-child)::after {
	background: color-mix(in srgb, var(--pc-save-border, #16a34a) 70%, var(--nllm-surface-soft, #334155));
}

.nllm-progress-stepper__item.is-current:not(:last-child)::after,
.nllm-partner-status-timeline__item.is-current:not(:last-child)::after {
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--nllm-cyan, #06b6d4) 75%, var(--nllm-surface-soft, #334155)),
		var(--nllm-surface-soft, #334155)
	);
}

.nllm-progress-stepper__dot,
.nllm-partner-status-timeline__dot {
	width: 1.65rem;
	height: 1.65rem;
	border-radius: 999px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	background: var(--nllm-surface, #1e293b);
	border: 2px solid var(--nllm-surface-soft, #334155);
	color: transparent;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nllm-progress-stepper__label,
.nllm-partner-status-timeline__label {
	margin-left: 0.4rem;
	min-width: 0;
	line-height: 1.25;
	white-space: normal;
}

.nllm-progress-stepper__item.is-done,
.nllm-partner-status-timeline__item.is-done {
	color: var(--nllm-text, #f8fafc);
}

.nllm-progress-stepper__item.is-done .nllm-progress-stepper__dot,
.nllm-partner-status-timeline__item.is-done .nllm-partner-status-timeline__dot {
	background: var(--pc-save-border, #16a34a);
	border-color: var(--pc-save-border, #16a34a);
	color: #fff;
}

.nllm-progress-stepper__item.is-done .nllm-progress-stepper__dot::before,
.nllm-partner-status-timeline__item.is-done .nllm-partner-status-timeline__dot::before {
	content: "✓";
}

.nllm-progress-stepper__item.is-current,
.nllm-partner-status-timeline__item.is-current {
	color: var(--nllm-text, #f8fafc);
	font-weight: 650;
}

.nllm-progress-stepper__item.is-current .nllm-progress-stepper__dot,
.nllm-partner-status-timeline__item.is-current .nllm-partner-status-timeline__dot {
	background: var(--nllm-cyan, #06b6d4);
	border-color: var(--nllm-cyan, #06b6d4);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--nllm-cyan, #06b6d4) 28%, transparent);
	color: #0f172a;
}

.nllm-progress-stepper__item.is-current .nllm-progress-stepper__dot::before,
.nllm-partner-status-timeline__item.is-current .nllm-partner-status-timeline__dot::before {
	content: "";
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 999px;
	background: #0f172a;
}

@media (max-width: 520px) {
	.nllm-progress-stepper,
	.nllm-partner-status-timeline {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 0.35rem;
		-webkit-overflow-scrolling: touch;
	}

	.nllm-progress-stepper__item,
	.nllm-partner-status-timeline__item {
		flex: 0 0 auto;
		max-width: 9.5rem;
	}

	.nllm-progress-stepper__label,
	.nllm-partner-status-timeline__label {
		font-size: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nllm-progress-stepper__item:not(:last-child)::after,
	.nllm-partner-status-timeline__item:not(:last-child)::after,
	.nllm-progress-stepper__dot,
	.nllm-partner-status-timeline__dot {
		transition: none;
	}
}
