// Setup Wizard page (admin/wizard bundle; PLAN Phase 11, appendix C §7). Values are the prototype's.
// The shared pieces (stepper, rows, choice questions, footer, done art, summary) are in
// components/_wizard.scss.
@use "tokens" as *;
@use "components";
@use "admin/pro";

/* stylelint-disable selector-id-pattern -- WordPress's ids */

// The wizard fills the content area: no gutter, no footer (as in the prototype).
.ssw-wizard-screen {

	#wpcontent {
		padding-left: 0;
	}

	#wpbody-content {
		padding-bottom: 0;
	}

	#wpfooter {
		display: none;
	}
}

.ssw-wz {
	font-size: 14px;
	line-height: 1.5;
	color: $text;
}

/* Header ----------------------------------------------------------------------------------------- */

.ssw-wz-head {
	height: 64px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	padding: 0 24px;
	background: #fff;
	box-shadow: inset 0 -1px 0 $line-card;

	.ssw-stepper {
		grid-column: 2;
		justify-self: center;
	}
}

.ssw-wz-head__logo {
	grid-column: 1;
	justify-self: start;
	display: block;
	height: 26px;
	width: auto;
}

.ssw-admin .ssw-wz-exit {
	grid-column: 3;
	justify-self: end;
	height: 36px;
	padding: 0 12px;
	border-radius: 4px;
	background: transparent;
	color: #50575e;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: background 140ms, color 140ms;

	&:hover {
		background: #f0f0f1;
		color: $ink;
	}

	@include focus-visible;
}

/* Body ------------------------------------------------------------------------------------------- */

.ssw-wz-body {
	max-width: 1120px;
	margin: 0 auto;
	padding: 32px 24px 64px;
	box-sizing: border-box;
}

.ssw-wz-stage {
	opacity: 1;
	transform: none;
	transition: opacity 160ms, transform 220ms cubic-bezier(0.2, 0, 0, 1);

	&.is-leaving {
		opacity: 0;
		transform: translateY(6px);
	}

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

.ssw-wz-title.is-display {
	font-size: 26px;
	line-height: 1.25;
	text-wrap: pretty;
}

.ssw-wz-lead {

	&.is-welcome {
		max-width: 600px;
		margin-top: 10px;
		font-size: 15px;
		line-height: 1.6;
	}

	&.is-summary {
		margin-top: 6px;
		color: $muted;
	}
}

.ssw-wz-error {
	margin: 16px 0 0;
	color: $danger;
}

/* Welcome ---------------------------------------------------------------------------------------- */

.ssw-wz-compare {
	margin-top: 28px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
	gap: 8px;
	align-items: stretch;
}

.ssw-wz-compare__side {
	min-width: 0;
	border-radius: 8px;
	background: #fff;
	box-shadow: inset 0 0 0 1px $line-card;
	overflow: hidden;

	&.is-after {
		box-shadow: inset 0 0 0 1px #dce8f4;
	}
}

.ssw-wz-compare__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #f6f7f7;
	box-shadow: inset 0 -1px 0 $line-list;

	.is-after > & {
		background: $tint;
	}
}

.ssw-wz-compare__tag {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #74757a;

	&.is-after {
		color: $blue;
	}
}

.ssw-wz-compare__name {
	font-size: 12.5px;
	color: #74757a;
}

.ssw-wz-compare__arrow {
	align-self: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ssw-wz-window__page {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	gap: 16px;
	padding: 16px;
}

.ssw-wz-window__media {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ssw-wz-window__image {
	aspect-ratio: 4 / 5;
	border-radius: 4px;
	background: #f0f1f2;
}

.ssw-wz-window__thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;

	span {
		aspect-ratio: 1 / 1;
		border-radius: 3px;
		background: #f0f1f2;

		&.is-current {
			box-shadow: inset 0 0 0 1px #dcdcde;
		}
	}
}

.ssw-wz-window__info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ssw-wz-bar {
	display: block;
	height: 6px;
	border-radius: 3px;
	background: #eceef0;

	&.is-title {
		height: 12px;
		margin-top: 2px;
	}

	&.is-price {
		height: 10px;
	}

	&.is-gap {
		margin-top: 4px;
	}
}

.ssw-wz-window__rating {
	display: flex;
	gap: 3px;

	span {
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: #eceef0;
	}
}

.ssw-wz-window__options {
	margin-top: 6px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ssw-wz-window__cart {
	display: flex;
	gap: 6px;
	margin-top: 6px;

	span:first-child {
		width: 40px;
		height: 28px;
		border-radius: 3px;
		box-shadow: inset 0 0 0 1px $line-card;
	}

	span:last-child {
		flex: 1;
		height: 28px;
		border-radius: 3px;
		background: #dcdde0;
	}
}

.ssw-wz-opt {
	display: flex;
	flex-direction: column;
	gap: 4px;

	&.is-after {
		gap: 5px;
	}
}

.ssw-wz-opt__label {
	font-size: 12px;
	font-weight: 500;
	color: $text;

	.is-after & {
		font-weight: 400;

		span {
			font-weight: 500;
		}
	}
}

.ssw-wz-select {
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 6px 0 9px;
	border-radius: 4px;
	background: #fff;
	box-shadow: inset 0 0 0 1px #dddee1;
	font-size: 12px;
	color: #74757a;
	white-space: nowrap;

	svg {
		flex: 0 0 14px;
	}
}

.ssw-wz-dots,
.ssw-wz-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.ssw-wz-dot {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;

	&.is-on {
		box-shadow: inset 0 0 0 2px $blue;
	}

	span {
		width: 18px;
		height: 18px;
		border-radius: 50%;
		box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
	}
}

.ssw-wz-button {
	min-width: 28px;
	height: 26px;
	padding: 0 7px;
	border-radius: 4px;
	background: #fff;
	box-shadow: inset 0 0 0 1px #dddee1;
	color: $text;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;

	&.is-on {
		background: $tint;
		box-shadow: inset 0 0 0 1px $blue;
		color: $blue;
	}
}

.ssw-wz-actions {
	margin-top: 32px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.ssw-admin .ssw-wz-start {
	height: 44px;
	padding: 0 22px;
	border-radius: 4px;
	background: $blue;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: background 140ms;

	&:hover {
		background: $blue-2;
	}

	@include focus-visible;
}

.ssw-admin .ssw-wz-skip {
	padding: 0;
	background: transparent;
	font-size: 14px;
	color: #8c8f94;
	transition: color 140ms;

	&:hover {
		color: #50575e;
	}

	@include focus-visible;
}

/* Attributes ------------------------------------------------------------------------------------- */

.ssw-wz-list {
	margin-top: 18px;
	display: flex;
	flex-direction: column;
}

// Rows after the first four: revealed by "Show {n} more attributes", staggered.
.ssw-wz-list__row.is-extra {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition: grid-template-rows 340ms cubic-bezier(0.2, 0, 0, 1), opacity 260ms ease;

	> div {
		min-height: 0;
		overflow: hidden;
	}

	&.is-shown {
		grid-template-rows: 1fr;
		opacity: 1;
	}

	&.is-settled > div {
		overflow: visible;
	}

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

.ssw-wz-attr {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 20px;
	padding: 14px 0;

	.ssw-wz-list__row + .ssw-wz-list__row & {
		box-shadow: inset 0 1px 0 $line-list;
	}
}

.ssw-wz-attr__text {
	min-width: 0;
	flex: 1 1 220px;
}

.ssw-wz-attr__name {
	font-size: 14px;
	font-weight: 500;
	color: $text;
}

.ssw-wz-attr__sub {
	margin-top: 3px;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.ssw-wz-attr__dots {
	display: flex;
	flex: 0 0 auto;

	span {
		width: 14px;
		height: 14px;
		border-radius: 50%;
		box-shadow: 0 0 0 1.5px #fff, inset 0 0 0 1px rgba(0, 0, 0, 0.12);

		+ span {
			margin-left: -4px;
		}
	}
}

.ssw-wz-attr__preview {
	font-size: 13px;
	color: #74757a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ssw-wz-attr__type {
	position: relative;
	flex: 0 0 216px;
	width: 216px;
}

.ssw-wz-list__foot {
	padding-top: 6px;
	box-shadow: inset 0 1px 0 $line-list;
}

.ssw-admin .ssw-wz-list__more {
	margin-top: 8px;
	height: 32px;
	padding: 0 10px 0 12px;
	border-radius: 4px;
	background: transparent;
	color: $blue;
	font-size: 14px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: background 140ms;

	svg {
		transition: transform 180ms ease;
	}

	&.is-open svg {
		transform: rotate(180deg);
	}

	&:hover {
		background: $tint;
	}

	@include focus-visible;
}

.ssw-wz-questions {
	margin-top: 28px;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.ssw-wz-progress {
	margin-top: 22px;
	padding: 18px 20px;
	border-radius: 8px;
	background: #f6f7f7;
	box-shadow: inset 0 0 0 1px $line-card;
}

.ssw-wz-progress__head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
}

.ssw-wz-progress__label {
	font-weight: 500;
	color: $ink;
}

.ssw-wz-progress__count {
	color: $muted;
	font-variant-numeric: tabular-nums;
}

.ssw-wz-progress__bar {
	margin-top: 10px;
	height: 6px;
	border-radius: 3px;
	background: $line-card;
	overflow: hidden;

	span {
		display: block;
		height: 100%;
		border-radius: 3px;
		background: $blue;
		transition: width 220ms linear;
	}
}

.ssw-wz-progress__note {
	margin-top: 10px;
	font-size: 12.5px;
	color: #74757a;
}

/* Create ----------------------------------------------------------------------------------------- */

.ssw-wz-quick {
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ssw-wz-quick__label {
	margin-right: 4px;
	font-size: 13px;
	color: #74757a;
}

.ssw-admin .ssw-wz-chip {
	height: 32px;
	padding: 0 12px;
	border-radius: 999px;
	background: #fff;
	box-shadow: inset 0 0 0 1px #dddee1;
	color: $text;
	font-size: 14px;
	transition: background 140ms, box-shadow 140ms, color 140ms;

	&:hover {
		background: #f6f7f7;
	}

	&.is-on {
		background: $tint;
		box-shadow: inset 0 0 0 1px $blue;
		color: $blue;
	}

	@include focus-visible;
}

.ssw-wz-form {
	margin-top: 24px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.ssw-wz-field {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;

	&.is-top {
		align-items: flex-start;
	}
}

.ssw-wz-field__label {
	flex: 0 0 140px;
	font-size: 14px;
	font-weight: 500;
	color: $text;

	&.is-top {
		padding-top: 10px;
	}
}

.ssw-wz-field__control {
	flex: 1 1 240px;
	min-width: 0;
}

.ssw-admin .ssw-wz-input {
	flex: 1 1 240px;
	min-width: 0;
	height: 40px;
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: 4px;
	background: #fff;
	box-shadow: inset 0 0 0 1px #dddee1;
	font-size: 14px;
	color: $text;
	transition: box-shadow 140ms;

	&:focus {
		outline: none;
		box-shadow: inset 0 0 0 1px $blue, 0 0 0 1px $blue;
	}
}

.ssw-wz-terms__add {
	display: flex;
	gap: 8px;
}

.ssw-admin .ssw-wz-add {
	height: 40px;
	padding: 0 16px;
	border-radius: 4px;
	background: #fff;
	box-shadow: inset 0 0 0 1px #dddee1;
	color: $text;
	font-size: 14px;
	font-weight: 500;

	&:hover:not(:disabled) {
		background: #f6f7f7;
	}

	&:disabled {
		opacity: 0.5;
		cursor: default;
	}

	@include focus-visible;
}

.ssw-wz-terms {
	margin-top: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ssw-wz-term {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 6px 0 7px;
	border-radius: 6px;
	background: #fff;
	box-shadow: inset 0 0 0 1px $line-card;
	font-size: 14px;
	color: $text;
	box-sizing: border-box;
}

.ssw-wz-term__dot {
	position: relative;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
	overflow: hidden;

	&.is-empty {
		background: #fff;
		box-shadow: inset 0 0 0 1.5px #c3c4c7;
	}

	input {
		position: absolute;
		inset: -4px;
		width: 30px;
		height: 30px;
		padding: 0;
		border: 0;
		opacity: 0;
		cursor: pointer;
	}
}

.ssw-admin .ssw-wz-term__remove {
	width: 24px;
	height: 24px;
	padding: 0;
	border-radius: 4px;
	background: transparent;
	color: #8c8f94;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 140ms, color 140ms;

	&:hover {
		background: #f6f7f7;
		color: $danger-2;
	}

	@include focus-visible;
}

.ssw-wz-hint {
	margin-top: 8px;
	font-size: 12.5px;
	color: #74757a;
	text-wrap: pretty;
}

/* More Tools ------------------------------------------------------------------------------------- */

// Design of 2026-10-26: one bordered list under a bar with the count and Select all.
.ssw-wz-plugins {
	margin-top: 20px;
	border: 1px solid $line-card;
	border-radius: $radius-card;
	background: $surface;
	overflow: hidden;
}

.ssw-wz-plugins__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	min-height: 20px;
	padding: 12px 20px;
	background: $surface-2;
	box-shadow: inset 0 -1px 0 $line-list;
}

.ssw-wz-plugins__count {
	font-size: 13px;
	color: $muted;
}

.ssw-admin .ssw-wz-plugins__all {
	font-size: 13px;
	font-weight: 500;
	color: $blue;

	&:hover {
		text-decoration: underline;
	}

	@include focus-visible;
}

.ssw-wz-plugin {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 20px;
	background: $surface;
	cursor: pointer;
	outline: none;
	transition: background 140ms ease;
	animation: ssw-plugin-rise 320ms $ease both;

	& + & {
		box-shadow: inset 0 1px 0 $line-list;
	}

	&:hover {
		background: $surface-2;
	}

	&.is-on {
		background: #f6fafd;

		&:hover {
			background: $tint;
		}
	}

	&.is-locked {
		cursor: default;

		&:hover {
			background: $surface;
		}

		&.is-on:hover {
			background: #f6fafd;
		}
	}

	&:focus-visible {
		outline: 2px solid $blue;
		outline-offset: -2px;
	}

	@media (prefers-reduced-motion: reduce) {
		animation: none;
	}
}

.ssw-wz-plugin__icon {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 9px;
	object-fit: cover;
	display: block;
}

.ssw-wz-plugin__text {
	flex: 1;
	min-width: 0;
}

.ssw-wz-plugin__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 8px;
}

.ssw-wz-plugin__name {
	font-size: 14px;
	font-weight: 500;
	color: $text;
}

.ssw-wz-plugin__badge {
	display: inline-flex;
	align-items: center;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	background: $tint;
	box-shadow: inset 0 0 0 1px $blue-ring;
	font-size: 12px;
	font-weight: 500;
	color: $blue;
	white-space: nowrap;
}

.ssw-wz-plugin__desc {
	margin-top: 2px;
	font-size: 13.5px;
	color: $muted;
	text-wrap: pretty;
}

.ssw-wz-plugin__error {
	margin-top: 6px;
	font-size: 13px;
	font-weight: 500;
	color: $danger;
	animation: ssw-plugin-fade 240ms ease both;
}

.ssw-wz-plugin__check {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	box-shadow: inset 0 0 0 1px $faint;
	transition: background 140ms ease, box-shadow 140ms ease;

	svg {
		opacity: 0;
		transition: opacity 140ms ease;
	}

	&.is-on {
		background: $blue;
		box-shadow: none;

		svg {
			opacity: 1;
		}
	}
}

.ssw-wz-plugin__state {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;

	&.is-busy {
		gap: 7px;
		color: $blue;
	}

	&.is-active {
		gap: 5px;
		color: #1a7f37;
		animation: ssw-plugin-pop 260ms $ease both;
	}

	&.is-inactive {
		color: $warning;
	}
}

// Installed but inactive: the state and an "Activate" pick (the row toggles it).
.ssw-wz-plugin__inactive {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
}

.ssw-wz-plugin__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #dba617;
}

.ssw-wz-plugin__activate {
	height: 30px;
	padding: 0 12px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	background: #fff;
	color: $blue;
	box-shadow: inset 0 0 0 1px $blue;
	transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;

	&.is-on {
		background: $blue;
		color: #fff;
		box-shadow: none;
	}
}

.ssw-wz-plugin__spinner {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid $blue-ring;
	border-top-color: $blue;
	box-sizing: border-box;
	animation: ssw-spin 700ms linear infinite;

	@media (prefers-reduced-motion: reduce) {
		animation-duration: 2s;
	}
}

// What Finish will do, under the list.
.ssw-wz-plugin-notes {
	margin-top: 14px;
	padding: 0 4px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ssw-wz-plugin-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	line-height: 22px;
	color: $text-2;
	animation: ssw-plugin-fade 240ms ease both;

	strong {
		font-weight: 600;
		color: $ink;
	}
}

.ssw-wz-plugin-note__icon {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: $tint;
	color: $blue;

	.is-err > & {
		background: $danger-tint;
		color: $danger;
	}

	.is-ok > & {
		background: #edf7ef;
		color: #1a7f37;
	}

	.is-dash > & {
		background: $line-list;
		color: $muted;
	}
}

.ssw-wz-plugin-note__text {
	min-width: 0;
	text-wrap: pretty;
}

@keyframes ssw-plugin-rise {

	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes ssw-plugin-fade {

	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes ssw-plugin-pop {

	0% {
		transform: scale(0.4);
		opacity: 0;
	}

	60% {
		transform: scale(1.08);
		opacity: 1;
	}

	100% {
		transform: scale(1);
	}
}

/* Done ------------------------------------------------------------------------------------------- */

.ssw-wz .ssw-done-hero {
	padding-top: 8px;
}

.ssw-wz .ssw-wz-section {
	margin-top: 36px;

	+ .ssw-wz-section {
		margin-top: 32px;
	}
}

.ssw-wz-next-title {
	margin-top: 32px;
}

.ssw-wz .ssw-next-grid {
	margin-top: 12px;
}

.ssw-wz-steps {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;

	li {
		display: flex;
		align-items: flex-start;
		gap: 12px;
		margin: 0;
		font-size: 14px;
		color: #50575e;
	}

	li > span:first-child {
		flex: 0 0 22px;
		width: 22px;
		height: 22px;
		border-radius: 50%;
		background: $tint;
		color: $blue;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 12px;
		font-weight: 600;
	}

	li > span:last-child {
		padding-top: 1px;
		text-wrap: pretty;
	}
}

.ssw-wz-notice__text {
	margin-right: 8px;
}

.ssw-admin .ssw-wz-change {
	padding: 0;
	background: transparent;
	color: $blue;
	font-size: 13.5px;
	font-weight: 500;

	&:hover {
		color: $blue-2;
	}

	@include focus-visible;
}
