/**
 * Component: Gravity Forms fields for the forms whose CSS gate is lifted
 * (2026-11-10): the post and FAQ post sidebar contact card, the post
 * sidebar newsletter card and the Contact Us form (contact_split). The
 * field rules are shared by the contact card and the Contact Us form.
 *
 * Every selector is scoped under its component wrapper and uses stable
 * Gravity Forms wrappers only (.gform_wrapper, .gfield, .ginput_container,
 * .gform_footer, .gform_button), never version classes such as
 * .gravity-theme. The extra .gfield or .gform_footer in each selector beats
 * Gravity Forms 2.6.8's theme CSS (.gform_wrapper.gravity-theme .gfield
 * input.large, 0,4,1) and the starter's unscoped form rules in style.css
 * without !important. Every other form on the site is untouched.
 *
 * Loaded only where one of these forms renders (form-card.php for the rail
 * cards, the contact_split section assets).
 *
 * Values are measured from design/forms/ at the real component width (the
 * exports are scaled: the sidebar card is 327px there, 352px on the page).
 * TODO: verify in Figma.
 *
 * @package cartrack
 */

.form-card--rail:not(.form-card--newsletter) {
	--ff-height: 2.75rem;                 /* 44px tap targets below --bp-lg or on touch. */
	--ff-gap: 0.5625rem;                  /* ~9px between fields. TODO: verify in Figma. */
	--ff-padding-x: 1rem;                 /* ~16px. TODO: verify in Figma. */
	--ff-border: #dadde1;                 /* ~1px grey (sampled). TODO: verify in Figma. */
	--ff-border-focus: var(--color-text);
	--ff-radius: 2px;                     /* Almost square. TODO: verify in Figma. */
	--ff-bg: var(--color-bg);
	--ff-text: var(--color-text);
	--ff-placeholder: #999999;            /* Sampled. See the contrast report (CLAUDE.md 4.11). */
	--ff-caret-size: 0.625rem;            /* ~10 x 5px filled caret. TODO: verify in Figma. */
	--ff-button-height: 2.75rem;
	--ff-button-gap: 1.25rem;             /* Last field → button (~20px). TODO: verify in Figma. */
	--ff-error: var(--color-error);
}

@media (min-width: 64em) and (pointer: fine) { /* --bp-lg */
	.form-card--rail:not(.form-card--newsletter) {
		--ff-height: 2.5625rem;           /* ~41px. TODO: verify in Figma. */
		--ff-button-height: 2.3125rem;    /* ~37px. TODO: verify in Figma. */
	}
}

/* ---------- Layout ---------- */

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_body .gform_fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--ff-gap);
	margin: 0;
	padding: 0;
}

/*
 * One column, as in the designs: every field spans it. Gravity Forms'
 * .gfield--width-full (span 12) would otherwise add implicit columns and
 * squeeze fields without that class.
 */
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_fields .gfield {
	grid-column: 1 / -1;
	min-inline-size: 0;
	margin: 0;
	padding: 0;
}

/*
 * The design shows no labels: set Label Visibility to Hidden in Gravity
 * Forms (2.6.8 then clips them). This keeps them for screen readers when a
 * label is left visible. Required fields carry " *" in their placeholder.
 */
.form-card--rail:not(.form-card--newsletter) .gform_wrapper .gfield .gfield_label {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Inputs and the select ---------- */

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container select,
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container textarea {
	box-sizing: border-box;
	inline-size: 100%;
	min-block-size: var(--ff-height);
	margin: 0;
	padding-block: 0;
	padding-inline: var(--ff-padding-x);
	border: 1px solid var(--ff-border);
	border-radius: var(--ff-radius);
	background-color: var(--ff-bg);
	box-shadow: none;
	color: var(--ff-text);
	font-family: var(--t-body-family);
	font-size: var(--t-body-size); /* 16px or more: no zoom on focus in iOS. */
	font-weight: var(--t-body-weight);
	line-height: var(--t-body-line-height);
	transition: none;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container textarea {
	padding-block: 0.5rem;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container ::placeholder {
	color: var(--ff-placeholder);
	opacity: 1;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container select {
	padding-inline-end: calc(var(--ff-padding-x) * 2 + var(--ff-caret-size));
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 5'%3E%3Cpath d='M0 0h10L5 5z' fill='%23212121'/%3E%3C/svg%3E");
	background-position: right var(--ff-padding-x) center;
	background-repeat: no-repeat;
	background-size: var(--ff-caret-size) calc(var(--ff-caret-size) / 2);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container select:dir(rtl) {
	background-position: left var(--ff-padding-x) center;
}

/* The placeholder option ("Select vehicle type *") is grey until a choice is made. */
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container select:has(option[value=""]:checked) {
	color: var(--ff-placeholder);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container select option {
	color: var(--ff-text);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container :is(input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]), select, textarea):focus {
	border-color: var(--ff-border-focus);
	box-shadow: none;
	outline: none;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .ginput_container :is(input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]), select, textarea):focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: 2px;
}

/* ---------- Button ---------- */

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_footer {
	display: block;
	margin: var(--ff-button-gap) 0 0;
	padding: 0;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]) {
	display: block;
	box-sizing: border-box;
	inline-size: 100%;
	max-inline-size: none;
	min-block-size: var(--ff-button-height);
	margin: 0;
	padding-block: 0.5rem;
	padding-inline: var(--ff-padding-x);
	border: 0;
	border-radius: var(--ff-radius);
	background: var(--color-primary);
	box-shadow: none;
	color: var(--color-text-inverse);
	font-family: var(--t-btn-1-family);
	font-size: var(--t-btn-1-size);
	font-weight: var(--t-btn-1-weight);
	line-height: var(--t-btn-1-line-height);
	letter-spacing: -0.005em;
	white-space: normal;
	cursor: pointer;
	transform: none;
	transition: background-color var(--transition-fast);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):hover {
	background: var(--color-primary-hover);
	box-shadow: none;
	transform: none;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: 2px;
}

/* ---------- Validation ---------- */

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield_error .ginput_container :is(input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]), select, textarea) {
	border-color: var(--ff-error);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .gfield_validation_message {
	margin: 0.25rem 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ff-error);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	line-height: var(--t-small-line-height);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_validation_errors {
	margin: 0 0 var(--ff-gap);
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--ff-error);
	border-radius: var(--ff-radius);
	background: var(--ff-bg);
	box-shadow: none;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_validation_errors .gform_submission_error {
	margin: 0;
	color: var(--ff-error);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	font-weight: var(--t-small-bold-weight);
	line-height: var(--t-small-line-height);
}

/* Gravity Forms' decorative icon would overlap the summary text. */
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_validation_errors .gform-icon {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]) {
		transition: none;
	}
}

/* ==========================================================================
 * Post sidebar newsletter card (.form-card--newsletter; Site Manager →
 * Content → Post sidebar newsletter form): the email with the arrow button
 * inside its end edge, then the consent checkbox. The footer's grid
 * technique (gravity-forms.css), scoped to this card.
 * ======================================================================= */

.form-card--newsletter {
	--ff-height: 2.75rem;                 /* 44px below --bp-lg or on touch. */
	--ff-padding-x: 1rem;
	--ff-border: #dadde1;                 /* TODO: verify in Figma. */
	--ff-border-focus: var(--color-text);
	--ff-radius: 2px;                     /* TODO: verify in Figma. */
	--ff-bg: var(--color-bg);
	--ff-text: var(--color-text);
	--ff-placeholder: #999999;            /* Sampled. See CLAUDE.md 4.11. */
	--ff-arrow-hover: #f1f5f9;            /* Hover tint behind the arrow (no hover frame). TODO: designer. */
	--ff-choice-text: var(--color-text-muted); /* ~#5f6266 sampled; the muted token. */
	--ff-choice-size: 0.875rem;           /* ~13-14px square. TODO: verify in Figma. */
	--ff-choice-border: #adb1b5;          /* Sampled. */
	--ff-required-note: #e57373;          /* "(required)", red italic (sampled). See CLAUDE.md 4.11. */
	--ff-error: var(--color-error);
	--ff-row-gap: 1rem;                   /* Email → consent (~16px). TODO: verify in Figma. */
}

@media (min-width: 64em) and (pointer: fine) { /* --bp-lg */
	.form-card--newsletter {
		--ff-height: 2.5625rem;           /* ~41px. TODO: verify in Figma. */
	}
}

.form-card--newsletter .gform_wrapper form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--ff-height);
	row-gap: var(--ff-row-gap);
}

.form-card--newsletter .gform_wrapper form .gform_body,
.form-card--newsletter .gform_wrapper .gform_body .gform_fields {
	display: contents;
}

.form-card--newsletter .gform_wrapper .gform_body .gform_validation_errors,
.form-card--newsletter .gform_wrapper form > .gform_validation_errors {
	grid-column: 1 / -1;
	order: 1;
}

.form-card--newsletter .gform_wrapper .gform_fields .gfield {
	grid-column: 1 / -1;
	order: 4;
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/*
 * The email field shares row 1 with the button, which overlays its end edge
 * (row 2 under an error box); the consent field fills the next free row.
 */
.form-card--newsletter .gform_wrapper .gform_fields .gfield:has(.ginput_container_email) {
	grid-row: 1;
	grid-column: 1 / -1;
	order: 2;
}

.form-card--newsletter .gform_wrapper form .gform_footer {
	display: flex;
	grid-row: 1;
	grid-column: 2;
	order: 3;
	align-self: start;
	z-index: 1;
	margin: 0;
	padding: 0;
}

/* Under an error box. */
.form-card--newsletter .gform_wrapper form:has(.gform_validation_errors) .gfield:has(.ginput_container_email),
.form-card--newsletter .gform_wrapper form:has(.gform_validation_errors) .gform_footer {
	grid-row: 2;
}

.form-card--newsletter .gform_wrapper .gform_fields .gform_hidden {
	display: none;
}

/* Labels and the checkbox legend stay for screen readers only. */
.form-card--newsletter .gform_wrapper .gfield .gfield_label {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.form-card--newsletter .gform_wrapper .gfield .ginput_container_email input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]) {
	box-sizing: border-box;
	inline-size: 100%;
	min-block-size: var(--ff-height);
	margin: 0;
	padding-block: 0;
	padding-inline: var(--ff-padding-x) var(--ff-height); /* Room for the arrow. */
	border: 1px solid var(--ff-border);
	border-radius: var(--ff-radius);
	background-color: var(--ff-bg);
	box-shadow: none;
	color: var(--ff-text);
	font-family: var(--t-body-family);
	font-size: var(--t-body-size);
	line-height: var(--t-body-line-height);
	transition: none;
}

.form-card--newsletter .gform_wrapper .gfield .ginput_container_email ::placeholder {
	color: var(--ff-placeholder);
	opacity: 1;
}

.form-card--newsletter .gform_wrapper .gfield .ginput_container_email input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):focus {
	border-color: var(--ff-border-focus);
	box-shadow: none;
	outline: none;
}

.form-card--newsletter .gform_wrapper .gfield .ginput_container :is(input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]), select, textarea):focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: 2px;
}

/* The arrow button: its value ("Subscribe") stays its accessible name. */
.form-card--newsletter .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]) {
	box-sizing: border-box;
	inline-size: var(--ff-height);
	max-inline-size: none;
	min-block-size: 0;
	block-size: var(--ff-height);
	margin: 0;
	padding: 0;
	border: 1px solid transparent; /* Inside the input's border. */
	border-radius: var(--ff-radius);
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 1rem no-repeat;
	box-shadow: none;
	color: transparent;
	font-size: 0;
	cursor: pointer;
	transform: none;
	transition: none;
}

.form-card--newsletter .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):dir(rtl) {
	transform: scaleX(-1);
}

.form-card--newsletter .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):hover {
	background-color: var(--ff-arrow-hover);
	box-shadow: none;
	transform: none;
}

.form-card--newsletter .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):dir(rtl):hover {
	transform: scaleX(-1);
}

.form-card--newsletter .gform_wrapper .gform_footer .gform_button:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: -2px; /* Inside the input, so it is not clipped by the card. */
}

.form-card--newsletter .gform_wrapper .gform_footer .gform_ajax_spinner {
	position: absolute;
}

/* Consent: a square checkbox and 14px text; "(required)" is an <em> typed in the choice text. */
.form-card--newsletter .gform_wrapper .gfield .gfield_checkbox {
	margin: 0;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	margin: 0;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice input[type="checkbox"] {
	flex: none;
	box-sizing: border-box;
	inline-size: var(--ff-choice-size);
	block-size: var(--ff-choice-size);
	margin: 0.1875rem 0 0; /* Centred on the first 20px line. */
	border: 1px solid var(--ff-choice-border);
	border-radius: 0;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice input[type="checkbox"]:checked {
	border-color: var(--ff-text);
	background: var(--ff-text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5l2.5 2.5 4.5-5'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: 2px;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice label {
	max-inline-size: none;
	margin: 0;
	padding: 0;
	color: var(--ff-choice-text);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	font-weight: var(--t-small-weight);
	line-height: var(--t-small-line-height);
	cursor: pointer;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice label a {
	color: var(--ff-text);
	text-decoration: none;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice label a:hover {
	text-decoration: underline;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice label a:focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: 2px;
}

.form-card--newsletter .gform_wrapper .gfield .gchoice label em {
	color: var(--ff-required-note);
	font-style: italic;
}

/* Validation. */
.form-card--newsletter .gform_wrapper .gfield_error .ginput_container_email input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]) {
	border-color: var(--ff-error);
}

.form-card--newsletter .gform_wrapper .gfield_error .gchoice input[type="checkbox"] {
	border-color: var(--ff-error);
}

.form-card--newsletter .gform_wrapper .gfield .gfield_validation_message {
	margin: 0.25rem 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ff-error);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	line-height: var(--t-small-line-height);
}

.form-card--newsletter .gform_wrapper .gform_validation_errors {
	margin: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--ff-error);
	border-radius: var(--ff-radius);
	background: var(--ff-bg);
	box-shadow: none;
}

.form-card--newsletter .gform_wrapper .gform_validation_errors .gform_submission_error {
	margin: 0;
	color: var(--ff-error);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	font-weight: var(--t-small-bold-weight);
	line-height: var(--t-small-line-height);
}

/* Gravity Forms' decorative icon would overlap the summary text. */
.form-card--newsletter .gform_wrapper .gform_validation_errors .gform-icon {
	display: none;
}

/* ==========================================================================
 * Contact Us form (contact_split, .contact-split__form; design/forms/
 * contact-us-form-design.png, measured at the real 516px form width).
 * Labels are visible; every field is required except Message, which shows
 * a visible "(optional)". "(Required)" is hidden visually but read out.
 * ======================================================================= */

.contact-split__form {
	--ff-height: 2.75rem;                 /* 44px below --bp-lg or on touch. */
	--ff-gap: 1.125rem;                   /* Field → next label (~18px). TODO: verify in Figma. */
	--ff-label-gap: 0.75rem;              /* Label → field (~12-13px). TODO: verify in Figma. */
	--ff-padding-x: 1rem;
	--ff-border: #dadde1;                 /* TODO: verify in Figma. */
	--ff-border-focus: var(--color-text);
	--ff-radius: 2px;                     /* TODO: verify in Figma. */
	--ff-bg: var(--color-bg);
	--ff-text: var(--color-text);
	--ff-label: #212121;                  /* Sampled. */
	--ff-label-note: #adb1b5;             /* "(optional)" (sampled). See CLAUDE.md 4.11. */
	--ff-placeholder: #999999;            /* Sampled. See CLAUDE.md 4.11. */
	--ff-caret-size: 0.625rem;
	--ff-textarea-height: 7.3125rem;      /* ~117px. TODO: verify in Figma. */
	--ff-button-height: 2.75rem;
	--ff-button-gap: 1.75rem;             /* Message → button (~28px). TODO: verify in Figma. */
	--ff-error: var(--color-error);
}

@media (min-width: 64em) and (pointer: fine) { /* --bp-lg */
	.contact-split__form {
		--ff-height: 2.5625rem;           /* ~41px. TODO: verify in Figma. */
		--ff-button-height: 2.3125rem;    /* ~37px. TODO: verify in Figma. */
	}
}

/* Labels above the fields. */
.contact-split__form .gform_wrapper .gfield .gfield_label {
	display: block;
	margin: 0 0 var(--ff-label-gap);
	padding: 0;
	color: var(--ff-label);
	font-family: var(--t-body-family);
	font-size: var(--t-body-size);
	font-weight: var(--t-body-weight);
	line-height: var(--t-body-line-height);
	letter-spacing: 0;
}

/*
 * Every field is required except Message (the design's convention): the
 * "(Required)" text is hidden visually and still read out with the label.
 */
.contact-split__form .gform_wrapper .gfield .gfield_label .gfield_required {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* "(optional)", typed into the Message label as <span class="gfield_label_note">. */
.contact-split__form .gform_wrapper .gfield .gfield_label .gfield_label_note {
	color: var(--ff-label-note);
}

.contact-split__form .gform_wrapper .gfield .ginput_container textarea {
	block-size: var(--ff-textarea-height);
	resize: vertical;
}

/* ==========================================================================
 * Phone field with the Smart Phone Field plugin (intl-tel-input 24, flag and
 * dial code): one bordered box, flag + dial code + caret, a 1px divider,
 * then the number. The plugin's CSS puts !important on the country button's
 * padding, border, gap and background, so the spacing lives on the button's
 * children and the divider is a pseudo-element. The plugin sets the input's
 * start padding to the button's width + 6px (inline style, kept), so the
 * space after the divider is inside the button.
 * Measured at 516px (TODO: verify in Figma): flag 15px from the edge, 12px
 * to the code, ~24px to the caret, ~23px to the divider, 16px to the text.
 * ======================================================================= */

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti {
	--iti-arrow-color: var(--ff-text);
	--iti-triangle-border: 4px;           /* ~8 x 5px caret. TODO: verify in Figma. */
	--iti-arrow-height: 5px;
	--iti-border-color: var(--ff-border);
	--iti-dropdown-bg: var(--ff-bg);
	--ff-phone-start: 0.9375rem;          /* ~15px. */
	--ff-phone-code-gap: 0.75rem;         /* ~12px. */
	--ff-phone-caret-gap: 1.5rem;         /* ~24px. TODO: verify in Figma. */
	--ff-phone-divider-gap: 1.4375rem;    /* ~23px. TODO: verify in Figma. */
	--ff-phone-after-divider: 0.625rem;   /* + the plugin's 6px = ~16px to the text. */

	display: block;
	inline-size: 100%;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti button.iti__selected-country {
	position: relative;
	min-block-size: 0;
	cursor: pointer;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__selected-country-primary {
	display: contents; /* Flag, dial code and caret become siblings, in the design's order. */
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__selected-country .iti__flag {
	order: 1;
	flex: none;
	margin: 0;
	margin-inline-start: var(--ff-phone-start);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__selected-dial-code {
	order: 2;
	flex: none;
	margin: 0 0 0 var(--ff-phone-code-gap); /* Physical: its own direction is ltr (below). */
	color: var(--ff-text);
	font-family: var(--t-body-family);
	font-size: var(--t-body-size);
	line-height: var(--t-body-line-height);
	white-space: nowrap;
	unicode-bidi: isolate; /* "+1 242" stays in order in RTL. */
	direction: ltr;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__selected-dial-code:dir(rtl) {
	margin: 0 var(--ff-phone-code-gap) 0 0;
}

/* Phone numbers read left to right in every language; in RTL they sit against the divider. */
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti input.iti__tel-input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]) {
	direction: ltr;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti input.iti__tel-input:not([type="radio"]):not([type="checkbox"]):not([type="image"]):not([type="file"]):dir(rtl) {
	text-align: right;
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__selected-country .iti__arrow {
	order: 3;
	flex: none;
	margin: 0;
	margin-inline: var(--ff-phone-caret-gap) calc(var(--ff-phone-divider-gap) + var(--ff-phone-after-divider));
}

/* The divider, between the caret and the number. */
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti button.iti__selected-country::after {
	content: "";
	position: absolute;
	inset-block: 0;
	inset-inline-end: var(--ff-phone-after-divider);
	inline-size: 1px;
	background-color: var(--ff-border);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti button.iti__selected-country:focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: -3px;
}

/* The country list (inline dropdown): the field's border, 44px rows. */
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__dropdown-content {
	border: 1px solid var(--ff-border);
	border-radius: var(--ff-radius);
	box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.12);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__country {
	min-block-size: 2.75rem;
	color: var(--ff-text);
	font-family: var(--t-body-family);
	font-size: var(--t-small-size);
}

:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__country:focus-visible,
:is(.form-card--rail:not(.form-card--newsletter), .contact-split__form) .gform_wrapper .gfield .iti .iti__country.iti__highlight {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: -2px;
}
