/* =========================================================
   flow.css — the step-by-step wizard
   One step on screen at a time, a numbered rail above it and
   Previous / Next below. Without JavaScript every panel stays
   visible, so the content is never trapped behind a control.
   ========================================================= */

/* ---------------------------------------------------------
   Section shell + background accent
   --------------------------------------------------------- */

.wizard-section {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 55%, var(--surface) 100%);
}

.wizard-section__glow {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(620px 380px at 12% 10%, rgba(36, 64, 130, 0.08), transparent 62%),
		radial-gradient(560px 340px at 88% 80%, rgba(53, 208, 222, 0.16), transparent 60%);
}

.wizard {
	max-width: 940px;
	margin-inline: auto;
}

/* ---------------------------------------------------------
   Numbered rail
   --------------------------------------------------------- */

.wizard__rail {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-2);
	margin-bottom: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem);
	padding-inline: 2px;
}

/* The track the dots sit on, plus the portion already covered. */
.wizard__rail-line {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 3px;
	margin-top: -1.5px;
	border-radius: var(--radius-pill);
	background: var(--line);
	overflow: hidden;
}

.wizard__rail-fill {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--navy-700), var(--navy-600) 45%, var(--teal-500));
	transition: width 0.45s var(--ease);
}

.wizard__dot {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: none;
	border-radius: 50%;
	border: 2px solid var(--line);
	background: #fff;
	color: var(--ink-300);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0;
	transition:
		transform 0.3s var(--ease),
		border-color 0.3s var(--ease),
		background 0.3s var(--ease),
		color 0.3s var(--ease),
		box-shadow 0.3s var(--ease);
}

.wizard__dot:hover {
	border-color: var(--teal-500);
	color: var(--teal-700);
}

/* Steps already walked through. */
.wizard__dot.is-done {
	border-color: var(--teal-500);
	background: var(--teal-500);
	color: var(--navy-900);
}

/* The step on screen. */
.wizard__dot.is-current {
	border-color: transparent;
	background: var(--grad-navy);
	color: #fff;
	transform: scale(1.16);
	box-shadow: 0 0 0 5px rgba(53, 208, 222, 0.22), 0 10px 22px -10px rgba(11, 26, 59, 0.7);
}

@media (max-width: 719px) {
	/* Numbers stop fitting; the rail becomes plain markers. */
	.wizard__dot {
		width: 16px;
		height: 16px;
		border-width: 2px;
	}

	.wizard__dot-num { display: none; }
	.wizard__dot.is-current { transform: scale(1.35); }
}

/* ---------------------------------------------------------
   Panels
   --------------------------------------------------------- */

.wizard__viewport {
	position: relative;
	/* Set from JS to the tallest panel, so stepping never jumps the page. */
	min-height: var(--panel-h, auto);
	transition: min-height 0.35s var(--ease);
}

.wizard__panels {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Without JS the panels simply stack. */
.wizard-panel + .wizard-panel { margin-top: var(--sp-5); }

.js .wizard-panel + .wizard-panel { margin-top: 0; }

.js .wizard-panel[hidden] { display: none; }

/* ---------------------------------------------------------
   The card
   --------------------------------------------------------- */

.wizard-card {
	display: grid;
	gap: 0;
	background: #fff;
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

@media (min-width: 760px) {
	.wizard-card { grid-template-columns: 1fr 1fr; align-items: stretch; }
}

.wizard-card__media {
	position: relative;
	overflow: hidden;
	background: var(--surface-2);
	aspect-ratio: 5 / 4;
}

@media (min-width: 760px) {
	.wizard-card__media { aspect-ratio: auto; min-height: 340px; }
}

.wizard-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transform: scale(1.04);
	transition: transform 0.9s var(--ease);
}

.wizard-panel.is-active .wizard-card__img { transform: scale(1); }

.wizard-card__sheen {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(11, 26, 59, 0) 55%, rgba(11, 26, 59, 0.22) 100%);
	pointer-events: none;
}

@media (min-width: 760px) {
	.wizard-card__sheen {
		background: linear-gradient(90deg, rgba(11, 26, 59, 0) 65%, rgba(11, 26, 59, 0.14) 100%);
	}
}

.wizard-card__badge {
	position: absolute;
	left: var(--sp-5);
	bottom: var(--sp-5);
	display: grid;
	place-items: center;
	min-width: 58px;
	height: 58px;
	padding-inline: 0.7rem;
	border-radius: 18px;
	background: var(--grad-accent);
	color: var(--navy-900);
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: -0.02em;
	box-shadow: 0 12px 24px -10px rgba(10, 31, 77, 0.75);
}

.wizard-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
}

.wizard-card__eyebrow {
	margin: 0 0 var(--sp-2);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--teal-700);
}

.wizard-card__title {
	margin: 0 0 var(--sp-4);
	font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
}

.wizard-card__list {
	display: grid;
	gap: var(--sp-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wizard-card__list li {
	display: flex;
	align-items: flex-start;
	gap: var(--sp-3);
	font-size: var(--fs-base);
	color: var(--ink-700);
}

.wizard-card__list .icon {
	flex: none;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	padding: 4px;
	border-radius: 50%;
	background: var(--teal-500);
	color: var(--navy-900);
}

/* ---------------------------------------------------------
   Enter animation, direction aware
   --------------------------------------------------------- */

@keyframes wizard-in-next {
	from { opacity: 0; transform: translate3d(28px, 0, 0); }
	to   { opacity: 1; transform: none; }
}

@keyframes wizard-in-prev {
	from { opacity: 0; transform: translate3d(-28px, 0, 0); }
	to   { opacity: 1; transform: none; }
}

.js .wizard-panel.is-entering-next { animation: wizard-in-next 0.42s var(--ease) both; }
.js .wizard-panel.is-entering-prev { animation: wizard-in-prev 0.42s var(--ease) both; }

/* ---------------------------------------------------------
   Controls
   --------------------------------------------------------- */

.wizard__controls {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3);
	margin-top: var(--sp-5);
}

.js .wizard__controls { display: flex; }

.wizard__btn {
	min-width: 132px;
	justify-content: center;
}

.wizard__btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}

.wizard__controls .btn--ghost { background: #fff; }

.wizard__counter {
	margin: 0;
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--text-muted);
	white-space: nowrap;
}

.wizard__counter strong {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 1.25rem;
	color: var(--brand);
}

.wizard__counter-sep { margin-inline: 4px; }

.flip-x { transform: scaleX(-1); }

@media (max-width: 519px) {
	.wizard__btn { min-width: 0; flex: 1; padding-inline: 0.9rem; }
	.wizard__counter { order: -1; flex-basis: 100%; text-align: center; }
	.wizard__controls { flex-wrap: wrap; }
}

/* ---------------------------------------------------------
   Completion note
   --------------------------------------------------------- */

.wizard__done {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	width: fit-content;
	margin: var(--sp-5) auto 0;
	padding: 0.6rem 1.2rem;
	border-radius: var(--radius-pill);
	background: var(--teal-050);
	color: var(--teal-700);
	font-size: var(--fs-sm);
	font-weight: 600;
	animation: wizard-in-next 0.42s var(--ease) both;
}

/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.js .wizard-panel.is-entering-next,
	.js .wizard-panel.is-entering-prev,
	.wizard__done {
		animation: none;
	}

	.wizard-card__img,
	.wizard__dot,
	.wizard__rail-fill,
	.wizard__viewport {
		transition: none;
	}

	.wizard-card__img { transform: none; }
	.wizard-panel.is-active .wizard-card__img { transform: none; }
}
