/*
 * Estevera Forms Embed
 *
 * Visual language follows the modern ev-lps forms: no visible labels, one
 * placeholder-driven control per line, a single bordered phone control holding
 * flag + dial code + number, generous padding, full-width submit.
 *
 * Colours stay the legacy dental.verasmile.com palette so the form still sits
 * naturally on that site's blue cards: near-white fills and the existing cyan
 * (#00b2db) call to action, not the ev-lps navy.
 *
 * SPECIFICITY IS LOAD-BEARING. The theme ships
 *   input[type="text"], input[type="email"], ... { background: transparent; border: 1px solid #000; border-radius: 0 }
 * at 0-1-1, exactly the weight of a bare `.evf-field input`, and it is defined
 * LATER in the cascade, so a tie hands the theme the win. That is precisely how
 * the first version regressed: textarea, select and button kept their styling
 * and every <input> lost its fill, radius and border. Every control rule below
 * is therefore written as `.evf <tag>.evf-...` (0-2-1), and the handful of
 * properties the theme actually sets are additionally marked !important so a
 * later theme change, a Popup Maker theme, or debloat reordering cannot
 * silently undo them again.
 */

.evf {
	--evf-fill: #ffffff;
	--evf-border: #dfe6ee;
	--evf-border-focus: #00b2db;
	--evf-text: #33475b;
	--evf-placeholder: #8098b0;
	--evf-accent: #00b2db;
	--evf-accent-dark: #0093b6;
	--evf-error: #c0392b;
	/* Error and status TEXT, which sits on the page's own panel exactly as the
	 * notice does. --evf-error was chosen against white and is 2.34:1 on the
	 * rgb(126,172,238) panel measured 2026-09-03 -- the worst contrast in the
	 * form. This is 4.97:1 there and 11.5:1 on white, and stays unmistakably
	 * red. --evf-error itself is unchanged: it colours the invalid control's
	 * BORDER, a non-text component sitting against the white input fill
	 * (5.44:1, past the 3:1 that SC 1.4.11 asks of it). */
	--evf-error-text: #74100c;
	/* The suggestion notice is the only body text that sits directly on the
	 * PAGE's own panel rather than on one of the form's white controls, so it
	 * cannot rely on --evf-text being legible there. Measured 2026-09-03 on
	 * dental.verasmile.com/20-off-dental-treatment-verasmile/, whose panel is
	 * rgb(126,172,238): --evf-text gives 4.11:1, under the 4.5:1 AA floor,
	 * while this gives 5.77:1. On plain white it is 13.4:1. */
	--evf-notice-text: #22303f;
	--evf-radius: 12px;
	--evf-gap: 12px;
	--evf-control-h: 52px;
	--evf-pad-x: 16px;

	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: var(--evf-text);
	max-width: 100%;

	/*
	 * Breathing room under the submit button.
	 *
	 * The GenerateBlocks cards these forms sit in carry padding-bottom: 0. They
	 * were laid out around the HubSpot iframe, which supplied its own slack:
	 * the form's internal bottom margin plus the free-tier branding link below
	 * it. Remove the iframe and the button lands flush against the card's
	 * rounded bottom edge, which reads as broken rather than tight.
	 *
	 * Applied on the form root rather than by editing 30-odd container blocks,
	 * so it holds for every page including ones nobody re-checks. On a
	 * container that does have its own bottom padding this simply reads as
	 * generous.
	 */
	padding-bottom: 24px;
}

.evf *,
.evf *::before,
.evf *::after {
	box-sizing: border-box;
}

.evf .evf-form {
	display: flex;
	flex-direction: column;
	gap: var(--evf-gap);
	margin: 0;
}

.evf .evf-field {
	margin: 0;
	min-width: 0;
}

/* ------------------------------------------- the frozen Contact Form 7 host */

/*
 * `.evf--cf7` is emitted by exactly one host: the lp.veraclinic.net port in
 * ev-lps (`sites/lp-veraclinic`). It is the only host that does not author its
 * own form markup — it splices ev-forms' controls into Contact Form 7 markup
 * frozen byte-for-byte out of WordPress, so the page's own stylesheet still
 * owns the layout and the type, and three of the rules above would take that
 * over. They are neutralised here rather than made conditional, so every
 * existing host stays byte-identical.
 *
 *  - The `.evf` root block sets `font-family`, `color`, `max-width` and
 *    `padding-bottom`. The first two INHERIT into the frozen field labels,
 *    option labels and submit value. Measured over the 87 frozen documents:
 *    nothing sets `font-family` on that text at all, and `.labeltext{color:#000}`
 *    reaches only 39 of 87 — so on the rest the page's own font and colour
 *    would move.
 *  - `.evf .evf-form`'s flex column adds `--evf-gap` between every child, on
 *    top of the `<p>` margins the frozen markup already carries.
 *  - `.evf .evf-field`'s `min-width: 0` lands on real flex items there: form
 *    109453's row layout (63 of the 165 instances) makes each field a flex
 *    child, and `auto` is what it renders with today.
 *
 * Specificity, not source order. `.evf--cf7` alone is 0-1-0 — exactly what
 * `.evf` is — so it would win only by sitting later in the file, and a rule
 * that loses looks identical to one that wins. `.evf.evf--cf7` is 0-2-0 and
 * the descendant forms are 0-3-0, so each beats its target wherever it is
 * written.
 *
 * `margin: revert` rather than a literal: it drops to the user-agent value,
 * which is what those pages render today. Measured across the 87 inline
 * <style> blocks and all 115 vendored stylesheets, ZERO author rules set a
 * margin on `form` or `.wpcf7-form`, so there is no author value to preserve.
 */
.evf.evf--cf7 {
	font-family: inherit;
	color: inherit;
	max-width: none;
	padding-bottom: 0;
}

.evf.evf--cf7 .evf-form {
	display: block;
	gap: normal;
	margin: revert;
}

.evf.evf--cf7 .evf-field {
	min-width: auto;
}

/* Accessible name without a visible label. */
.evf .evf-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------- controls */

/*
 * `span.` sits beside `div.` in every control selector below because the CF7
 * port cannot use a <div>. Its phone control wraps an <input> that already
 * lives inside `<p><span class="wpcf7-form-control-wrap">…</span></p>`, and a
 * <div> anywhere inside a <p> closes it: parse5 on a real frozen region shows
 * the wrap span reconstructed OUTSIDE the input, which breaks both
 * `[data-name="mobilephone"]{direction:ltr!important}` and the input's own
 * five CF7 classes. A <span> leaves the tree untouched. No other host emits a
 * span with these classes, so this is additive.
 */

.evf input.evf-control,
.evf textarea.evf-control,
.evf div.evf-control,
.evf span.evf-control {
	display: block;
	width: 100%;
	font-family: inherit;
	/* 16px keeps iOS Safari from zooming the viewport on focus. */
	font-size: 16px;
	line-height: 1.4;
	color: var(--evf-text) !important;
	background-color: var(--evf-fill) !important;
	border: 1px solid var(--evf-border) !important;
	border-radius: var(--evf-radius) !important;
	box-shadow: none !important;
	margin: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.evf input.evf-control {
	height: var(--evf-control-h) !important;
	padding: 0 var(--evf-pad-x) !important;
	appearance: none;
	-webkit-appearance: none;
}

.evf textarea.evf-control {
	min-height: 96px;
	height: auto !important;
	padding: 14px var(--evf-pad-x) !important;
	resize: vertical;
}

.evf input.evf-control::placeholder,
.evf textarea.evf-control::placeholder,
.evf input.evf-phone-input::placeholder {
	color: var(--evf-placeholder);
	opacity: 1;
}

.evf input.evf-control:focus,
.evf textarea.evf-control:focus,
.evf div.evf-control:focus-within,
.evf span.evf-control:focus-within {
	outline: none;
	border-color: var(--evf-border-focus) !important;
	box-shadow: 0 0 0 3px rgba(0, 178, 219, 0.18) !important;
}

/* ------------------------------------------------------------------- phone */

.evf div.evf-phone,
.evf span.evf-phone {
	display: flex;
	align-items: stretch;
	height: var(--evf-control-h) !important;
	padding: 0 !important;
	overflow: hidden;
}

.evf .evf-cc-display {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	padding: 0 10px 0 var(--evf-pad-x);
	/* A native <select> is not a link. Both this display layer and the real
	 * control below it take the arrow, matching every other form control on the
	 * page rather than implying navigation. */
	cursor: default;
	user-select: none;
	white-space: nowrap;
}

.evf .evf-flag {
	display: inline-flex;
	align-items: center;
	font-size: 19px;
	line-height: 1;
	/* Colour-emoji fonts first: on platforms without one the regional
	   indicator pair renders as two letters, which is still a legible
	   country hint rather than tofu. */
	font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/*
 * WordPress's emoji script swaps the flag character for an <img class="emoji">
 * served from s.w.org, and its observer re-runs on every country change, so
 * this is the normal rendering path on this host rather than an edge case.
 * It is an improvement: a real flag on Windows too, where the regional
 * indicator pair would otherwise render as the letters "GB".
 *
 * Size and alignment are pinned here so the control does not depend on the
 * theme's own .emoji rule, which sets height:1em and can leave the flag
 * misaligned against the dial code. Sites where the emoji script is disabled
 * (vc and vs run disable-emoji-detector.php; dental does not) simply keep the
 * native character and the rule above applies instead.
 */
.evf .evf-flag img.emoji {
	width: 19px !important;
	height: 19px !important;
	margin: 0 !important;
	padding: 0 !important;
	display: block !important;
	vertical-align: middle;
	border: 0;
	box-shadow: none;
}

.evf .evf-dial {
	font-size: 16px;
	font-weight: 500;
	color: var(--evf-text);
	/*
	 * A dial code is LTR text even on an RTL page. Without isolation the
	 * bidi algorithm reorders "+966" to render as "966+", because the "+"
	 * is a neutral character adopting the surrounding RTL direction.
	 */
	/* !important because the site's RTL stylesheet sets direction:rtl on a
	   broader selector that outranks this one; without it the rule applies
	   unicode-bidi but not the direction, and "+966" still renders "966+". */
	direction: ltr !important;
	unicode-bidi: isolate;
}

.evf .evf-caret {
	width: 11px;
	height: 7px;
	flex: 0 0 auto;
	color: #6b8299;
}

/*
 * The real <select> sits transparently over the display. Native picker and
 * native keyboard behaviour, custom appearance.
 */
.evf select.evf-cc {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: default;
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	font-size: 16px;
}

.evf .evf-divider {
	flex: 0 0 1px;
	width: 1px;
	background-color: var(--evf-border);
	margin: 10px 0;
}

.evf input.evf-phone-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100% !important;
	font-family: inherit;
	font-size: 16px;
	color: var(--evf-text) !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 var(--evf-pad-x) !important;
	appearance: none;
	-webkit-appearance: none;
}

.evf input.evf-phone-input:focus {
	outline: none;
	box-shadow: none !important;
}

/* --------------------------------------------------------------- validation */

.evf .evf-error {
	display: none;
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.35;
	color: var(--evf-error-text);
}

.evf .evf-field.is-invalid .evf-error {
	display: block;
}

.evf .evf-field.is-invalid input.evf-control,
.evf .evf-field.is-invalid textarea.evf-control,
.evf .evf-field.is-invalid div.evf-control,
.evf .evf-field.is-invalid span.evf-control {
	border-color: var(--evf-error) !important;
}

.evf .evf-field.is-invalid input.evf-control:focus,
.evf .evf-field.is-invalid textarea.evf-control:focus,
.evf .evf-field.is-invalid div.evf-control:focus-within,
.evf .evf-field.is-invalid span.evf-control:focus-within {
	box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.16) !important;
}

/* --------------------------------------------------------- typo suggestion */

/*
 * "Did you mean" suggestion under the email input. NOT an error: no red, no
 * !important border treatment on the control, and role="status" rather than
 * role="alert" in the markup.
 *
 * The live region is ALWAYS rendered, unlike .evf-error above. A role="status"
 * element that is display:none is out of the accessibility tree, and making it
 * visible and populating it in the same task is unreliably announced. An empty
 * <p> with no margin is a zero-height box, so keeping it rendered reserves no
 * space -- but it does mean the margin is now contested by the theme's own `p`
 * rules, hence !important on BOTH margin declarations: an !important beats
 * specificity, so the state rule has to carry one too.
 */
.evf .evf-notice {
	margin: 0 !important;
	font-size: 13px;
	line-height: 1.35;
	color: var(--evf-notice-text);
	/* The local part is whatever the visitor typed, in a min-width: 0 field. */
	overflow-wrap: break-word;
}

.evf .evf-field.is-suggesting .evf-notice {
	margin: 6px 0 0 !important;
}

/* An address is an LTR sequence whatever the page direction. Same remedy as
 * .evf-dial above, written here rather than borrowed from the UA stylesheet. */
.evf .evf-notice bdi {
	direction: ltr;
	unicode-bidi: isolate;
}

/*
 * The action IS the address, inline in the sentence, and the affordance is the
 * UNDERLINE rather than a colour.
 *
 * The previous shape -- an accent-teal pill button underneath -- measured
 * 3.59:1 against plain white on 2026-09-03, under the 4.5:1 AA floor for text
 * this size, and worse again on the tinted panels some landing pages put the
 * form on. Inheriting the form's own text colour means this control can never
 * be the lowest-contrast thing on the panel: it is exactly as legible as the
 * sentence around it, whatever that sentence sits on. It also stops colour
 * being the only thing marking the control, per WCAG 1.4.1.
 *
 * Dropping the 32px pill is legitimate rather than a regression because an
 * inline control inside a sentence is exempt from the 24x24 target minimum
 * (WCAG 2.2 SC 2.5.8, "inline" exception).
 *
 * Tag-qualified, and every property the theme sets is overridden, for the same
 * reason .evf button.evf-submit is: those rules sit at 0-1-1 later in the
 * cascade and win a specificity tie.
 */
.evf button.evf-notice-action {
	display: inline;
	font: inherit;
	font-weight: 600;
	color: inherit !important;
	background: none !important;
	background-color: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0;
	width: auto;
	height: auto !important;
	text-align: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
	box-shadow: none !important;
	cursor: pointer;
}

.evf button.evf-notice-action:hover,
.evf button.evf-notice-action:focus-visible {
	text-decoration-thickness: 2px;
}

.evf button.evf-notice-action:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ submit */

.evf button.evf-submit {
	display: block;
	width: 100%;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff !important;
	background-color: var(--evf-accent) !important;
	border: 1px solid var(--evf-accent) !important;
	border-radius: var(--evf-radius) !important;
	min-height: var(--evf-control-h);
	padding: 14px 24px !important;
	margin: 4px 0 0;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.evf button.evf-submit:hover:not(:disabled) {
	background-color: var(--evf-accent-dark) !important;
	border-color: var(--evf-accent-dark) !important;
}

.evf button.evf-submit:focus-visible {
	outline: 3px solid rgba(0, 178, 219, 0.45);
	outline-offset: 2px;
}

.evf button.evf-submit:disabled {
	opacity: 0.65;
	cursor: default;
}

.evf .evf-status {
	display: none;
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.4;
}

.evf .evf-status.is-error {
	display: block;
	color: var(--evf-error-text);
}

/*
 * Honeypot. display:none, NOT off-screen positioning.
 *
 * An off-screen-but-laid-out input (left:-9999px) is still a real box to a
 * password manager, and name="website" matches a saved login's website slot,
 * so Chrome / 1Password / Bitwarden / Dashlane fill it for a real visitor and
 * ev-form-api drops that lead silently. autocomplete="off" is widely ignored
 * and does not save us. Those same managers reliably skip display:none.
 *
 * The earlier comment here claimed off-screen was chosen so a headless browser
 * that skips hidden inputs would still fill it. ev-lps ran that experiment:
 * packages/shared/src/forms/HoneypotInput.tsx switched to display:none on
 * 2026-06-18 and has logged zero organic honeypot trips in the 71 days since,
 * so the bot-catch rate did not measurably move while the autofill false
 * positives stopped. Bots cheap enough to fill every input parse the DOM, not
 * the CSS.
 */
.evf .evf-hp {
	display: none;
}

/* ------------------------------------------------------------------- RTL */

.evf[dir="rtl"] .evf-cc-display {
	padding: 0 var(--evf-pad-x) 0 10px;
}

/*
 * Phone numbers and email addresses are LTR sequences regardless of the page
 * direction. Left to inherit RTL, the bidi algorithm renders the Saudi example
 * "51 234 5678" as "5678 234 51" and does the same to anything the visitor
 * types, so the field actively misinforms. Forcing the direction fixes the
 * glyph order; text-align keeps the field visually anchored to the RTL side.
 */
.evf input.evf-phone-input,
.evf input[type="email"].evf-control {
	direction: ltr !important;
	unicode-bidi: isolate;
}

.evf[dir="rtl"] input.evf-phone-input,
.evf[dir="rtl"] input[type="email"].evf-control {
	text-align: right;
}

.evf[dir="rtl"] input.evf-phone-input::placeholder,
.evf[dir="rtl"] input[type="email"].evf-control::placeholder {
	text-align: right;
}

/* ------------------------------------------------- horizontal variant */

@media (min-width: 720px) {
	.evf--horizontal .evf-form {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: var(--evf-gap);
	}

	.evf--horizontal .evf-field {
		flex: 1 1 190px;
	}

	.evf--horizontal button.evf-submit {
		flex: 0 0 auto;
		width: auto;
		margin-top: 0;
	}

	.evf--horizontal .evf-status {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.evf input.evf-control,
	.evf textarea.evf-control,
	.evf div.evf-control,
	.evf button.evf-submit {
		transition: none;
	}
}
