/**
 * Registration form.
 *
 * Layout and mechanics only — colour, spacing and typography come from the
 * Elementor controls.
 */

.wjs-form {
	--wjs-form-gap: 16px;
	--wjs-form-accent: #d4a53a;
}

.wjs-form__grid {
	display: grid;
	grid-template-columns: repeat( 6, 1fr );
	gap: var( --wjs-form-gap );
}

.wjs-form__field--w100 { grid-column: span 6; }
.wjs-form__field--w50  { grid-column: span 3; }
.wjs-form__field--w33  { grid-column: span 2; }

@media ( max-width: 767px ) {
	.wjs-form__field--w50,
	.wjs-form__field--w33 { grid-column: span 6; }
}

.wjs-form__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	line-height: 1.3;
}

.wjs-form__req {
	color: #c0392b;
}

.wjs-form__control {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 12px 14px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
	background: #fff;
	font: inherit;
	line-height: 1.4;
}

.wjs-form__control:focus {
	outline: 2px solid var( --wjs-form-accent );
	outline-offset: 1px;
	border-color: var( --wjs-form-accent );
}

.wjs-form__field.has-error .wjs-form__control {
	border-color: #c0392b;
}

.wjs-form__error {
	display: block;
	margin-top: 6px;
	color: #c0392b;
	font-size: 0.875em;
}

.wjs-form__error:empty {
	display: none;
}

/*
 * A field that has passed. Without this a successful check is invisible and the
 * validation looks like it isn't running at all.
 */
.wjs-form__field.is-valid .wjs-form__control {
	border-color: #2e7d32;
	padding-right: 38px;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232e7d32' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.5 3.5L13 5'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 15px;
}

/* Checkboxes and radios have no box to draw a tick inside. */
.wjs-form__field--checkboxes.is-valid .wjs-form__control,
.wjs-form__field--radio.is-valid .wjs-form__control,
.wjs-form__field--acceptance.is-valid .wjs-form__control {
	background-image: none;
	padding-right: 0;
}

/* A field waiting on the server. Deliberately quiet — a spinner on every blur
   would be noisier than the check is worth. */
.wjs-form__field.is-checking .wjs-form__control {
	background-image: linear-gradient( 90deg, transparent 0%, rgba( 0, 0, 0, 0.04 ) 50%, transparent 100% );
	background-size: 200% 100%;
	background-repeat: no-repeat;
	animation: wjs-form-checking 1s linear infinite;
}

@keyframes wjs-form-checking {
	from { background-position: -100% 0; }
	to   { background-position: 100% 0; }
}

@media ( prefers-reduced-motion: reduce ) {
	.wjs-form__field.is-checking .wjs-form__control {
		animation: none;
	}
}

/*
 * Checkboxes and radios.
 *
 * The native input is kept in the DOM and only hidden visually — it still takes
 * focus, still responds to the keyboard and space bar, and still reports
 * validity. Replacing it with a div would break all of that. The adjacent .box
 * is what actually gets drawn.
 */
.wjs-form__choices {
	display: flex;
	flex-direction: column;
	gap: var( --wjs-form-choice-gap, 10px );
}

.wjs-form__choice {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var( --wjs-form-box-gap, 10px );
	line-height: 1.4;
	cursor: pointer;
}

.wjs-form__choice input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

.wjs-form__box {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var( --wjs-form-box-size, 20px );
	height: var( --wjs-form-box-size, 20px );
	margin-top: 0.1em;
	border: var( --wjs-form-box-border-width, 1px ) solid var( --wjs-form-box-border, #c7c7c7 );
	border-radius: var( --wjs-form-box-radius, 4px );
	background: var( --wjs-form-box-bg, #fff );
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wjs-form__choice input[type="radio"] + .wjs-form__box {
	border-radius: 50%;
}

/* Tick drawn from two borders rather than an SVG, so its colour is a variable. */
.wjs-form__box::after {
	content: "";
	width: 28%;
	height: 55%;
	margin-top: -12%;
	border: solid var( --wjs-form-box-tick, #fff );
	border-width: 0 2px 2px 0;
	transform: rotate( 45deg ) scale( 0.6 );
	opacity: 0;
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.wjs-form__choice input[type="radio"] + .wjs-form__box::after {
	width: 44%;
	height: 44%;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var( --wjs-form-box-tick, #fff );
	transform: scale( 0.4 );
}

.wjs-form__choice input:checked + .wjs-form__box {
	border-color: var( --wjs-form-box-checked, var( --wjs-form-accent ) );
	background: var( --wjs-form-box-checked, var( --wjs-form-accent ) );
}

.wjs-form__choice input:checked + .wjs-form__box::after {
	opacity: 1;
	transform: rotate( 45deg ) scale( 1 );
}

.wjs-form__choice input[type="radio"]:checked + .wjs-form__box::after {
	transform: scale( 1 );
}

/* Focus ring on the box, since the real input is invisible. */
.wjs-form__choice input:focus-visible + .wjs-form__box {
	box-shadow: 0 0 0 3px var( --wjs-form-box-focus, rgba( 212, 165, 58, 0.35 ) );
}

.wjs-form__choice:hover .wjs-form__box {
	border-color: var( --wjs-form-box-checked, var( --wjs-form-accent ) );
}

.wjs-form__field.has-error .wjs-form__box {
	border-color: #c0392b;
}

@media ( prefers-reduced-motion: reduce ) {
	.wjs-form__box,
	.wjs-form__box::after {
		transition-duration: 0.01ms;
	}
}

.wjs-form__heading {
	margin: 0;
	line-height: 1.3;
}

/* Steps. Only hidden once JS has enhanced the form, so without scripting the
   whole thing renders as one long page and still submits. */
.wjs-form__step + .wjs-form__step {
	margin-top: var( --wjs-form-gap );
}

.wjs-form.is-enhanced .wjs-form__step {
	display: none;
}

.wjs-form.is-enhanced .wjs-form__step.is-active {
	display: block;
}

.wjs-form__progress {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.wjs-form__progress-item {
	display: flex;
	align-items: center;
	gap: 8px;
	opacity: 0.45;
	transition: opacity 0.2s ease;
}

.wjs-form__progress-item.is-active,
.wjs-form__progress-item.is-done {
	opacity: 1;
}

.wjs-form__progress-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 0.8em;
	flex: 0 0 auto;
}

.wjs-form__progress-item.is-active .wjs-form__progress-num,
.wjs-form__progress-item.is-done .wjs-form__progress-num {
	border-color: var( --wjs-form-accent );
	background: var( --wjs-form-accent );
	color: #fff;
}

/*
 * Tabs.
 *
 * Panels only hide once JS has added .is-tabbed, so with scripting off every
 * section renders in sequence and the form still submits in full.
 */
.wjs-form__tablist {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	margin-bottom: 24px;
	border-bottom: 1px solid #e4e4e4;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.wjs-form__tablist::-webkit-scrollbar {
	display: none;
}

.wjs-form__tab {
	flex: 0 0 auto;
	position: relative;
	padding: 10px 16px;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	white-space: nowrap;
	opacity: 0.6;
	cursor: pointer;
	transition: opacity 0.15s ease, color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

/* Themes style <button> heavily; keep every state flat but the active one. */
.wjs-form__tab:hover,
.wjs-form__tab:focus,
.wjs-form__tab:active {
	background: none;
	box-shadow: none;
	outline: none;
	opacity: 1;
}

.wjs-form__tab:focus-visible {
	outline: 2px solid var( --wjs-form-accent );
	outline-offset: -2px;
}

.wjs-form__tab.is-active {
	opacity: 1;
	font-weight: 600;
}

.wjs-form__tab.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: var( --wjs-form-accent );
}

.wjs-form.is-tabbed .wjs-form__panel {
	display: none;
}

.wjs-form.is-tabbed .wjs-form__panel.is-active {
	display: block;
}

/* Stacked fallback: sections read as one form, so they need separating. */
.wjs-form:not( .is-tabbed ) .wjs-form__panel + .wjs-form__panel {
	margin-top: calc( var( --wjs-form-gap ) * 2 );
}

.wjs-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

.wjs-form__button {
	padding: 13px 26px;
	border: 0;
	border-radius: 4px;
	background: var( --wjs-form-accent );
	color: #fff;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.wjs-form__button[hidden] {
	display: none;
}

.wjs-form__button--prev {
	background: transparent;
	color: inherit;
	box-shadow: inset 0 0 0 1px currentColor;
}

.wjs-form__button:disabled {
	opacity: 0.6;
	cursor: default;
}

.wjs-form__notice {
	margin-bottom: 20px;
	padding: 14px 16px;
	border-left: 3px solid;
	border-radius: 3px;
	background: #f6f6f6;
}

.wjs-form__notice--error   { border-color: #c0392b; }
.wjs-form__notice--success { border-color: #2e7d32; }
.wjs-form__notice--info    { border-color: #777; }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.wjs-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media ( prefers-reduced-motion: reduce ) {
	.wjs-form__progress-item,
	.wjs-form__button {
		transition-duration: 0.01ms;
	}
}
