/**
 * Elementor Forms Spam Guard
 * Rameez Raja — https://www.linkedin.com/in/rameez-raja-wordpress
 *
 * Elementor renders .elementor-field-group as a flex container, so any
 * inline validation message inside it collapses to min-content width and
 * wraps one word per line, and — worse — reserves the extra height it
 * needs, pushing every field below it down the page while it's showing.
 *
 * Email and message are the two field types this plugin actually validates,
 * so their message is turned into a floating popup anchored under the
 * field: it never changes the form's height. Every other field type keeps
 * the simpler full-width inline fix, since only email/message need the
 * popup treatment here.
 */

.elementor-field-group {
	position: relative;
}

.elementor-field-group.elementor-field-type-email .elementor-message.elementor-help-inline,
.elementor-field-group.elementor-field-type-textarea .elementor-message.elementor-help-inline,
.elementor-field-group.efsg-wrap .elementor-message.elementor-help-inline {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 8px;
	padding: 10px 12px;
	max-width: min(320px, 100%);
	width: max-content;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
	font-size: 13px;
	line-height: 1.4;
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: none;
	z-index: 10000;
}

/* Little pointer arrow linking the popup back to the field */
.elementor-field-group.elementor-field-type-email .elementor-message.elementor-help-inline::before,
.elementor-field-group.elementor-field-type-textarea .elementor-message.elementor-help-inline::before,
.elementor-field-group.efsg-wrap .elementor-message.elementor-help-inline::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 16px;
	border: 6px solid transparent;
	border-bottom-color: #fff;
}

.elementor-field-group .elementor-help-inline > i,
.elementor-field-group .elementor-help-inline > svg {
	flex: 0 0 auto;
	vertical-align: -1px;
}

/*
 * Every other field type (name, tel, etc.) keeps the original inline fix —
 * full width and normal wrapping — since only email/message float as a
 * popup here.
 */
.elementor-field-group:not(.elementor-field-type-email):not(.elementor-field-type-textarea):not(.efsg-wrap) .elementor-help-inline,
.elementor-field-group:not(.elementor-field-type-email):not(.elementor-field-type-textarea):not(.efsg-wrap) .elementor-message.elementor-help-inline {
	flex: 1 1 100%;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	line-height: 1.4;
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: none;
}

/*
 * The "did you mean gmail.com?" hint. Deliberately styled as a neutral
 * suggestion (not red) since it's advisory, not a blocked submission.
 * A small label line plus a distinct pill button reads more cleanly than
 * one run-on sentence, and never wraps awkwardly at narrow widths.
 */
.efsg-hint {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 10px;
	padding: 12px 14px;
	max-width: min(280px, 100%);
	width: max-content;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.06);
	font-size: 13px;
	line-height: 1.4;
	color: #444;
	z-index: 10000;
}

.efsg-hint.is-visible {
	display: block;
}

/* Little pointer arrow linking the popup back to the field */
.efsg-hint::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 16px;
	border: 6px solid transparent;
	border-bottom-color: #fff;
	filter: drop-shadow(0 -2px 1px rgba(0, 0, 0, 0.06));
}

.efsg-hint-label {
	font-size: 12px;
	color: #8a8a8a;
	margin-bottom: 6px;
}

.efsg-hint-fix {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #f0f6ff;
	border: 1px solid #cfe0fb;
	border-radius: 6px;
	padding: 6px 10px;
	color: #1a56db;
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.efsg-hint-fix::before {
	content: "✓";
	font-weight: 700;
}

.efsg-hint-fix:hover,
.efsg-hint-fix:focus {
	background: #e2edff;
	border-color: #a9c8fb;
	color: #135e96;
}
