/*
 * Contact Form 7, dressed as the Figma form.
 *
 * Figma Contact 160:15 and Accessibility 163:281. Filled fields on --se-field,
 * no borders, a mono label above every control, focus filling to --se-cocoa2
 * with a red ring, validation as a red mono line and the sent message in bone.
 */

.se-form .wpcf7 {
	margin: 0;
}

.se-form form {
	display: flex;
	flex-direction: column;
	gap: clamp(1.125rem, 1.46vw, 1.75rem);
}

/* CF7 wraps controls in spans that must not break the layout. */
.se-form .wpcf7-form-control-wrap {
	display: block;
}

/* ----------------------------------------------------------------- rows */

/*
 * Contact Form 7 runs its own autop over the form markup, which wraps a row's
 * two fields in a <p> and joins them with a <br>. Both shapes are made to lay
 * out the same way, so the row is two columns whether autop ran or not.
 */
.se-form .se-form__row,
.se-form .se-form__row > p {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1.125rem, 1.46vw, 1.75rem);
	margin: 0;
}

.se-form .se-form__row > p {
	grid-column: 1 / -1;
}

.se-form form p {
	margin: 0;
}

.se-form form br {
	display: none;
}

.se-form .se-field {
	display: block;
	margin: 0;
}

.se-form .se-field__label {
	display: block;
	margin-block-end: clamp(0.375rem, 0.52vw, 0.625rem);
	font-family: var(--se-font-mono);
	font-weight: 500;
	font-size: clamp(0.6875rem, 0.73vw, 0.875rem);
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--se-grey);
	transition: color var(--se-dur) var(--se-ease);
}

.se-form .se-field:focus-within .se-field__label,
.se-form .se-field--strong .se-field__label {
	color: var(--se-bone);
}

/* --------------------------------------------------------------- inputs */

.se-form input[type="text"],
.se-form input[type="email"],
.se-form input[type="tel"],
.se-form input[type="url"],
.se-form input[type="number"],
.se-form input[type="date"],
.se-form select,
.se-form textarea {
	width: 100%;
	height: clamp(3rem, 3.33vw, 4rem);
	padding: 0 clamp(0.875rem, 1.25vw, 1.5rem);
	background: var(--se-field);
	border: 0;
	border-radius: 0;
	color: var(--se-bone);
	font-family: var(--se-font-body);
	font-size: clamp(1rem, 0.99vw, 1.1875rem);
	line-height: 1.4;
	appearance: none;
	transition: background-color var(--se-dur) var(--se-ease);
}

.se-form textarea {
	height: clamp(9rem, 11.46vw, 13.75rem);
	padding-block: clamp(0.875rem, 1.04vw, 1.25rem);
	resize: vertical;
}

.se-form ::placeholder {
	/* QA-MOBILE: was --se-grey-dark, 2.81:1 on the field fill. */
	color: var(--se-grey);
	opacity: 1;
}

.se-form input:hover,
.se-form select:hover,
.se-form textarea:hover {
	background: #251f1a;
}

.se-form input:focus-visible,
.se-form select:focus-visible,
.se-form textarea:focus-visible {
	background: var(--se-cocoa2);
	outline: 2px solid var(--se-red-hot);
	outline-offset: 2px;
}

.se-form input:focus,
.se-form select:focus,
.se-form textarea:focus {
	background: var(--se-cocoa2);
}

/* --------------------------------------------------------------- select */

.se-form .se-field--select {
	position: relative;
}

.se-form .se-field--select select {
	padding-inline-end: clamp(2.5rem, 3.125vw, 3.75rem);
	cursor: pointer;
}

.se-form .se-field--select::after {
	content: "";
	position: absolute;
	inset-inline-end: clamp(1.25rem, 1.56vw, 1.875rem);
	inset-block-end: clamp(1.25rem, 1.41vw, 1.6875rem);
	width: 0.5rem;
	height: 0.5rem;
	border-inline-end: 2px solid var(--se-red-hot);
	border-block-end: 2px solid var(--se-red-hot);
	transform: rotate(45deg);
	pointer-events: none;
}

/* The open list, as close to the Figma panel as a native control allows. */
.se-form select option {
	background: var(--se-field);
	color: rgba(243, 238, 229, 0.85);
}

.se-form select option:checked {
	background: var(--se-cocoa2);
	color: var(--se-red-hot);
}

/* ---------------------------------------------------------------- upload */

.se-form .se-upload {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: clamp(4.5rem, 5vw, 6rem);
	padding: 0 clamp(1rem, 1.46vw, 1.75rem);
	background: var(--se-field);
	cursor: pointer;
	transition: background-color var(--se-dur) var(--se-ease);
}

.se-form .se-upload:hover {
	background: #251f1a;
}

.se-form .se-upload:focus-within {
	background: var(--se-cocoa2);
	outline: 2px solid var(--se-red-hot);
	outline-offset: 2px;
}

/*
 * QA-MOBILE: Contact Form 7 ships `.wpcf7-form-control-wrap { position: relative }`,
 * so that span, not the 350 x 83 upload box, was the containing block for the
 * input below. The input filled a 28 x 24 wrap and only that corner of the
 * control could be tapped. Stretch the wrap first.
 */
.se-form .se-upload .wpcf7-form-control-wrap {
	position: absolute;
	inset: 0;
}

.se-form .se-upload input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.se-form .se-upload__name {
	font-family: var(--se-font-body);
	font-size: clamp(1rem, 0.99vw, 1.1875rem);
	color: var(--se-bone);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.se-form .se-upload__hint {
	flex: none;
	font-family: var(--se-font-mono);
	font-weight: 500;
	font-size: clamp(0.625rem, 0.68vw, 0.8125rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	/* QA-MOBILE: was --se-grey-dark, 2.4:1 on black at 10px. */
	color: var(--se-grey);
}

.se-form .se-form__note {
	display: block;
	margin: clamp(0.5rem, 0.73vw, 0.875rem) 0 0;
	max-width: 51.25rem;
	font-family: var(--se-font-body);
	font-size: clamp(0.875rem, 0.83vw, 1rem);
	line-height: 1.5;
	color: var(--se-grey);
}

/* ------------------------------------------------------------ checkboxes */

.se-form .se-checks .wpcf7-checkbox,
.se-form .se-checks .wpcf7-radio {
	display: flex;
	flex-direction: column;
	gap: clamp(0.5rem, 0.94vw, 1.125rem);
}

.se-form .se-checks .wpcf7-list-item {
	margin: 0;
}

.se-form .se-checks label {
	display: flex;
	align-items: center;
	gap: clamp(0.75rem, 0.94vw, 1.125rem);
	font-family: var(--se-font-body);
	font-size: clamp(1rem, 0.99vw, 1.1875rem);
	line-height: 1.3;
	color: rgba(243, 238, 229, 0.85);
	cursor: pointer;
}

.se-form .se-checks input[type="checkbox"] {
	flex: none;
	width: clamp(1.25rem, 1.46vw, 1.75rem);
	height: clamp(1.25rem, 1.46vw, 1.75rem);
	margin: 0;
	background: var(--se-night);
	border: 0;
	border-radius: 0;
	appearance: none;
	cursor: pointer;
	transition: background-color var(--se-dur) var(--se-ease);
}

.se-form .se-checks input[type="checkbox"]:hover {
	background: var(--se-cocoa2);
}

.se-form .se-checks input[type="checkbox"]:checked {
	background: var(--se-red);
}

.se-form .se-checks input[type="checkbox"]:checked + .wpcf7-list-item-label {
	color: var(--se-bone);
}

.se-form .se-checks input:focus-visible {
	outline: 2px solid var(--se-red-hot);
	outline-offset: 3px;
}

/* --------------------------------------------------------- text toggles */

.se-form .se-toggles .wpcf7-radio,
.se-form .se-toggles .wpcf7-checkbox {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1.25rem, 2.08vw, 2.5rem);
}

.se-form .se-toggles .wpcf7-list-item {
	margin: 0;
}

.se-form .se-toggles label {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.se-form .se-toggles input[type="radio"],
.se-form .se-toggles input[type="checkbox"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.se-form .se-toggles .wpcf7-list-item-label {
	font-family: var(--se-font-display);
	font-weight: 600;
	font-size: clamp(1.125rem, 1.35vw, 1.625rem);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: rgba(243, 238, 229, 0.55);
	transition: color var(--se-dur) var(--se-ease);
}

.se-form .se-toggles label:hover .wpcf7-list-item-label {
	color: var(--se-bone);
}

.se-form .se-toggles input:checked + .wpcf7-list-item-label {
	color: var(--se-red-hot);
}

.se-form .se-toggles input:focus-visible + .wpcf7-list-item-label {
	outline: 2px solid var(--se-red-hot);
	outline-offset: 4px;
}

/* -------------------------------------------------------------- headings */

.se-form .se-form__group-label {
	margin: clamp(0.5rem, 0.94vw, 1.125rem) 0 0;
	font-family: var(--se-font-mono);
	font-weight: 500;
	font-size: clamp(0.6875rem, 0.73vw, 0.875rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--se-bone);
}

/* -------------------------------------------------------------- send row */

.se-form .se-form__send {
	padding-block-start: clamp(0.5rem, 1.04vw, 1.25rem);
}

.se-form input[type="submit"],
.se-form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	padding: clamp(0.75rem, 0.94vw, 1.125rem) clamp(1.25rem, 1.56vw, 1.875rem);
	background: var(--se-red);
	border: 0;
	border-radius: 0;
	color: #fff;
	font-family: var(--se-font-display);
	font-weight: 700;
	font-size: clamp(1rem, 1.09vw, 1.3125rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--se-dur) var(--se-ease);
}

.se-form input[type="submit"]:hover,
.se-form button[type="submit"]:hover {
	background: var(--se-red-hot);
}

.se-form input[type="submit"]:focus-visible,
.se-form button[type="submit"]:focus-visible {
	outline: 2px solid var(--se-red-hot);
	outline-offset: 3px;
}

/* ------------------------------------------------------------ validation */

.se-form .wpcf7-not-valid-tip {
	display: block;
	margin-block-start: 0.5rem;
	font-family: var(--se-font-mono);
	font-weight: 500;
	font-size: clamp(0.6875rem, 0.73vw, 0.875rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--se-red-hot);
}

.se-form .wpcf7-not-valid {
	background: var(--se-cocoa2);
}

.se-form .wpcf7-response-output {
	margin: 0;
	padding: clamp(0.875rem, 1.04vw, 1.25rem) clamp(1rem, 1.25vw, 1.5rem);
	border: 0;
	background: var(--se-night);
	font-family: var(--se-font-body);
	font-size: clamp(1rem, 0.99vw, 1.1875rem);
	line-height: 1.5;
	color: var(--se-bone);
}

.se-form form.invalid .wpcf7-response-output,
.se-form form.unaccepted .wpcf7-response-output,
.se-form form.failed .wpcf7-response-output,
.se-form form.aborted .wpcf7-response-output,
.se-form form.spam .wpcf7-response-output {
	color: var(--se-red-hot);
}

.se-form .wpcf7-spinner {
	margin-inline-start: 0.75rem;
	background: var(--se-cocoa3);
}

.se-form .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.se-form__missing {
	color: var(--se-grey);
}

/* ------------------------------------------------------- small viewports */

@media (max-width: 767px) {
	.se-form .se-form__row,
	.se-form .se-form__row > p {
		grid-template-columns: minmax(0, 1fr);
	}

	.se-form .se-upload {
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		gap: 0.375rem;
		padding-block: 1rem;
	}

	.se-form input[type="submit"],
	.se-form button[type="submit"] {
		width: 100%;
		justify-content: center;
	}
}
