/**
 * LeadHub 前台表单样式。尽量不侵入主题：全部选择器带 lh- 前缀。
 *
 * @package LeadHub
 */

.lh-wrap {
	--lh-accent: #1f6feb;
	--lh-accent-hover: #1a5fd0;
	--lh-border: #d8dee9;
	--lh-bg: #fff;
	--lh-fg: #1c1f24;
	--lh-muted: #6b7280;
	--lh-err: #d64545;
	--lh-ok: #1a7f37;

	box-sizing: border-box;
	margin: 1.5em 0;
	color: var(--lh-fg);
	font: inherit;
}

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

.lh-card {
	background: var(--lh-bg);
	border: 1px solid var(--lh-border);
	border-radius: 10px;
	padding: 1.25em;
	box-shadow: 0 1px 3px rgb(0 0 0 / 6%);
}

.lh-title {
	margin: 0 0 0.4em;
	font-size: 1.2em;
	line-height: 1.3;
}

.lh-sub {
	margin: 0 0 1em;
	color: var(--lh-muted);
	font-size: 0.92em;
}

.lh-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.7em 0.9em;
}

.lh-fld--full {
	grid-column: 1 / -1;
}

.lh-fld {
	display: block;
	margin: 0;
}

.lh-fld__l {
	display: block;
	margin-bottom: 0.25em;
	font-size: 0.86em;
	color: var(--lh-muted);
}

.lh-req {
	color: var(--lh-err);
}

.lh-fld input[type="text"],
.lh-fld input[type="tel"],
.lh-fld input[type="email"],
.lh-fld select,
.lh-fld textarea {
	width: 100%;
	padding: 0.55em 0.7em;
	border: 1px solid var(--lh-border);
	border-radius: 7px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.3;
}

.lh-fld textarea {
	resize: vertical;
}

.lh-fld input:focus,
.lh-fld select:focus,
.lh-fld textarea:focus {
	outline: 2px solid rgb(31 111 235 / 35%);
	outline-offset: 1px;
	border-color: var(--lh-accent);
}

.lh-fld--bad input,
.lh-fld--bad textarea,
.lh-fld--bad select {
	border-color: var(--lh-err);
}

/* 蜜罐：视觉与读屏器都隐藏，但保持可提交 */
.lh-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lh-consent {
	display: flex;
	gap: 0.5em;
	align-items: flex-start;
	margin: 0.8em 0 0;
	font-size: 0.84em;
	color: var(--lh-muted);
}

.lh-consent input {
	margin-top: 0.15em;
}

.lh-actions {
	margin-top: 0.9em;
}

.lh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: 8px;
	background: var(--lh-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.lh-btn:hover {
	background: var(--lh-accent-hover);
}

.lh-btn:disabled {
	opacity: 0.7;
	cursor: progress;
}

.lh-msg {
	margin: 0.7em 0 0;
	min-height: 1.2em;
	font-size: 0.9em;
}

.lh-msg--ok {
	color: var(--lh-ok);
}

.lh-msg--err {
	color: var(--lh-err);
}

.lh-wrap--compact .lh-card {
	padding: 1em;
	border: 0;
	box-shadow: none;
}

/* ---------------- 悬浮按钮 ---------------- */

.lh-float {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 9990;
	font: inherit;
}

.lh-float__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.7em 1.1em;
	border: 0;
	border-radius: 999px;
	background: #1f6feb;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 18px rgb(0 0 0 / 22%);
}

.lh-float__ico {
	font-size: 1.1em;
}

.lh-float__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 12px);
	width: min(92vw, 400px);
	max-height: 78vh;
	overflow: auto;
	background: #fff;
	border: 1px solid #d8dee9;
	border-radius: 12px;
	padding: 0.6em;
	box-shadow: 0 10px 34px rgb(0 0 0 / 20%);
}

.lh-float__close {
	position: absolute;
	top: 6px;
	right: 10px;
	border: 0;
	background: transparent;
	font-size: 1.3em;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
}

@media (max-width: 640px) {
	.lh-grid {
		grid-template-columns: 1fr;
	}

	.lh-float__txt {
		display: none;
	}
}
