/*
 * The site's own contact form (inc/lead-form.php, assets/lead-form.js): in the consent placeholder of the Leadoo
 * embeds (the quote dialog and the Leadoo block) and from the shortcode [avalon_yhteydenotto].
 * Plain fields on the section's own background: no card, tint or frame around the form.
 */

.ab-lead-form {
	position: relative;
	max-width: 640px;
	margin: 0;
	text-align: left;
}

.ab-lead-form .ab-lead-form__intro {
	margin: 0 0 20px;
	font-size: 17px;
	line-height: 1.5;
}

.ab-lead-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 20px;
}

.ab-lead-form__field {
	display: block;
	margin: 0;
}

.ab-lead-form__field--wide {
	grid-column: 1 / -1;
}

.ab-lead-form__label {
	display: block;
	margin-bottom: 6px;
	color: var(--wp--preset--color--heading, #012b55);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.ab-lead-form input[type="text"],
.ab-lead-form input[type="tel"],
.ab-lead-form input[type="email"],
.ab-lead-form textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid #c9d4de;
	border-radius: 4px;
	background: #fff;
	color: #282828;
	font: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.ab-lead-form input {
	min-height: 48px;
}

.ab-lead-form textarea {
	min-height: 120px;
	resize: vertical;
}

.ab-lead-form :is(input, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--navy, #002b56);
	outline-offset: 1px;
}

.ab-lead-form :is(input, textarea)[aria-invalid="true"] {
	border-color: #b3261e;
}

.ab-lead-form__error {
	display: block;
	margin-top: 4px;
	color: #b3261e;
	font-size: 14px;
	line-height: 1.4;
}

.ab-lead-form__error[hidden],
.ab-lead-form [hidden] {
	display: none;
}

/* not a field for people (robots fill it) */
.ab-lead-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ab-lead-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 22px;
}

.ab-lead-form .ab-lead-form__submit,
.ab-lead-form .ab-lead-form__copy {
	min-height: 48px;
	margin: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 500;
}

.ab-lead-form .ab-lead-form__submit {
	border: 0;
}

.ab-lead-form .ab-lead-form__submit[disabled] {
	opacity: 0.7;
	cursor: default;
}

.ab-lead-form .ab-lead-form__copy {
	padding: 0 22px;
	border: 1px solid currentColor;
	border-radius: 0;
	background: none;
	color: var(--wp--preset--color--navy, #002b56);
}

.ab-lead-form .ab-lead-form__status,
.ab-lead-form .ab-lead-form__privacy {
	max-width: none;
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.5;
}

.ab-lead-form .ab-lead-form__status:empty {
	display: none;
}

.ab-lead-form .ab-lead-form__status {
	color: #b3261e;
}

.ab-lead-form .ab-lead-form__done {
	margin: 0;
	color: var(--wp--preset--color--heading, #012b55);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.4;
}

.ab-lead-form .ab-lead-form__done:focus {
	outline: none;
}

.ab-lead-form__plain {
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font: inherit;
	font-size: 15px;
	line-height: 1.6;
}

@media (max-width: 600px) {
	.ab-lead-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ab-lead-form__actions > * {
		flex: 1 1 auto;
	}
}

/* ------------------------------------------------------------ the consent placeholder with the form in it */
/* (the selector is doubled like the theme's placeholder rules: the consent plugin's stylesheet prints later) */

.kncc-iframe-placeholder.kncc-iframe-placeholder.av-consent-ph--form:not(.kncc-iframe-placeholder--has-thumb) {
	display: block;
	padding: 0;
	background: none;
	text-align: left;
}

/* on a dark section the form gets a white panel: its labels and fields are made for a light background */
.is-dark .kncc-iframe-placeholder.kncc-iframe-placeholder.av-consent-ph--form:not(.kncc-iframe-placeholder--has-thumb) {
	padding: 24px 20px;
	background: #fff;
}

.av-consent-ph--form .av-consent-ph__more {
	margin-top: 36px;
	text-align: left;
}

.kncc-iframe-placeholder.kncc-iframe-placeholder.av-consent-ph--form:not(.kncc-iframe-placeholder--has-thumb) .av-consent-ph__more p {
	max-width: 60ch;
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.5;
}

/* the accept button is the second choice here: an outline button, the send button stays the main one */
.av-consent-ph--form .av-consent-ph__more .kncc-btn.kncc-btn--primary {
	margin: 0 0 12px;
	border: 1px solid var(--wp--preset--color--navy, #002b56);
	background: none;
	color: var(--wp--preset--color--navy, #002b56);
}
