/**
 * Online Forms — front end.
 *
 * Everything is scoped under .wof and driven by custom properties, so a theme
 * can restyle the form by redeclaring the variables rather than fighting
 * selectors. Fonts are inherited on purpose: the form should look like it
 * belongs to the site around it.
 */

.wof {
	--wof-accent: #1f6feb;
	--wof-accent-text: #ffffff;
	--wof-text: #1d2327;
	--wof-muted: #646970;
	--wof-border: #c3c4c7;
	--wof-border-strong: #8c8f94;
	--wof-field-bg: #ffffff;
	--wof-radius: 4px;
	--wof-gap: 18px;
	--wof-error: #b32d2e;
	--wof-error-bg: #fcf0f1;
	--wof-success: #00713c;
	--wof-success-bg: #edfaef;

	box-sizing: border-box;
	color: var(--wof-text);
	max-width: 780px;
	scroll-margin-top: 24px;
}

.wof *,
.wof *::before,
.wof *::after {
	box-sizing: inherit;
}

.wof__title {
	margin: 0 0 0.35em;
}

.wof__intro {
	margin: 0 0 1.25em;
	color: var(--wof-muted);
}

/* Notices ------------------------------------------------------------------ */

.wof-notice {
	border-left: 4px solid var(--wof-border-strong);
	border-radius: var(--wof-radius);
	margin: 0 0 var(--wof-gap);
	padding: 14px 16px;
}

.wof-notice p {
	margin: 0 0 0.5em;
}

.wof-notice p:last-child,
.wof-notice ul:last-child {
	margin-bottom: 0;
}

.wof-notice ul {
	margin: 0;
	padding-left: 1.2em;
}

.wof-notice--error {
	background: var(--wof-error-bg);
	border-left-color: var(--wof-error);
}

.wof-notice--success {
	background: var(--wof-success-bg);
	border-left-color: var(--wof-success);
	font-size: 1.05em;
}

.wof-notice:focus {
	outline: 2px solid var(--wof-accent);
	outline-offset: 2px;
}

/* Layout ------------------------------------------------------------------- */

.wof__required-note {
	color: var(--wof-muted);
	font-size: 0.85em;
	margin: 0 0 var(--wof-gap);
}

.wof__req {
	color: var(--wof-error);
}

.wof__grid {
	display: grid;
	gap: var(--wof-gap);
	grid-template-columns: repeat(6, 1fr);
}

.wof__field--full {
	grid-column: span 6;
}

.wof__field--half {
	grid-column: span 3;
}

.wof__field--third {
	grid-column: span 2;
}

.wof__heading h3 {
	border-bottom: 1px solid var(--wof-border);
	margin: 0.5em 0 0;
	padding-bottom: 0.4em;
}

/* Fields ------------------------------------------------------------------- */

.wof__label {
	display: block;
	font-size: 0.9em;
	font-weight: 600;
	letter-spacing: 0.01em;
	margin-bottom: 6px;
	padding: 0;
}

.wof__fieldset {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.wof input[type="text"],
.wof input[type="email"],
.wof input[type="tel"],
.wof input[type="url"],
.wof input[type="number"],
.wof input[type="date"],
.wof input[type="time"],
.wof select,
.wof textarea {
	background: var(--wof-field-bg);
	border: 1px solid var(--wof-border);
	border-radius: var(--wof-radius);
	color: inherit;
	display: block;
	font: inherit;
	line-height: 1.4;
	padding: 10px 12px;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	width: 100%;
}

.wof textarea {
	min-height: 120px;
	resize: vertical;
}

.wof select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--wof-border-strong) 50%),
		linear-gradient(135deg, var(--wof-border-strong) 50%, transparent 50%);
	background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
	background-repeat: no-repeat;
	background-size: 5px 5px, 5px 5px;
	padding-right: 34px;
}

.wof input[type="file"] {
	border: 1px dashed var(--wof-border-strong);
	border-radius: var(--wof-radius);
	display: block;
	font: inherit;
	padding: 12px;
	width: 100%;
}

.wof input:focus,
.wof select:focus,
.wof textarea:focus {
	border-color: var(--wof-accent);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--wof-accent) 25%, transparent);
	outline: none;
}

.wof input:focus-visible,
.wof select:focus-visible,
.wof textarea:focus-visible,
.wof button:focus-visible {
	outline: 2px solid var(--wof-accent);
	outline-offset: 2px;
}

.wof [aria-invalid="true"] {
	border-color: var(--wof-error);
}

.wof__help {
	color: var(--wof-muted);
	display: block;
	font-size: 0.82em;
	margin-top: 5px;
}

.wof__error {
	color: var(--wof-error);
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	margin-top: 5px;
}

/* Radios and checkboxes ---------------------------------------------------- */

.wof__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}

.wof__choice {
	align-items: center;
	display: inline-flex;
	gap: 7px;
}

.wof__choice input {
	accent-color: var(--wof-accent);
	flex: none;
	height: 1.05em;
	margin: 0;
	width: 1.05em;
}

.wof__choice label {
	cursor: pointer;
	font-size: 0.95em;
	margin: 0;
}

/* Captcha and submit ------------------------------------------------------- */

.wof__captcha {
	margin-top: var(--wof-gap);
}

.wof__actions {
	margin-top: var(--wof-gap);
}

.wof__submit {
	background: var(--wof-accent);
	border: 1px solid transparent;
	border-radius: var(--wof-radius);
	color: var(--wof-accent-text);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 12px 26px;
	transition: filter 120ms ease;
}

.wof__submit:hover {
	filter: brightness(0.92);
}

.wof__submit[disabled] {
	cursor: progress;
	opacity: 0.65;
}

/* The honeypot must stay in the DOM and out of sight, without display:none,
   which some bots treat as a signal. */
.wof__trap {
	height: 1px;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

/* Narrow screens ----------------------------------------------------------- */

@media (max-width: 640px) {
	.wof__grid {
		grid-template-columns: 1fr;
	}

	.wof__field--full,
	.wof__field--half,
	.wof__field--third {
		grid-column: 1 / -1;
	}

	.wof__submit {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wof * {
		transition: none !important;
	}
}
