/*
 * Two-step registration wizard. Scoped to .brw-wizard; fonts, inputs and buttons keep the
 * theme's (YOOtheme / Woolberry) styles. Override the custom properties to restyle.
 */
.brw-wizard {
	--brw-ink: #262526;
	--brw-muted: #8c8a8a;
	--brw-line: #e5e5e5;
	--brw-error: #a31919;
	--brw-focus: #8c3e3e;

	max-width: 640px;
	scroll-margin-top: 100px;
}

.brw-login {
	margin-top: 0;
}

/* Progress */
.brw-progress {
	display: flex;
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.brw-progress[hidden] {
	display: none;
}

.brw-progress__step {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	gap: 8px;
	min-width: 0;
	padding-top: 10px;
	border-top: 3px solid var(--brw-line);
	color: var(--brw-muted);
}

.brw-progress__step.is-active,
.brw-progress__step.is-done {
	border-top-color: var(--brw-ink);
	color: var(--brw-ink);
}

.brw-progress__number {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 13px;
	line-height: 1;
}

.brw-progress__step.is-active .brw-progress__number {
	background: var(--brw-ink);
	border-color: var(--brw-ink);
	color: #fff;
}

.brw-progress__title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brw-progress__step.is-active .brw-progress__title {
	font-weight: 600;
}

/* Steps: without the script both show as one form. */
.brw-step + .brw-step {
	margin-top: 32px;
}

.brw-wizard.is-wizard .brw-step {
	display: none;
}

.brw-wizard.is-wizard .brw-step.is-active {
	display: block;
	margin-top: 0;
}

/* The progress bar names the step; the heading is kept for the step's focus target and for
   screen readers. */
.brw-wizard.is-wizard .brw-step__title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.brw-step__title:focus {
	outline: none;
}

/* Errors */
.brw-error {
	display: block;
	margin-top: 4px;
	color: var(--brw-error);
	font-size: 0.875em;
}

.brw-wizard .woocommerce-invalid .select2-container .select2-selection {
	border-color: var(--brw-error);
}

/* Actions */
.brw-actions[hidden],
.brw-wizard [data-brw-back][hidden] {
	display: none !important;
}

.brw-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-top: 24px;
}

.brw-wizard .brw-next,
.brw-wizard .brw-submit {
	background-color: var(--brw-ink) !important;
	border-color: var(--brw-ink) !important;
	color: #fff !important;
}

.brw-wizard .brw-next:hover,
.brw-wizard .brw-submit:hover {
	opacity: 0.88;
}

/* Back sits before the primary button in the DOM, so the tab order matches the layout. */
.brw-wizard .brw-back {
	margin-right: auto;
}

.brw-wizard .brw-next {
	margin-left: auto;
}

.brw-wizard .button:focus-visible,
.brw-wizard input:focus-visible,
.brw-wizard select:focus-visible,
.brw-wizard textarea:focus-visible,
.brw-wizard .select2-selection:focus {
	outline: 2px solid var(--brw-focus);
	outline-offset: 2px;
}

@media (max-width: 639px) {
	.brw-progress__step {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		font-size: 13px;
	}

	.brw-progress__title {
		white-space: normal;
	}

	/* Full-width, thumb-sized buttons. */
	.brw-actions .button {
		flex: 1 1 100%;
		min-height: 48px;
		margin: 0;
	}

	.brw-wizard .brw-back,
	.brw-wizard .brw-next {
		margin: 0;
	}

	/* 16px stops iOS Safari from zooming into a field on focus. */
	.brw-wizard input.input-text,
	.brw-wizard select,
	.brw-wizard textarea {
		font-size: 16px;
	}
}
