/*
 * Agency Kit Forms in the Woning design. The plugin owns structure and
 * behaviour; these rules give its default parts the approved look.
 */
form.agency-form {
	display: block;
}

form.agency-form .agency-form__section {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

form.agency-form .agency-form__fields {
	display: grid;
	gap: var(--wp--preset--spacing--form-row) 30px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

form.agency-form .agency-form__field {
	display: block;
	font-size: var(--wp--preset--font-size--field);
	grid-column: span 1;
	min-width: 0;
	position: relative;
}

form.agency-form .agency-form__field--full {
	grid-column: 1 / -1;
}

/* Row rhythm of the source form. */
form.agency-form [data-agency-field="first_name"],
form.agency-form [data-agency-field="last_name"] {
	margin-bottom: clamp(0px, calc(0px + 8 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 8px);
}

form.agency-form [data-agency-field="email"] {
	margin-bottom: clamp(0px, calc(0px + 5 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 5px);
}

form.agency-form [data-agency-field="telephone"] {
	margin-bottom: clamp(0px, calc(0px + 4 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 4px);
}

form.agency-form [data-agency-field="company"] {
	margin-bottom: clamp(0px, calc(0px + 7 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 7px);
}

form.agency-form [data-agency-field="message"] {
	margin-bottom: clamp(0px, calc(0px + 10 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 10px);
}

form.agency-form [data-agency-field="consent"] {
	margin-bottom: clamp(6px, calc(6px + 3 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 9px);
}

form.agency-form.is-style-woning-contractor-form [data-agency-field="message"] {
	margin-bottom: clamp(1px, calc(1px + 9 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 10px);
}

form.agency-form.is-style-woning-contractor-form [data-agency-field="consent"] {
	margin-bottom: clamp(1px, calc(1px + 8 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 9px);
}

/* The placeholder is the visible label; the label stays for assistive technology. */
form.agency-form .agency-form__label {
	clip-path: inset(50%);
	font-weight: 400;
	height: 1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

form.agency-form .agency-form__required {
	display: none;
}

form.agency-form .agency-form__control {
	background: #fff;
	border: 2px solid var(--wp--preset--color--input-line);
	border-radius: 0;
	box-sizing: border-box;
	color: #000;
	display: block;
	font: inherit;
	line-height: 1.4;
	min-height: 44px;
	padding: 3px 3px 3px 12px;
	transition: border-color 0.5s ease, color 0.5s ease;
	width: 100%;
}

form.agency-form textarea.agency-form__control {
	min-height: 126px;
	padding: 0.75em 10px 3px 12px;
	resize: none;
}

form.agency-form .agency-form__control::placeholder {
	color: #c7c7c7;
	opacity: 1;
}

form.agency-form .agency-form__control:focus,
form.agency-form .agency-form__control:focus-visible {
	border-color: var(--wp--preset--color--contrast);
	outline: none;
}

form.agency-form .agency-form__control:user-invalid,
form.agency-form .agency-form__field.is-invalid .agency-form__control {
	border-color: #ff4040;
	color: #ff4040;
	outline: none;
}

/* Consent. */
form.agency-form .agency-form__choice {
	align-items: center;
	color: var(--wp--preset--color--base);
	cursor: pointer;
	display: flex;
	gap: 13px;
	line-height: 1;
}

form.agency-form .agency-form__choice a {
	color: inherit;
	text-decoration: underline;
}

form.agency-form .agency-form__choice input[type="checkbox"] {
	appearance: none;
	background: #fff;
	border: 1px solid var(--wp--preset--color--input-line);
	border-radius: 0;
	cursor: pointer;
	flex: 0 0 auto;
	height: 18px;
	margin: 0;
	padding: 0;
	width: 18px;
}

form.agency-form .agency-form__choice input[type="checkbox"]:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7.40011 5.68606'%3E%3Cpath fill='%23c7c7c7' d='M2.55016,5.68606c-.01709,0-.03369-.001-.05078-.002a.7.7,0,0,1-.51758-.28955L.1317,2.82326a.7.7,0,1,1,1.13672-.81738l1.36133,1.8916L6.19713.2134A.69995.69995,0,0,1,7.203,1.187L3.05309,5.47268A.7.7,0,0,1,2.55016,5.68606Z'/%3E%3C/svg%3E");
	background-position: 50% 50%;
	background-repeat: no-repeat;
	background-size: 50% auto;
}

form.agency-form .agency-form__choice:hover input[type="checkbox"]:checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7.40011 5.68606'%3E%3Cpath fill='%23373b4d' d='M2.55016,5.68606c-.01709,0-.03369-.001-.05078-.002a.7.7,0,0,1-.51758-.28955L.1317,2.82326a.7.7,0,1,1,1.13672-.81738l1.36133,1.8916L6.19713.2134A.69995.69995,0,0,1,7.203,1.187L3.05309,5.47268A.7.7,0,0,1,2.55016,5.68606Z'/%3E%3C/svg%3E");
}

form.agency-form .agency-form__choice input[type="checkbox"]:focus-visible {
	border-color: var(--wp--preset--color--contrast);
	box-shadow: 0 0 1px 2px #fff;
	outline: 2px solid #116dff;
	outline-offset: 1px;
}

form.agency-form .agency-form__choice input[type="checkbox"]:user-invalid,
form.agency-form .agency-form__field.is-invalid input[type="checkbox"] {
	background-color: rgba(255, 64, 64, 0.45);
	border-color: #ff4040;
}

/* Messages. */
form.agency-form .agency-form__field-error,
form.agency-form .agency-form__error,
form.agency-form .agency-form__confirmation {
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--field);
	font-weight: 400;
	line-height: 1.4;
}

form.agency-form .agency-form__field-error {
	margin: 4px 0 0;
}

form.agency-form .agency-form__error {
	border: 0;
	border-radius: 0;
	margin: var(--wp--preset--spacing--form-row) 0 0;
	padding: 0;
}

form.agency-form .agency-form__confirmation {
	display: block;
}

form.agency-form .agency-form__confirmation p {
	margin: 0 0 var(--wp--preset--spacing--form-row);
}

/* Send button. */
form.agency-form .agency-form__footer {
	display: block;
	margin-top: var(--wp--preset--spacing--form-row);
}

form.agency-form .agency-form__submit,
form.agency-form .agency-form__reset {
	background-color: var(--wp--preset--color--base);
	border: 0;
	border-radius: 0;
	box-sizing: border-box;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	display: inline-block;
	font-family: inherit;
	font-size: clamp(14.9333px, calc(14.9333px + 1.0667 * ((var(--woning--source-canvas, 100vw) - 390px) / 1050)), 16px);
	font-weight: 400;
	line-height: 1.8;
	padding: 7.6px 20px;
	text-align: center;
	transition: background-color 0.4s ease, color 0.4s ease;
	width: clamp(150px, calc(163.714286px - 0.009524 * var(--woning--source-canvas, 100vw)), 160px);
}

form.agency-form .agency-form__reset {
	width: auto;
}

form.agency-form .agency-form__submit:is(:hover, :active),
form.agency-form .agency-form__reset:is(:hover, :active) {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

form.agency-form.is-busy .agency-form__submit {
	cursor: wait;
	opacity: 0.65;
}

@media (width <= 782px) {
	form.agency-form .agency-form__fields {
		gap: 10px var(--wp--preset--spacing--form-row);
		grid-template-columns: minmax(0, 1fr);
	}

	form.agency-form .agency-form__control {
		font-size: 15px;
		line-height: 21px;
		min-height: 35px;
	}

	form.agency-form .agency-form__choice {
		font-size: 12.857px;
	}

	form.agency-form .agency-form__footer {
		margin-top: 10px;
	}

	form.agency-form.is-style-woning-contractor-form {
		left: 3px;
		position: relative;
	}

	form.agency-form.is-style-woning-contractor-form .agency-form__fields {
		gap: var(--wp--preset--spacing--form-row) 9px;
		grid-template-columns: minmax(0, 125fr) minmax(0, 152fr);
	}

	form.agency-form.is-style-woning-contractor-form .agency-form__footer {
		margin-top: var(--wp--preset--spacing--form-row);
	}

	form.agency-form.is-style-woning-contractor-form [data-agency-field="consent"] {
		margin-right: 6px;
	}

	form.agency-form.is-style-woning-contractor-form .agency-form__choice a {
		display: block;
	}

	form.agency-form.is-style-woning-contractor-form .agency-form__submit {
		font-size: 16px;
		line-height: 28.8px;
		padding-bottom: 6.1px;
		padding-top: 6.1px;
	}
}
