/**
 * Forms: the footer newsletter form and the Contact page form, both WS Form Pro.
 * Numbers from design/reference/pages/contact/ and the footer measurements.
 *
 * WS Form draws its markup in the browser and loads its own stylesheet after the theme's,
 * so every rule here is scoped to `form.wsf-form.pw-form` (the class set on each form by
 * ops/scripts/wsf-create-forms.php) and the box properties that WS Form also sets are
 * marked !important. Nothing here reaches any other form.
 */

/* ---------- Shared skeleton: one full-width field per row ---------- */
form.wsf-form.pw-form {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
}
form.wsf-form.pw-form .wsf-grid {
	display: flex !important;
	flex-direction: column;
	margin: 0 !important;
}
form.wsf-form.pw-form .wsf-tile,
form.wsf-form.pw-form .wsf-section {
	flex: none !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
}
form.wsf-form.pw-form .wsf-field-wrapper {
	align-self: stretch !important;
}
form.wsf-form.pw-form input.wsf-field:not([type="checkbox"]),
form.wsf-form.pw-form textarea.wsf-field {
	display: block;
	width: 100% !important;
	height: auto !important;
	min-height: 40px;
	margin: 0 !important;
	padding: 8px 16px !important;
	box-shadow: none !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 15px !important;
	font-weight: 400;
	line-height: 1.4 !important;
}
form.wsf-form.pw-form input.wsf-field:not([type="checkbox"]):focus,
form.wsf-form.pw-form textarea.wsf-field:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}
form.wsf-form.pw-form button.wsf-button {
	display: block;
	min-height: 40px;
	margin: 0 !important;
	padding: 8px 14px !important;
	border: 0 !important;
	border-radius: var(--pw-radius) !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	text-transform: uppercase;
	cursor: pointer;
}
form.wsf-form.pw-form .wsf-invalid-feedback {
	margin-top: 4px;
	font-size: 14px;
	line-height: 1.3;
}
form.wsf-form.pw-form .wsf-alert,
.pw-form-message {
	font-size: 16px;
}

/* WS Form draws each form in the browser after the page has loaded, and only then adds
   the form's own class names. Until that moment the page holds an empty <form>, so the
   space is held by WHERE the form sits, not by its class: without this the Contact page's
   footer jumped by a sixth of the screen when the form appeared. */
.pw-footer__signup form.wsf-form {
	min-height: 140px;
}
.pw-contact__col--form form.wsf-form {
	min-height: 422px;
}
@media (max-width: 880px) {
	.pw-contact__col--form form.wsf-form {
		min-height: 449px; /* the tick boxes wrap to three rows */
	}
}

/* ---------- Footer newsletter: grey fields, red button, 10px between rows ---------- */
form.wsf-form.pw-form--newsletter .wsf-fields {
	gap: 10px;
}
form.wsf-form.pw-form--newsletter input.wsf-field {
	border: 1px solid #69727d !important;
	border-radius: 0 !important;
	background: #7a7a7a !important;
	color: #fff !important;
}
form.wsf-form.pw-form--newsletter input.wsf-field::placeholder {
	color: #fff;
	opacity: 0.6;
}
form.wsf-form.pw-form--newsletter button.wsf-button {
	width: 100% !important;
	background: var(--accent-alt) !important;
	font-family: var(--wp--preset--font-family--body) !important;
}

/* ---------- Contact: white fields, labels above, 20px between rows ---------- */
form.wsf-form.pw-form--contact .wsf-fields {
	gap: 20px;
}
/* `.wsf-label`, not `label.wsf-label`: from WS Form 1.12 the label of a group of tick boxes
   is a <div class="wsf-label">, no longer a <label> (seen on production 2026-12-01, the
   day the plugin was updated there). Both versions have to look the same. */
form.wsf-form.pw-form--contact .wsf-label {
	display: block;
	width: fit-content;
	margin: 0 !important;
	padding: 0 !important;
	color: var(--text) !important;
	font-size: 18px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
}
form.wsf-form.pw-form--contact input.wsf-field:not([type="checkbox"]),
form.wsf-form.pw-form--contact textarea.wsf-field {
	border: 1px solid #d5d5d5 !important;
	border-radius: 3px !important;
	background: #fff !important;
	color: var(--text) !important;
}
form.wsf-form.pw-form--contact textarea.wsf-field {
	height: 96px !important;
	padding: 5px 14px !important;
	resize: vertical;
}
form.wsf-form.pw-form--contact input.wsf-field::placeholder,
form.wsf-form.pw-form--contact textarea.wsf-field::placeholder {
	color: var(--text);
	opacity: 0.6;
}

/* Tick boxes: side by side, wrapping, 10px after each, one 27px line per row.
   `:not(.wsf-label)` keeps this off the group's own label, which is a <div> from
   WS Form 1.12 on. */
form.wsf-form.pw-form--contact [data-type="checkbox"] > div:not(.wsf-invalid-feedback):not(.wsf-label) {
	display: flex;
	flex-wrap: wrap;
	margin-top: 0.6px;
	line-height: 27px;
}
form.wsf-form.pw-form--contact [data-row-checkbox] {
	display: flex;
	align-items: flex-start;
	min-height: 27px;
	margin: 0 !important;
	padding: 0 10px 0 0 !important;
}
form.wsf-form.pw-form--contact [data-row-checkbox] input.wsf-field {
	position: static !important;
	flex: none;
	width: 13px !important;
	height: 13px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	top: 0;
	margin: 6.2px 3.8px 0 0 !important;
	opacity: 1 !important;
	appearance: auto !important;
}
form.wsf-form.pw-form--contact [data-row-checkbox] label.wsf-label {
	padding: 1.5px 0 !important;
	line-height: 18px !important;
}
form.wsf-form.pw-form--contact [data-row-checkbox] label.wsf-label::before,
form.wsf-form.pw-form--contact [data-row-checkbox] label.wsf-label::after {
	display: none !important;
}

/* Button: the site's orange button, half the form wide less half a 10px gutter. */
form.wsf-form.pw-form--contact button.wsf-button {
	width: calc(50% - 5px) !important;
	background: var(--accent) !important;
	font-family: var(--wp--preset--font-family--mono) !important;
}

@media (max-width: 767px) {
	form.wsf-form.pw-form--contact button.wsf-button {
		width: 100% !important;
	}
}
