.wpcf7 {
	max-width: 70%;
}

@media (max-width: 767px) {
	.wpcf7 {
		max-width: 100%;
	}
}

/* Page forms sit on a tinted card. The booking dialog resets this below. */
.wpcf7 .wpcf7-form {
	padding: clamp(1.5rem, 1rem + 2vw, 2.75rem);
	border-radius: var(--radius-signature);
	background: var(--color-tint);
}

.wpcf7 .wpcf7-form p {
	margin: 0 0 1rem;
}

.wpcf7 input:not([type="submit"], [type="checkbox"], [type="radio"]),
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	padding: 0.875rem 1.125rem;
	border: 2px solid transparent;
	border-radius: var(--radius-field);
	background: var(--color-white);
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
	color: var(--color-black);
	font: inherit;
	font-size: var(--text-sm);
	transition: border-color var(--duration-fast), box-shadow var(--duration-normal);
}

.wpcf7 input:not([type="submit"], [type="checkbox"], [type="radio"]):hover,
.wpcf7 select:hover,
.wpcf7 textarea:hover {
	border-color: rgb(255 55 0 / 0.35);
}

/* The accent border and halo are the focus indicator for fields. */
.wpcf7 input:not([type="submit"], [type="checkbox"], [type="radio"]):focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	border-color: var(--color-accent);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 4px rgb(255 55 0 / 0.15);
}

.wpcf7 textarea {
	height: 8rem;
	resize: vertical;
}

.wpcf7 ::placeholder {
	color: var(--color-placeholder);
}

.wpcf7 input.wpcf7-not-valid,
.wpcf7 select.wpcf7-not-valid,
.wpcf7 textarea.wpcf7-not-valid {
	border-color: var(--color-error);
}

.wpcf7 .wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.375rem;
	color: var(--color-error);
	font-family: var(--font-body);
	font-size: 0.75rem;
	font-weight: 600;
}

.wpcf7 input[type="submit"] {
	margin-top: 0.5rem;
	padding: 1rem 2.5rem;
	border: 0;
	border-radius: var(--radius-button);
	background: var(--color-accent-soft);
	box-shadow: var(--shadow-accent);
	color: var(--color-white);
	font: 400 1.25rem/1 var(--font-heading);
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	transition:
		background-color var(--duration-normal),
		box-shadow var(--duration-normal),
		opacity var(--duration-fast),
		transform var(--duration-normal) var(--ease-out);
}

.wpcf7 input[type="submit"]:hover {
	background: var(--color-ink);
	box-shadow: var(--shadow-ink);
	transform: translateY(-3px);
}

.wpcf7 input[type="submit"]:active {
	box-shadow: none;
	transform: translateY(0) scale(0.98);
}

.wpcf7 .wpcf7-form.submitting input[type="submit"] {
	opacity: 0.6;
	cursor: progress;
}

.wpcf7 .wpcf7-spinner {
	margin: 0.5rem 0 0 0.75rem;
	vertical-align: middle;
	background-color: var(--color-accent);
}

/* Higher specificity than the plugin's own response styles. */
.wpcf7 .wpcf7-form .wpcf7-response-output {
	margin: 1.25rem 0 0;
	padding: 0.875rem 1.25rem;
	border: 0;
	border-left: 4px solid var(--color-accent);
	border-radius: var(--radius-menu);
	background: var(--color-white);
	font-weight: 600;
}

.wpcf7 .wpcf7-form.invalid .wpcf7-response-output,
.wpcf7 .wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7 .wpcf7-form.payment-required .wpcf7-response-output,
.wpcf7 .wpcf7-form.failed .wpcf7-response-output,
.wpcf7 .wpcf7-form.aborted .wpcf7-response-output,
.wpcf7 .wpcf7-form.spam .wpcf7-response-output {
	border-left-color: var(--color-error);
	color: var(--color-error);
}

.wpcf7 .wpcf7-form.sent .wpcf7-response-output {
	border-left-color: var(--color-success);
	background: #e8f4ec;
	color: var(--color-success);
}

.booking-dialog {
	width: min(32rem, calc(100vw - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 2rem;
	border: 0;
	border-radius: var(--radius-signature);
	opacity: 0;
	transform: translateY(1.5rem) scale(0.97);
	transition:
		opacity var(--duration-normal) var(--ease-out),
		transform var(--duration-normal) var(--ease-out),
		overlay var(--duration-normal) allow-discrete,
		display var(--duration-normal) allow-discrete;
}

.booking-dialog[open] {
	opacity: 1;
	transform: none;
}

.booking-dialog::backdrop {
	background: rgb(0 0 0 / 0);
	transition:
		background-color var(--duration-normal),
		overlay var(--duration-normal) allow-discrete,
		display var(--duration-normal) allow-discrete;
}

.booking-dialog[open]::backdrop {
	background: rgb(0 0 0 / 0.6);
}

/* Browsers without @starting-style open the dialog without animation. */
@starting-style {
	.booking-dialog[open] {
		opacity: 0;
		transform: translateY(1.5rem) scale(0.97);
	}

	.booking-dialog[open]::backdrop {
		background: rgb(0 0 0 / 0);
	}
}

.booking-dialog__title {
	margin: 0 0 1rem;
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: var(--text-h2);
	line-height: 1.15;
}

.booking-dialog__close {
	position: absolute;
	top: 0.75rem;
	right: 1rem;
	padding: 0.25rem 0.5rem;
	border: 0;
	border-radius: var(--radius-field);
	background: none;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

.booking-dialog .wpcf7 {
	max-width: none;
}

/* The dialog is already a white card, so the fields carry the tint instead. */
.booking-dialog .wpcf7 .wpcf7-form {
	padding: 0;
	border-radius: 0;
	background: none;
}

.booking-dialog .wpcf7 input:not([type="submit"], [type="checkbox"], [type="radio"]),
.booking-dialog .wpcf7 select,
.booking-dialog .wpcf7 textarea {
	background: var(--color-tint);
	box-shadow: none;
}

.booking-dialog .wpcf7 .wpcf7-form:not(.sent) .wpcf7-response-output {
	background: var(--color-tint);
}

/* reCAPTCHA renders late; its space is reserved so the submit button does not jump under the pointer. */
.wpcf7 .wpcf7-recaptcha {
	display: block;
	min-height: 78px;
}
