/**
 * File Name: register-progress.css
 * Description: The progress panel shown between the registration form's submit and the enrollment widget.
 *
 *              That gap is long — the Salesforce call alone takes ten to fourteen seconds against UAT — and
 *              Gravity Forms' own spinner says nothing about what is happening. This panel names each stage
 *              and asks the visitor not to close the page, which is the one thing that can actually lose
 *              their registration.
 *
 *              Lives in the plugin, not the theme's stylesheet, and paints its own surface: the banner it
 *              appears in has a dark ground, so inheriting colours would put dark text on dark. Brand colour
 *              comes from the theme's own --orange token where present.
 * Developer: AG-0105
 * Created Date: 2026-08-18
 * Last Modified: 2026-09-15
 */

.wliq-progress {
	--wliq-progress-ink: #1c1f24;
	--wliq-progress-soft: #5f6570;
	--wliq-progress-surface: #fff;
	--wliq-progress-rule: #d5d8dd;
	--wliq-progress-brand: var(--orange, #c9500d);
	--wliq-progress-done: #1b6b45;

	margin: 1rem 0 0;
	padding: 1.25rem 1.375rem;
	border: 1px solid var(--wliq-progress-rule);
	border-radius: 0.375rem;
	background: var(--wliq-progress-surface);
	color: var(--wliq-progress-ink);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.wliq-progress__steps {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wliq-progress__step {
	display: flex;
	align-items: flex-start;
	gap: 0.6875rem;
}

/* The marker is the only thing that changes between states, so the row does not reflow as it advances. */
.wliq-progress__marker {
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	margin-top: 0.1875rem;
	border-radius: 50%;
	border: 2px solid var(--wliq-progress-rule);
	position: relative;
}

.wliq-progress__step--active .wliq-progress__marker {
	border-color: var(--wliq-progress-brand);
	border-top-color: transparent;
	animation: wliq-progress-spin 0.8s linear infinite;
}

.wliq-progress__step--done .wliq-progress__marker {
	border-color: var(--wliq-progress-done);
	background: var(--wliq-progress-done);
}

/* A tick drawn from two borders, so no icon font or SVG is needed for one glyph. */
.wliq-progress__step--done .wliq-progress__marker::after {
	content: "";
	position: absolute;
	left: 0.1875rem;
	top: 0.0625rem;
	width: 0.3125rem;
	height: 0.5625rem;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

.wliq-progress__label {
	min-width: 0;
}

.wliq-progress__step--pending .wliq-progress__label {
	color: var(--wliq-progress-soft);
}

.wliq-progress__note {
	display: block;
	margin-top: 0.125rem;
	font-size: 0.8125rem;
	color: var(--wliq-progress-soft);
}

.wliq-progress__warn {
	margin: 0.875rem 0 0;
	font-size: 0.8125rem;
	color: var(--wliq-progress-brand);
}

/* The form stays on screen but out of reach while its submission is in flight. */
.wliq-submitting {
	opacity: 0.5;
	pointer-events: none;
}

/*
 * Gravity Forms shows its own spinner on an ajax submit. With this panel up, two spinners for one wait
 * reads as two things happening, so theirs is hidden while ours is present.
 */
.wliq-progress ~ .gform_ajax_spinner,
.wliq-submitting .gform_ajax_spinner {
	display: none !important;
}

@keyframes wliq-progress-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.wliq-progress__step--active .wliq-progress__marker {
		animation: none;
		border-top-color: var(--wliq-progress-brand);
		background: var(--wliq-progress-brand);
	}
}

/*
 * The new-tab handover, where the enrollment page opens in its own tab instead of in place of the form.
 *
 * The continue link carries the theme's own .btn .btn-primary, so it is the same button as every other button
 * on the site and inherits any future change to them. It is deliberately not wrapped in a paragraph: the theme
 * has a global "p a { color: var(--orange) !important }", which is what made the label orange on an orange
 * gradient and invisible. Outside a paragraph the theme's own white button colour applies, so nothing here has
 * to fight it with !important.
 */
.wliq-sf-widget--newtab {
	text-align: center;
}

.wliq-sf-widget--newtab .wliq-sf-widget__status {
	margin: 0 0 1rem;
}

.wliq-sf-widget__continue {
	margin: 0;
}

.wliq-sf-widget--newtab .wliq-sf-widget__link {
	margin-inline: auto;
	text-align: center;
	text-decoration: none;
}

.wliq-sf-widget__link:focus-visible {
	outline: 2px solid var(--white, #fff);
	outline-offset: 2px;
}

/*
 * The widget on its own page. The theme's header is absolutely positioned over the top of the content, which
 * ordinary pages clear with a hero block; this page has only the widget, so it has to clear the header itself.
 * The height is a variable rather than a fixed rule so a header change is a one-line correction.
 */
.wliq-sf-widget--page {
	--wliq-sf-header-clearance: 133px;

	padding-block: calc(var(--wliq-sf-header-clearance) + 2.5rem) 4rem;
}

/* The status line is a placeholder for the moment before the widget draws, so it should not read as a heading. */
.wliq-sf-widget--page .wliq-sf-widget__status {
	margin: 0;
	text-align: center;
}

/*
 * The handover's messages: the line that says a registration is saving, the one that says it could not be,
 * and the note about a browser blocking saved form data.
 *
 * They used to be unstyled paragraphs. On the enrollment page that was the whole screen for the length of
 * the Salesforce wait — one bare sentence under the banner — which read as something broken rather than as
 * a step in progress. They are a proper message now, in the same visual language as the progress panel
 * above: the same surface, rule and brand token, so the two do not look like they came from different
 * builds.
 *
 * Three tones, one per state. The mark is drawn from borders and a pseudo-element, the way the panel's own
 * tick already is, so three glyphs cost no icon font and no SVG.
 */
.wliq-sf-message {
	--wliq-message-ink: #1c1f24;
	--wliq-message-soft: #5f6570;
	--wliq-message-surface: #fff;
	--wliq-message-rule: #d5d8dd;
	--wliq-message-brand: var(--orange, #c9500d);
	--wliq-message-done: #1b6b45;
	--wliq-message-fail: #b3261e;

	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin: 1rem 0;
	padding: 1rem 1.125rem;
	border: 1px solid var(--wliq-message-rule);
	border-left: 3px solid var(--wliq-message-rule);
	border-radius: 0.375rem;
	background: var(--wliq-message-surface);
	color: var(--wliq-message-ink);
	font-size: 0.9375rem;
	line-height: 1.5;
	text-align: left;
}

.wliq-sf-message__body {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
}

.wliq-sf-message__title {
	font-weight: 600;
}

.wliq-sf-message__text {
	color: var(--wliq-message-soft);
	font-size: 0.875rem;
}

/* The mark. Sized and offset to sit on the title's first line rather than on the box's top edge. */
.wliq-sf-message__mark {
	position: relative;
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	margin-top: 0.1875rem;
	border: 2px solid var(--wliq-message-rule);
	border-radius: 50%;
}

/* Waiting — the same spinner the progress panel uses for its active step. */
.wliq-sf-message--waiting {
	border-left-color: var(--wliq-message-brand);
}

.wliq-sf-message--waiting .wliq-sf-message__mark {
	border-color: var(--wliq-message-brand);
	border-top-color: transparent;
	animation: wliq-progress-spin 0.8s linear infinite;
}

/* Done — the panel's tick, drawn from two borders. */
.wliq-sf-message--done {
	border-left-color: var(--wliq-message-done);
}

.wliq-sf-message--done .wliq-sf-message__mark {
	border-color: var(--wliq-message-done);
	background: var(--wliq-message-done);
}

.wliq-sf-message--done .wliq-sf-message__mark::after {
	content: "";
	position: absolute;
	width: 0.3125rem;
	height: 0.5625rem;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;

	/*
	 * Centred from the middle out rather than by a measured offset from the top left. The offsets this
	 * replaced were written against a content box, and the theme sets border-box globally, so the two
	 * pixels of border came out of the circle's inside and pushed the tick up and to the left of centre.
	 * Positioning from 50% cannot drift that way whatever the box model is.
	 *
	 * The vertical figure is 55% and not 50% on purpose: a tick's visual weight sits below its geometric
	 * centre, so a mathematically centred one reads as slightly low.
	 */
	left: 50%;
	top: 50%;
	transform: translate(-50%, -55%) rotate(45deg);
}

/* Failed — an exclamation, drawn the same way so the three marks share a silhouette. */
.wliq-sf-message--failed {
	border-left-color: var(--wliq-message-fail);
}

.wliq-sf-message--failed .wliq-sf-message__mark {
	border-color: var(--wliq-message-fail);
	background: var(--wliq-message-fail);
}

.wliq-sf-message--failed .wliq-sf-message__mark::after {
	content: "";
	position: absolute;
	width: 2px;
	height: 0.4375rem;
	border-radius: 1px;
	background: #fff;

	/* The stem, centred the same way as the tick. The dot below it is the shadow, one stem-height down. */
	left: 50%;
	top: 50%;
	transform: translate(-50%, -80%);
	box-shadow: 0 0.375rem 0 #fff;
}

/*
 * A spinner is the one thing here that must stop for a visitor who has asked for less motion. The border
 * colour is restored so the mark still reads as the waiting state rather than as an empty ring.
 */
@media (prefers-reduced-motion: reduce) {

	.wliq-sf-message--waiting .wliq-sf-message__mark {
		animation: none;
		border-top-color: var(--wliq-message-brand);
	}
}
