/**
 * Demo signup form.
 *
 * Option cards are real <button> elements. Styling list items instead is where
 * stray bullets and broken tab order come from.
 */

.gh-demo-form {
	--gh-demo-accent: #1a6fd4;
	--gh-demo-accent-dark: #12508f;
	--gh-demo-accent-soft: #eff5fd;
	--gh-demo-ink: #101828;
	--gh-demo-muted: #5b6472;
	--gh-demo-faint: #7a828e;
	--gh-demo-line: #dce3ec;
	--gh-demo-card: #ffffff;
	--gh-demo-ok: #2c6e3a;
	--gh-demo-ok-soft: #f1f9f2;
	--gh-demo-ok-line: #bfdbc4;

	max-width: 560px;
	margin-inline: auto;
	font-size: 16px;
	line-height: 1.5;
	color: var(--gh-demo-ink);
}

.gh-demo-form *,
.gh-demo-form *::before,
.gh-demo-form *::after {
	box-sizing: border-box;
}

.gh-demo-form__card {
	padding: 32px;
	border: 1px solid #e4eaf1;
	border-radius: 20px;
	background: var(--gh-demo-card);
}

.gh-demo-form__loading,
.gh-demo-form__noscript {
	margin: 0;
	color: var(--gh-demo-muted);
}

.gh-demo-form__screen {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.gh-demo-form__screen--done {
	align-items: center;
	text-align: center;
}

.gh-demo-form__step {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gh-demo-accent);
}

.gh-demo-form__heading {
	margin: 14px 0 6px;
	font-size: 30px;
	line-height: 1.15;
	font-weight: 600;
	color: var(--gh-demo-ink);
}

.gh-demo-form__heading:focus {
	outline: none;
}

.gh-demo-form__heading--small {
	margin-top: 0;
	font-size: 26px;
	line-height: 1.2;
}

.gh-demo-form__sub {
	margin: 0 0 22px;
	font-size: 15px;
	color: var(--gh-demo-muted);
}

/* --- option cards --- */

.gh-demo-form__grid {
	display: grid;
	gap: 10px;
}

.gh-demo-form__grid--1 {
	grid-template-columns: minmax(0, 1fr);
}

.gh-demo-form__grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gh-demo-form__option {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--gh-demo-line);
	border-radius: 12px;
	background: var(--gh-demo-card);
	color: var(--gh-demo-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.12s ease, background-color 0.12s ease;
}

.gh-demo-form__option:hover {
	border-color: var(--gh-demo-accent);
	background: var(--gh-demo-accent-soft);
}

.gh-demo-form__option:focus-visible {
	outline: 2px solid var(--gh-demo-accent);
	outline-offset: 2px;
}

.gh-demo-form__option.is-selected {
	border-width: 2px;
	border-color: var(--gh-demo-accent);
	background: var(--gh-demo-accent-soft);
	font-weight: 600;
}

/* --- fields --- */

.gh-demo-form__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--gh-demo-ink);
}

.gh-demo-form__label--spaced {
	margin-top: 20px;
}

.gh-demo-form__field {
	width: 100%;
	margin-bottom: 18px;
	padding: 13px 14px;
	border: 1px solid var(--gh-demo-line);
	border-radius: 10px;
	background: var(--gh-demo-card);
	color: var(--gh-demo-ink);
	font: inherit;
}

.gh-demo-form__field:focus {
	border-color: var(--gh-demo-accent);
	outline: 2px solid var(--gh-demo-accent);
	outline-offset: 1px;
}

.gh-demo-form__field--area {
	resize: vertical;
	min-height: 66px;
}

/* --- buttons --- */

.gh-demo-form__cta {
	width: 100%;
	min-height: 56px;
	margin-top: 6px;
	padding: 0 24px;
	border: 0;
	border-radius: 12px;
	background: var(--gh-demo-accent);
	color: #ffffff;
	font: inherit;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.12s ease;
}

.gh-demo-form__cta:hover:not([disabled]) {
	background: var(--gh-demo-accent-dark);
}

.gh-demo-form__cta[disabled] {
	opacity: 0.65;
	cursor: default;
}

.gh-demo-form__cta:focus-visible {
	outline: 2px solid var(--gh-demo-ink);
	outline-offset: 2px;
}

.gh-demo-form__skip,
.gh-demo-form__back {
	margin-top: 22px;
	padding: 8px 4px;
	border: 0;
	background: none;
	color: var(--gh-demo-muted);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.gh-demo-form__skip {
	align-self: center;
}

.gh-demo-form__back {
	align-self: flex-start;
}

.gh-demo-form__skip:hover,
.gh-demo-form__back:hover {
	color: var(--gh-demo-ink);
	text-decoration: underline;
}

/* --- status banner --- */

.gh-demo-form__status {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	padding: 12px 14px;
	border: 1px solid var(--gh-demo-line);
	border-radius: 12px;
	background: #f8fafc;
	font-size: 14px;
	font-weight: 500;
	color: var(--gh-demo-muted);
}

.gh-demo-form__status-dot {
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--gh-demo-accent);
}

@media (prefers-reduced-motion: reduce) {
	.gh-demo-form .gh-demo-form__option {
		transition: none;
	}
}

/* --- done --- */

.gh-demo-form__mail {
	width: 64px;
	height: 64px;
	margin-bottom: 22px;
	border-radius: 50%;
	background: var(--gh-demo-accent-soft);
	position: relative;
}

.gh-demo-form__mail::after {
	content: "";
	position: absolute;
	inset: 20px 16px;
	border: 2px solid var(--gh-demo-accent);
	border-radius: 3px;
	background:
		linear-gradient(45deg, transparent 46%, var(--gh-demo-accent) 46%, var(--gh-demo-accent) 54%, transparent 54%) no-repeat left top / 50% 70%,
		linear-gradient(-45deg, transparent 46%, var(--gh-demo-accent) 46%, var(--gh-demo-accent) 54%, transparent 54%) no-repeat right top / 50% 70%;
}

/* --- errors --- */

.gh-demo-form__error {
	margin: -10px 0 16px;
	font-size: 14px;
	color: #9a2c2c;
}

.gh-demo-form__fine {
	margin: 14px 0 0;
	font-size: 13px;
	color: var(--gh-demo-faint);
}

.gh-demo-form__fine--center {
	text-align: center;
}

.gh-demo-form__turnstile:not(:empty) {
	margin-bottom: 18px;
}

/* --- phone --- */

@media (max-width: 600px) {
	.gh-demo-form__card {
		padding: 24px 20px;
		border-radius: 16px;
	}

	.gh-demo-form__grid--2 {
		grid-template-columns: minmax(0, 1fr);
	}

	.gh-demo-form__option {
		min-height: 60px;
		font-size: 16px;
	}

	.gh-demo-form__heading {
		font-size: 26px;
	}
}

/* --- theme colour overrides --- */

/*
 * The groundhogg.io theme styles every button as its primary yellow CTA via
 * `body button:not(.tab-button)` - specificity 0,1,2, which beats the single
 * component classes above. Its typography and shape are wanted; only the
 * primary fill is wrong on a secondary control.
 *
 * So this layer is colours only, at 0,2,0 so it wins, and deliberately does
 * not restate padding, border, radius or font: on groundhogg.io those come
 * from the theme, and on a site without it the rules above still apply.
 *
 * The CTA is left alone - it is the primary action and the theme's yellow is
 * the right colour for it.
 */
.gh-demo-form .gh-demo-form__option,
.gh-demo-form .gh-demo-form__back,
.gh-demo-form .gh-demo-form__skip {
	background-color: transparent;
}

.gh-demo-form .gh-demo-form__option:hover,
.gh-demo-form .gh-demo-form__back:hover,
.gh-demo-form .gh-demo-form__skip:hover {
	background-color: var(--gh-demo-accent-soft);
}

/*
 * Selection is a 150ms flash before the next screen, so it borrows the theme's
 * primary yellow when there is one - the clearest "that registered" signal
 * available, in the site's own colour.
 */
.gh-demo-form .gh-demo-form__option.is-selected,
.gh-demo-form .gh-demo-form__option.is-selected:hover {
	background-color: var(--wp--preset--color--theme-yellow, var(--gh-demo-accent-soft));
	/* Keep the theme's own border colour - the accent blue reads as a mistake
	   against a black-bordered button. */
	border-color: var(--wp--preset--color--theme-dark-900, var(--gh-demo-accent));
}
