/* WiderMatrix Lead Form — 前端样式 */

/* honeypot：对人类隐藏，对机器人可见 */
.wm-hp-wrap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* 必填字段红色星号 */
.wm-req {
	color: #e5304c;
	font-weight: 700;
	margin-left: 2px;
}

/* 提交结果提示 */
.wm-form-msg {
	margin-top: 12px;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
}
.wm-form-msg.wm-ok {
	background: #e8f9ef;
	color: #1a7f4b;
	border: 1px solid #b7e6c9;
}
.wm-form-msg.wm-err {
	background: #fdecec;
	color: #c0392b;
	border: 1px solid #f5c6c6;
}

/* WhatsApp 悬浮按钮（全站，wp_footer 输出） */
.wa-float {
	position: fixed;
	right: 26px;
	bottom: 26px;
	z-index: 99;
	width: 60px;
	height: 60px;
	border: none;
	padding: 0;
	margin: 0;
	border-radius: 50% 50% 50% 12px;
	background: #25d366;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 28px rgba(37, 211, 102, .4);
	transition: transform .3s ease;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.wa-float:focus-visible {
	outline: 3px solid #1a7f4b;
	outline-offset: 3px;
}

/* 脉冲光环（消息提醒式扩散） */
.wa-pulse {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
}
.wa-pulse::before,
.wa-pulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 2px solid rgba(37, 211, 102, .55);
	animation: waPulse 2.6s ease-out infinite;
}
.wa-pulse::after { animation-delay: 1.3s; }
@keyframes waPulse {
	0%   { transform: scale(1); opacity: .8; }
	70%  { transform: scale(1.55); opacity: 0; }
	100% { transform: scale(1.55); opacity: 0; }
}

/* 引话气泡：仿真"客服新消息"，单行紧凑，8 秒后自动收起，hover 再展开 */
.wa-bubble {
	position: absolute;
	bottom: calc(100% + 14px);
	right: 0;
	background: #fff;
	color: #2a2a2e;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	padding: 11px 14px;
	border-radius: 16px 16px 4px 16px;
	box-shadow: 0 10px 30px rgba(30, 61, 52, .18);
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translateY(10px) scale(.9);
	transition: opacity .35s ease, transform .35s ease;
}
/* JS 控制显示（间歇性弹出） */
.wa-bubble.bubble-show {
	opacity: 1;
	transform: translateY(0) scale(1);
}
.wa-bubble-text { display: block; }

/* 未读角标（常驻按钮右上角，点击后消失） */
.wa-unread {
	position: absolute;
	top: -5px;
	right: -4px;
	z-index: 2;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: #e5304c;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 3px rgba(229, 48, 76, .2);
	pointer-events: none;
	transition: opacity .3s ease, transform .3s ease;
}
.wa-float.chat-opened .wa-unread {
	opacity: 0;
	transform: scale(.4);
}
.wa-bubble-arrow {
	position: absolute;
	bottom: -7px;
	right: 18px;
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 8px solid #fff;
}
.wa-float.bubble-away .wa-bubble {
	opacity: 0 !important;
	transform: translateY(6px) scale(.92) !important;
	pointer-events: none;
}
.wa-float:hover .wa-bubble,
.wa-float:focus-visible .wa-bubble {
	opacity: 1 !important;
	transform: translateY(0) !important;
	transition-delay: 0s;
}
@keyframes waBubbleIn {
	from { opacity: 0; transform: translateY(10px) scale(.9); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 图标周期性轻摇唤起注意 */
.wa-float svg {
	animation: waWiggle 12s ease-in-out 3s infinite;
}
@keyframes waWiggle {
	0%, 88%, 100% { transform: rotate(0); }
	90% { transform: rotate(-9deg); }
	92% { transform: rotate(8deg); }
	94% { transform: rotate(-6deg); }
	96% { transform: rotate(4deg); }
	98% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
	.wa-pulse::before, .wa-pulse::after { animation: none; opacity: 0; }
	.wa-float svg { animation: none; }
	.wa-bubble { animation: none; }
}
.wa-float:hover {
	transform: scale(1.08);
}
.wa-float svg {
	width: 30px;
	height: 30px;
	fill: #fff;
}
@media (max-width: 600px) {
	.wa-float {
		right: 16px;
		bottom: 16px;
		width: 56px;
		height: 56px;
	}
}

/* 弹窗打开时的淡遮罩 */
.wa-backdrop {
	position: fixed;
	inset: 0;
	z-index: 120;
	background: rgba(43, 24, 48, .28);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity .3s ease;
}
.wa-backdrop.show { opacity: 1; }
.wa-backdrop[hidden] { display: none; }

/* WhatsApp 弹出小表单 */
.wa-popup {
	position: fixed;
	right: 26px;
	bottom: 100px;
	z-index: 130;
	width: 300px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
	overflow: hidden;
	font-family: inherit;
}
.wa-popup[hidden] { display: none; }
.wa-popup-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #075e54;
	color: #fff;
	padding: 12px 16px;
	font-size: 14px;
}
.wa-popup-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}
.wa-popup form { padding: 14px 16px 16px; }
.wa-field { margin-bottom: 10px; }
.wa-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #333;
	margin-bottom: 4px;
}
.wa-field input,
.wa-field textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1.5px solid #e2e2e2;
	border-radius: 9px;
	font-family: inherit;
	font-size: 13.5px;
	background: #fafafa;
	box-sizing: border-box;
	line-height: 1.5;
}
.wa-field textarea {
	resize: vertical;
	min-height: 84px;
}
.wa-field input:focus,
.wa-field textarea:focus {
	outline: none;
	border-color: #25d366;
	background: #fff;
}
.wa-popup-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 11px 14px;
	border: none;
	border-radius: 999px;
	background: #25d366;
	color: #fff;
	font-family: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: filter .2s;
}
.wa-popup-submit:hover { filter: brightness(1.08); }
.wa-popup-submit svg { width: 17px; height: 17px; fill: #fff; }

/* 手机端：贴边底部面板（覆盖上面的 width:300px，必须放在其后） */
@media (max-width: 600px) {
	.wa-popup {
		right: 10px;
		left: 10px;
		bottom: 86px;
		width: auto;
		max-height: calc(100vh - 110px);
		overflow-y: auto;
		border-radius: 14px;
	}
	.wa-popup form { padding: 12px 14px 14px; }
	.wa-field { margin-bottom: 9px; }
	.wa-field input, .wa-field textarea { padding: 10px 12px; }
}
/* 弹窗打开时隐藏引话气泡，避免重叠 */
.wa-float[aria-expanded="true"] .wa-bubble {
	opacity: 0 !important;
	transform: translateY(6px) !important;
}

/* 提交/跳转加载遮罩 */
.wa-popup { position: fixed; }
.wa-loading {
	position: absolute;
	inset: 0;
	z-index: 3;
	background: rgba(255, 255, 255, .94);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	text-align: center;
	padding: 20px;
}
.wa-loading[hidden] { display: none; }
.wa-loading .wa-spinner {
	width: 34px;
	height: 34px;
	border: 3.5px solid #d9f2e3;
	border-top-color: #25d366;
	border-radius: 50%;
	animation: waSpin .8s linear infinite;
}
@keyframes waSpin { to { transform: rotate(360deg); } }
.wa-loading .wa-loading-sub { font-size: 12px; color: #999; font-weight: 400; }
@media (prefers-reduced-motion: reduce) {
	.wa-loading .wa-spinner { animation: none; }
}

/* 提交中按钮：转圈 spinner + 禁用态 */
.wm-spin {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	vertical-align: -2px;
	margin-right: 8px;
	animation: wm-spin .7s linear infinite;
}
@keyframes wm-spin { to { transform: rotate(360deg); } }
button[type="submit"]:disabled,
input[type="submit"]:disabled {
	opacity: .75;
	cursor: not-allowed;
}
