/*
 * Gravity Forms look (enqueued on pages that have a form: functions.php, gform_enqueue_scripts).
 *
 * Ported 2026-10 from the old theme's Gravity Forms module (vestelli-avalon/modules/gravity-forms/css/frontend.css);
 * round 4 (2026-10-30) rewrote it for the Swedish and English forms (vestelli-blocks inc/forms-i18n.php): the contact
 * form "Kontakta oss" / "Contact us" (contact pages, products pages, articles, the "Begär offert" dialog) and the
 * wastewater plan forms of the services pages. The site's font (Oxygen) and colours: labels and text navy, the
 * secondary text #5b6475, field borders #878fa3 (3.2:1 on white), errors #b3261e (6.5:1), the accent blue only as the
 * focus ring and lines. Square corners, no shadows. 16px fields (phones do not zoom in), at least 46px high (48px on
 * phones), a 24px consent checkbox whose text is part of its tap area, a full-width button on phones.
 *
 * Gravity Forms' own stylesheets (basic, theme) load after this file with selectors like
 * ".gform_wrapper.gravity-theme input[type=text]" and, on phones, an input:not(...) chain: the rules below are scoped
 * one step deeper (.gfield, .gform_footer) to win without !important. Forms on the navy band of the services pages
 * (#form_white) keep their white labels and button (site.css); only the required mark and the error box are adjusted
 * there.
 */

.gform_wrapper {
	width: 100%;
	max-width: 100%;
	margin: 20px 0;
	font-family: inherit;
	scroll-margin-top: calc(var(--ab-header-h, 72px) + 16px);
}

/* ------------------------------------------------------------ layout: rows of fields */

.gform_wrapper.gravity-theme .gform_fields {
	row-gap: 20px;
	column-gap: 20px;
}

.gform_wrapper .gfield,
.gform_wrapper .gform_fields .gfield {
	margin-bottom: 0 !important;
}

/* fields side by side (the contact forms' name + e-mail, phone + municipality) only where the form has room: Gravity
   Forms stacks them below a 641px window, a narrow card (the products pages' column on a tablet) stacks them too */
.gform_wrapper.gravity-theme {
	container-type: inline-size;
}

@container (max-width: 520px) {
	.gform_wrapper.gravity-theme .gform_fields .gfield.gfield--width-half {
		grid-column: 1 / -1;
	}
}

/* the required legend ("* anger obligatoriska fält"): not shown (the asterisks are the site's convention) */
p.gform_required_legend {
	display: none !important;
}

/* ------------------------------------------------------------ title and description */

.gform_wrapper.gravity-theme .gform_heading {
	margin-bottom: 20px;
}

.gform_wrapper.gravity-theme .gform_heading .gform_title {
	margin: 0;
	color: var(--ab-heading, #1b2a57);
	font-family: inherit;
	font-size: clamp(24px, 1.2rem + 0.9vw, 30px);
	font-weight: 700;
	line-height: 1.2;
}

/* the form's own description under its title (the wastewater plan forms) */
.gform_wrapper.gravity-theme .gform_heading .gform_description {
	display: block;
	margin: 10px 0 0;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.gform_wrapper.gravity-theme .gform_heading .gform_title + .gform_description:empty {
	display: none;
}

/* ------------------------------------------------------------ labels */

.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label {
	display: block;
	margin-bottom: 6px;
	color: var(--ab-navy, #1b2a57) !important;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.gform_wrapper.gravity-theme legend.gfield_label {
	margin-bottom: 8px;
	padding: 0;
}

.gform_wrapper .gfield_required {
	color: #5b6475 !important;
	font-weight: 400;
}

.gform_wrapper.gravity-theme .gfield_required .gfield_required_asterisk {
	margin-left: 2px;
}

/* ------------------------------------------------------------ fields */

.gform_wrapper.gravity-theme .gfield input:is([type="text"], [type="email"], [type="tel"], [type="number"], [type="date"], [type="time"], [type="url"], [type="password"]),
.gform_wrapper.gravity-theme .gfield select,
.gform_wrapper.gravity-theme .gfield textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid #878fa3;
	border-radius: 0;
	background-color: #fff;
	color: var(--ab-navy, #1b2a57);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
	transition: border-color 0.2s ease;
}

.gform_wrapper.gravity-theme .gfield input:is([type="text"], [type="email"], [type="tel"], [type="number"], [type="date"], [type="time"], [type="url"], [type="password"]):hover,
.gform_wrapper.gravity-theme .gfield select:hover,
.gform_wrapper.gravity-theme .gfield textarea:hover {
	border-color: var(--ab-navy, #1b2a57);
}

.gform_wrapper.gravity-theme .gfield input:is([type="text"], [type="email"], [type="tel"], [type="number"], [type="date"], [type="time"], [type="url"], [type="password"]):focus,
.gform_wrapper.gravity-theme .gfield select:focus,
.gform_wrapper.gravity-theme .gfield textarea:focus {
	border-color: var(--ab-navy, #1b2a57);
	outline: 2px solid var(--ab-accent, #01a6e6);
	outline-offset: 0;
	box-shadow: none;
}

/* the message: a few lines, not Gravity Forms' 288px "large" box; it grows by hand */
.gform_wrapper.gravity-theme .gfield .ginput_container.ginput_container_textarea textarea {
	height: 160px;
	min-height: 120px;
	resize: vertical;
}

.gform_wrapper.gravity-theme .gfield select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%231b2a57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	appearance: none;
}

/* descriptions */
.gform_wrapper.gravity-theme .gfield_description:not(.gfield_validation_message) {
	padding-top: 6px;
	color: #5b6475;
	font-family: inherit;
	font-size: 14px;
	font-style: normal;
	line-height: 1.5;
}

/* ------------------------------------------------------------ radio buttons and checkboxes */

/* one choice per row, the whole 44px row is the choice's tap area (its label); a 24px box like the consent's (the
   training forms' "Asema / Befattning / Role" list) */
.gform_wrapper .gfield_radio,
.gform_wrapper .gfield_checkbox {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: 4px;
}

.gform_wrapper .gfield_radio .gchoice,
.gform_wrapper .gfield_checkbox .gchoice {
	display: flex;
	align-items: center;
	gap: 12px;
}

.gform_wrapper .gfield_radio input[type="radio"],
.gform_wrapper .gfield_checkbox input[type="checkbox"] {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--ab-navy, #1b2a57);
}

.gform_wrapper .gfield_radio input[type="radio"]:focus-visible,
.gform_wrapper .gfield_checkbox input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--ab-accent, #01a6e6);
	outline-offset: 2px;
}

.gform_wrapper.gravity-theme .gfield_radio .gchoice label,
.gform_wrapper.gravity-theme .gfield_checkbox .gchoice label {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-height: 44px;
	max-width: none;
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.35;
	cursor: pointer;
}

/* ------------------------------------------------------------ consent (the privacy policy) */

.gform_wrapper.gravity-theme .ginput_container_consent {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.gform_wrapper.gravity-theme .ginput_container_consent input[type="checkbox"] {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	margin: 0;
	cursor: pointer;
	accent-color: var(--ab-navy, #1b2a57);
}

.gform_wrapper.gravity-theme .ginput_container_consent input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--ab-accent, #01a6e6);
	outline-offset: 2px;
}

.gform_wrapper.gravity-theme .gfield--type-consent .gfield_consent_label {
	display: block;
	margin: 0;
	padding: 1px 0 0;
	color: inherit !important;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	cursor: pointer;
}

.gform_wrapper .gfield_consent_label a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.gform_wrapper .gfield_consent_label a:hover {
	text-decoration-thickness: 2px;
}

.gform_wrapper .gfield_consent_label a:focus-visible {
	outline: 2px solid var(--ab-accent, #01a6e6);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ the button */

.gform_wrapper.gravity-theme .gform_footer,
.gform_wrapper.gravity-theme .gform_page_footer {
	margin: 24px 0 0;
	padding: 0;
}

/* (the input:not() chain is Gravity Forms' own phone rule, which would make the button 32px and double its line) */
.gform_wrapper.gravity-theme .gform_footer input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]).gform_button,
.gform_wrapper.gravity-theme .gform_footer input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 46px;
	margin: 0;
	padding: 12px 32px;
	border: 0;
	border-radius: 0;
	background-color: var(--ab-navy, #1b2a57);
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.gform_wrapper.gravity-theme .gform_footer input[type="submit"]:hover {
	background-color: #0f1e4b;
}

.gform_wrapper.gravity-theme .gform_footer input[type="submit"]:focus-visible {
	outline: 2px solid var(--ab-accent, #01a6e6);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ errors */

/* the summary at the top of a form that did not go through */
.gform_wrapper.gravity-theme .gform_validation_errors {
	margin: 0 0 20px;
	padding: 14px 16px;
	border: 0;
	border-left: 4px solid #b3261e;
	border-radius: 0;
	background: #fdf1f0;
	box-shadow: none;
}

.gform_wrapper.gravity-theme .gform_validation_errors > h2 {
	margin: 0;
	color: #8c1d18;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.gform_wrapper.gravity-theme .gform_validation_errors > h2 .gform-icon {
	display: none;
}

.gform_wrapper.gravity-theme .gform_validation_errors > ol {
	margin: 8px 0 0;
	padding-left: 20px;
	color: #8c1d18;
	font-size: 15px;
}

.gform_wrapper.gravity-theme .gform_validation_errors > ol a {
	color: inherit;
}

/* the message under a field */
.gform_wrapper.gravity-theme .gfield .gfield_validation_message,
.gform_wrapper.gravity-theme .gfield .validation_message {
	margin: 6px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: #b3261e;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.gform_wrapper.gravity-theme .gfield_error input:is([type="text"], [type="email"], [type="tel"], [type="number"], [type="url"]),
.gform_wrapper.gravity-theme .gfield_error select,
.gform_wrapper.gravity-theme .gfield_error textarea {
	border-color: #b3261e;
	border-width: 2px;
}

.gform_wrapper.gravity-theme .gfield_error .gfield_label,
.gform_wrapper.gravity-theme .gfield_error legend.gfield_label {
	color: var(--ab-navy, #1b2a57) !important;
}

/* ------------------------------------------------------------ the thank-you message */

.gform_confirmation_wrapper .gform_confirmation_message,
.gform_wrapper .gform_confirmation_message {
	margin: 20px 0;
	padding: 16px 20px;
	border: 0;
	border-left: 4px solid var(--ab-accent, #01a6e6);
	border-radius: 0;
	background-color: #f4f6f9;
	color: var(--ab-navy, #1b2a57);
	font-family: inherit;
	font-size: 17px;
	line-height: 1.5;
}

/* ------------------------------------------------------------ forms on the navy band (#form_white, services pages) */

#form_white .gform_wrapper .gfield_required {
	color: #fff !important;
	opacity: 0.85;
}

#form_white .gform_wrapper.gravity-theme .gfield .gfield_validation_message {
	padding: 6px 10px;
}

#form_white .gform_wrapper.gravity-theme .gform_validation_errors > h2,
#form_white .gform_wrapper.gravity-theme .gform_validation_errors > ol {
	color: #8c1d18;
}

#form_white .gform_confirmation_message {
	border-left-color: #fff;
}

/* the consent of the wastewater plan forms (round 4 fix 2): its heading is a <legend>, not a <label> (site.css makes
   only the labels white: it was navy on navy), and a white box (the navy one was lost on the band) */
#form_white .gform_wrapper.gravity-theme legend.gfield_label {
	color: #fff !important;
}

#form_white .gform_wrapper.gravity-theme .ginput_container_consent input[type="checkbox"] {
	accent-color: #fff;
}

/* ------------------------------------------------------------ the frames of the Swedish and English contact form */

/* the contact page's card (contact.css .an-contact-form): the form under its heading and line */
.an-contact-form-band .wp-block-group.an-contact-form > .gform_wrapper {
	max-width: 680px;
	margin: 32px auto 0;
}

/* the column beside "Varför Vestelli?" (products pages), the form of the articles (inc/forms-i18n.php) and a form
   placed straight in a page's or an article's text (the training pages, the wastewater plan article: round 4 phase B,
   they replaced the Formstack forms): the same white card with the blue top line as the contact page */
.wp-block-column > .gform_wrapper.gravity-theme,
.ab-lang-form > .gform_wrapper.gravity-theme,
.wp-block-post-content > .gform_wrapper.gravity-theme {
	box-sizing: border-box;
	margin: 0;
	padding: 32px 32px 36px;
	border: 1px solid #dfe3ea;
	border-top: 4px solid var(--ab-accent, #01a6e6);
	background: #fff;
	color: var(--ab-navy, #1b2a57);
}

/* (in a full-width section, e.g. the services pages' shared section, the card is as wide as the contact page's) */
.ab-lang-form {
	max-width: 880px;
	margin-block: var(--ab-flow-c, 32px);
	margin-inline: auto;
}

/* the confirmation that replaces such a card keeps the frame's place */
.wp-block-column > .gform_confirmation_wrapper,
.ab-lang-form > .gform_confirmation_wrapper {
	margin: 0;
}

/* a form card in the text column (an article's form at its end, the training and plan forms): a picture's gap above
   and below it; the text's own rhythm (blocks.css .an-text > * margin 0, style.css 14px between blocks) is too small
   for a card (it sat 14px under the last paragraph). Three classes: stronger than .an-text.an-text.an-text > * */
.wp-block-post-content.wp-block-post-content.wp-block-post-content > :is(.ab-lang-form, .gform_wrapper.gravity-theme, .gform_confirmation_wrapper) {
	margin-block: var(--ab-flow-c, 32px);
}

/* ------------------------------------------------------------ phones */

@media (max-width: 768px) {
	.gform_wrapper {
		margin: 16px 0;
	}

	.gform_wrapper.gravity-theme .gform_fields {
		row-gap: 18px;
	}

	.gform_wrapper.gravity-theme .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):not([type="hidden"]),
	.gform_wrapper.gravity-theme .gfield select {
		min-height: 48px;
		line-height: 1.4;
	}

	.gform_wrapper.gravity-theme .gfield .ginput_container.ginput_container_textarea textarea {
		height: 140px;
	}

	.gform_wrapper.gravity-theme .gform_footer input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]).gform_button,
	.gform_wrapper.gravity-theme .gform_footer input[type="submit"] {
		width: 100%;
		min-height: 48px;
		line-height: 1.2;
	}

	.an-contact-form-band .wp-block-group.an-contact-form > .gform_wrapper {
		margin-top: 24px;
	}

	.wp-block-column > .gform_wrapper.gravity-theme,
	.ab-lang-form > .gform_wrapper.gravity-theme,
	.wp-block-post-content > .gform_wrapper.gravity-theme {
		padding: 20px 16px 24px;
	}
}
