/* =====================================================================
 * WP Auth Pages - 前端样式
 * ================================================================== */

.wap-auth {
	--wap-primary: #4f46e5;
	--wap-primary-2: #6366f1;
	--wap-primary-3: #8b5cf6;
	--wap-text: #1e293b;
	--wap-muted: #64748b;
	--wap-border: #e2e8f0;
	position: relative;
	box-sizing: border-box;
	max-width: 400px;
	margin: 40px auto;
	padding: 38px 32px 30px;
	background: #fff;
	border: 1px solid rgba(226, 232, 240, .9);
	border-radius: 20px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 16px 40px -18px rgba(15, 23, 42, .28);
	color: var(--wap-text);
	font-size: 15px;
	line-height: 1.55;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

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

.wap-auth::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	background: linear-gradient(90deg, #6366f1, #8b5cf6 55%, #ec4899);
}

/* ---------- 标题 ---------- */
.wap-auth .wap-heading { margin: 0 0 22px; text-align: center; }

.wap-auth .wap-title {
	margin: 0;
	font-size: 23px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.3;
	color: #0f172a;
}

.wap-auth .wap-subtitle {
	margin: 7px 0 0;
	font-size: 14px;
	color: var(--wap-muted);
}

/* ---------- 提示信息 ---------- */
.wap-auth .wap-message {
	padding: 11px 14px;
	margin: 0 0 16px;
	border-radius: 11px;
	font-size: 13.5px;
	line-height: 1.55;
	border: 1px solid transparent;
}

.wap-auth .wap-error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}

.wap-auth .wap-success {
	background: #f0fdf4;
	border-color: #bbf7d0;
	color: #15803d;
}

/* ---------- 表单字段 ---------- */
.wap-auth .wap-field { margin: 0 0 15px; }

.wap-auth .wap-field label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
}

.wap-auth input[type="text"],
.wap-auth input[type="email"],
.wap-auth input[type="password"] {
	display: block;
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	line-height: 1.4;
	color: var(--wap-text);
	background: #f8fafc;
	border: 1.5px solid var(--wap-border);
	border-radius: 11px;
	outline: none;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wap-auth input::placeholder { color: #94a3b8; }

.wap-auth input[type="text"]:focus,
.wap-auth input[type="email"]:focus,
.wap-auth input[type="password"]:focus {
	background: #fff;
	border-color: var(--wap-primary-2);
	box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}

.wap-auth .wap-field-hint {
	display: block;
	margin: 6px 2px 0;
	font-size: 12px;
	color: #94a3b8;
	line-height: 1.5;
}

/* ---------- 密码显隐 ---------- */
.wap-password-wrap { position: relative; }

.wap-password-wrap input[type="password"],
.wap-password-wrap input[type="text"] {
	padding-right: 46px;
}

.wap-toggle-password {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: #94a3b8;
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: color .15s ease, background .15s ease;
}

.wap-toggle-password:hover {
	color: var(--wap-primary);
	background: rgba(99, 102, 241, .08);
}

.wap-toggle-password:focus-visible {
	outline: 2px solid var(--wap-primary);
	outline-offset: 1px;
}

.wap-password-wrap.is-visible .wap-toggle-password {
	color: var(--wap-primary);
}

/* ---------- 密码强度 ---------- */
.wap-strength {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 2px 0;
}

.wap-strength-track {
	position: relative;
	flex: 1;
	height: 6px;
	background: #e2e8f0;
	border-radius: 4px;
	overflow: hidden;
}

.wap-strength-fill {
	position: absolute;
	top: 0; left: 0; bottom: 0;
	width: 0;
	background: #e2e8f0;
	border-radius: 4px;
	transition: width .25s ease, background .25s ease;
}

.wap-strength-label {
	font-size: 12px;
	font-weight: 500;
	color: #94a3b8;
	white-space: nowrap;
	min-width: 32px;
	text-align: right;
}

.wap-strength[data-level="weak"] .wap-strength-fill { width: 33%; background: #ef4444; }
.wap-strength[data-level="weak"] .wap-strength-label { color: #ef4444; }

.wap-strength[data-level="medium"] .wap-strength-fill { width: 66%; background: #f59e0b; }
.wap-strength[data-level="medium"] .wap-strength-label { color: #f59e0b; }

.wap-strength[data-level="strong"] .wap-strength-fill { width: 100%; background: #22c55e; }
.wap-strength[data-level="strong"] .wap-strength-label { color: #16a34a; }

/* ---------- 提交按钮 ---------- */
.wap-auth .wap-submit { margin: 22px 0 0; }

.wap-auth button[type="submit"] {
	display: block;
	width: 100%;
	padding: 13px 18px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	letter-spacing: .01em;
	color: #fff;
	background: linear-gradient(135deg, var(--wap-primary-2), var(--wap-primary) 60%, var(--wap-primary-3));
	background-size: 160% 160%;
	border: 0;
	border-radius: 11px;
	cursor: pointer;
	box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .8);
	transition: transform .14s ease, box-shadow .22s ease, background-position .35s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wap-auth button[type="submit"]:hover {
	background-position: 100% 0;
	transform: translateY(-1px);
	box-shadow: 0 12px 26px -10px rgba(79, 70, 229, .85);
}

.wap-auth button[type="submit"]:active { transform: translateY(0); }

.wap-auth button[type="submit"]:focus-visible {
	outline: 2px solid var(--wap-primary);
	outline-offset: 2px;
}

/* ---------- 底部链接 ---------- */
.wap-auth .wap-links {
	margin: 18px 0 0;
	text-align: center;
	font-size: 13.5px;
	color: var(--wap-muted);
}

.wap-auth .wap-links a {
	color: var(--wap-primary);
	font-weight: 500;
	text-decoration: none;
	transition: color .15s ease;
}

.wap-auth .wap-links a:hover { color: var(--wap-primary-3); text-decoration: underline; }

/* =====================================================================
 * 状态页（激活 / 提示）
 * ================================================================== */
.wap-auth .wap-state-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	margin: 4px auto 16px;
	border-radius: 50%;
}

.wap-auth .wap-state-success { color: #16a34a; background: #f0fdf4; }
.wap-auth .wap-state-error   { color: #dc2626; background: #fef2f2; }
.wap-auth .wap-state-info    { color: var(--wap-primary); background: #eef2ff; }

.wap-auth .wap-state-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
	text-align: center;
}

.wap-auth .wap-state-text {
	margin: 0;
	font-size: 14px;
	color: #475569;
	text-align: center;
	line-height: 1.7;
}

.wap-auth .wap-state-text + .wap-links { margin-top: 20px; }

/* =====================================================================
 * 滑块拼图验证码
 * ================================================================== */
.wap-captcha {
	margin: 4px 0 18px;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.wap-captcha-stage {
	position: relative;
	width: 100%;
	height: 160px;
	margin-bottom: 12px;
	border-radius: 12px;
	overflow: hidden;
	background: #eef2f7;
	touch-action: none;
}

.wap-captcha-stage canvas {
	position: absolute;
	display: block;
	top: 0;
	left: 0;
}

.wap-captcha-bg { width: 100%; height: 100%; }

.wap-captcha-piece {
	width: 50px;
	height: 50px;
	pointer-events: none;
	will-change: transform;
	transition: transform .28s cubic-bezier(.22, 1, .36, 1);
	filter: drop-shadow(0 3px 7px rgba(15, 23, 42, .38));
}

.wap-captcha-track {
	position: relative;
	width: 100%;
	height: 50px;
	border-radius: 12px;
	background: linear-gradient(180deg, #f8fafc, #f1f5f9);
	box-shadow: inset 0 0 0 1.5px var(--wap-border);
	overflow: hidden;
	touch-action: none;
	transition: box-shadow .2s ease, background .2s ease;
}

.wap-captcha-fill {
	position: absolute;
	top: 0;
	left: 0;
	width: 50px;
	height: 100%;
	background: linear-gradient(135deg, rgba(99, 102, 241, .2), rgba(139, 92, 246, .2));
	box-shadow: inset -1px 0 0 rgba(99, 102, 241, .32);
	transition: width .28s cubic-bezier(.22, 1, .36, 1);
}

.wap-captcha-hint {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13.5px;
	color: var(--wap-muted);
	letter-spacing: .02em;
	pointer-events: none;
	transition: opacity .2s ease, color .2s ease;
}

.wap-captcha-thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 50px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wap-primary);
	background: #fff;
	border: 1.5px solid var(--wap-border);
	border-radius: 11px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
	cursor: grab;
	touch-action: none;
	will-change: transform;
	transition: transform .28s cubic-bezier(.22, 1, .36, 1), background .18s ease, border-color .18s ease, color .18s ease;
}

.wap-captcha-thumb:focus-visible {
	outline: 2px solid var(--wap-primary);
	outline-offset: 2px;
}

.wap-captcha-thumb:active,
.wap-captcha.is-dragging .wap-captcha-thumb {
	cursor: grabbing;
	color: var(--wap-primary);
	background: #eef2ff;
	border-color: var(--wap-primary-2);
}

.wap-captcha.is-dragging .wap-captcha-thumb,
.wap-captcha.is-dragging .wap-captcha-piece,
.wap-captcha.is-dragging .wap-captcha-fill {
	transition: none;
}

.wap-captcha.is-error .wap-captcha-track {
	box-shadow: inset 0 0 0 1.5px #f87171;
	animation: wap-shake .42s ease;
}

.wap-captcha.is-error .wap-captcha-thumb {
	border-color: #f87171;
	color: #dc2626;
}

@keyframes wap-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-6px); }
	40% { transform: translateX(6px); }
	60% { transform: translateX(-4px); }
	80% { transform: translateX(4px); }
}

.wap-captcha.is-verified .wap-captcha-track {
	background: #f0fdf4;
	box-shadow: inset 0 0 0 1.5px #4ade80;
}

.wap-captcha.is-verified .wap-captcha-fill {
	background: rgba(74, 222, 128, .22);
	box-shadow: inset -1px 0 0 rgba(74, 222, 128, .45);
}

.wap-captcha.is-verified .wap-captcha-thumb {
	color: #fff;
	background: #22c55e;
	border-color: #22c55e;
}

.wap-captcha.is-verified .wap-captcha-hint {
	color: #15803d;
	font-weight: 600;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
	.wap-auth {
		margin: 16px auto;
		padding: 30px 20px 24px;
		border-radius: 16px;
	}

	.wap-auth .wap-title { font-size: 20px; }
	.wap-captcha-stage { height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
	.wap-auth *,
	.wap-auth *::before,
	.wap-auth *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}