/**
 * 登录页 / 注册页（templates/auth.php）
 *
 * 【为什么写独立 CSS 而不是全用 Tailwind 工具类】
 * 这两个页不进 React 主包，也不想为它们跑一次 npm 构建（新工具类不重建就不存在）。
 * 同时避免被后加载的第三方全局工具类打穿，见 .cursor/rules/aicore-unscoped-tailwind.mdc。
 *
 * 【色值与字号取自设计 token，不是随手定的】
 * 文字 #222 / #666 / #999 / #CCC = ink / secondary / tertiary / disabled
 * 描边 #DEDEDE / #EDEDED = line / line-soft
 * 品牌 #e03030 / #c52a2a = primary-500 / 600
 * 字号 16 / 15 / 14 / 13 = body / subhead / caption / footnote
 * 标题字号不在此声明：主题 base 层的 h1 已是 display(40) + 600 + #222，直接继承。
 */

/* 屏幕切换靠原生 hidden 属性；这里显式兜一层，防被外部工具类的 display 覆盖 */
.mytheme-auth [hidden] {
	display: none !important;
}

.mytheme-auth {
	display: flex;
	justify-content: center;
	width: 100%;
	max-width: 26rem;
	margin: 0 auto;
	padding: 1.5rem;
	box-sizing: border-box;
}

/* 扫码同意那句要一行排完，原卡片内宽不够，只把这一屏加宽。 */
.mytheme-auth:has([data-auth-screen='wechat']:not([hidden])) {
	max-width: 442px;
	padding-left: 1rem;
	padding-right: 1rem;
}

.mytheme-auth .wmc-login-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

.mytheme-auth .wmc-login-box--profile {
	align-items: stretch;
}

.mytheme-auth .wmc-qr {
	width: 248px;
	height: 248px;
}

.mytheme-auth__card {
	width: 100%;
	padding: 2rem 1.75rem 1.75rem;
	background: #fff;
	border: 1px solid #ededed;
	border-radius: 1rem;
	box-shadow: 0 12px 40px rgba(34, 34, 34, 0.06);
	animation: mytheme-auth-pop-in 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes mytheme-auth-pop-in {
	from {
		opacity: 0;
		transform: translateY(40px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (min-width: 640px) {
	.mytheme-auth__card {
		padding: 2.5rem 2.25rem 2rem;
	}
}

.mytheme-auth__card:has([data-auth-screen='wechat']:not([hidden])) {
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

@media (min-width: 640px) {
	.mytheme-auth__card:has([data-auth-screen='wechat']:not([hidden])) {
		padding-left: 1.75rem;
		padding-right: 1.75rem;
	}
}

/* ===== 标题区 ===== */

.mytheme-auth__title {
	margin: 0 0 0.5rem;
}

.mytheme-auth__subtitle {
	margin: 0 0 1.75rem;
	font-size: 14px; /* caption */
	line-height: 1.5;
	color: #666; /* ink-secondary */
}

.mytheme-auth__subtitle strong {
	font-weight: 500;
	color: #222; /* ink */
}

/* ===== 步骤条 ===== */

.mytheme-auth__steps {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 1.75rem;
	padding: 0;
	list-style: none;
}

.mytheme-auth__steps li {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 13px; /* footnote */
	line-height: 1.45;
	color: #CCC; /* ink-disabled：未到达的步骤 */
}

.mytheme-auth__steps li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	border: 1px solid currentColor;
	border-radius: 9999px;
	font-size: 13px;
	line-height: 1;
}

.mytheme-auth__steps li.is-current {
	color: #e03030; /* primary-500 */
	font-weight: 500;
}

.mytheme-auth__steps li.is-done {
	color: #666; /* ink-secondary */
}

/* ===== 表单 ===== */

.mytheme-auth__form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.mytheme-auth__field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mytheme-auth__label {
	font-size: 14px; /* caption */
	line-height: 1.5;
	font-weight: 500;
	color: #222; /* ink */
}

.mytheme-auth__input {
	width: 100%;
	height: 2.75rem;
	padding: 0 0.875rem;
	border: 1px solid #DEDEDE; /* line */
	border-radius: 0.5rem; /* rounded-lg 8px */
	background: #fff;
	/* 16px 是硬底线：更小会触发 iOS Safari 自动放大 */
	font-size: 16px;
	line-height: 1.5;
	color: #222;
	transition: border-color 0.2s ease;
}

.mytheme-auth__input::placeholder {
	color: #CCC; /* ink-disabled */
}

.mytheme-auth__input:hover {
	border-color: #999; /* ink-tertiary */
}

.mytheme-auth__input:focus {
	outline: none;
	border-color: #222; /* 焦点用墨色边，不用浏览器默认蓝 */
	box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.08);
}

.mytheme-auth__input[aria-invalid='true'] {
	border-color: #e03030;
}

/* 完善资料：点进去不要墨色细边，浅灰外圈只在鼠标放上时出现。登录等其它屏不改。 */
.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input {
	box-shadow: none;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input:focus {
	outline: none;
	border-color: #dedede;
	box-shadow: none;
}

.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input:hover,
.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input:hover:focus {
	outline: none;
	border-color: #e0e0e0;
	box-shadow:
		0 1px 1px rgba(0, 0, 0, 0.04),
		0 0 0 2px #eeeeee;
}

.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input[aria-invalid='true'],
.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input[aria-invalid='true']:focus,
.mytheme-auth [data-auth-screen='complete'] .mytheme-auth__input[aria-invalid='true']:hover {
	border-color: #e03030;
	box-shadow: none;
}

/* 验证码：等宽 + 字距，便于核对 6 位数字 */
.mytheme-auth__input--code {
	font-size: 24px; /* page：验证码是这一屏的主角 */
	letter-spacing: 0.5em;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.mytheme-auth__hint {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px; /* footnote */
	line-height: 1.6;
	color: #999; /* ink-tertiary */
}

.mytheme-auth__hint li {
	position: relative;
	padding-left: 0.75rem;
}

.mytheme-auth__hint li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 3px;
	height: 3px;
	border-radius: 9999px;
	background: #CCC;
}

.mytheme-auth__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.mytheme-auth__check {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 14px; /* caption */
	color: #666;
	cursor: pointer;
}

.mytheme-auth__check input {
	width: 1rem;
	height: 1rem;
	accent-color: #e03030;
	cursor: pointer;
}

.mytheme-auth__submit {
	width: 100%;
	margin-top: 0.25rem;
}

/* ===== 链接与按钮态链接 ===== */

.mytheme-auth__link {
	padding: 0;
	border: 0;
	background: none;
	font-size: inherit;
	line-height: inherit;
	font-weight: 500;
	color: #e03030; /* primary-500 */
	cursor: pointer;
	text-decoration: none;
}

.mytheme-auth__link:hover {
	color: #c52a2a; /* primary-600 */
	text-decoration: underline;
}

.mytheme-auth__link:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
	border-radius: 2px;
}

.mytheme-auth__link[disabled] {
	color: #CCC;
	cursor: not-allowed;
	text-decoration: none;
}

.mytheme-auth__foot {
	margin: 1.5rem 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid #EDEDED; /* line-soft */
	font-size: 14px; /* caption */
	line-height: 1.5;
	color: #666;
	text-align: center;
}

/* ===== 提示条 ===== */

.mytheme-auth__alert {
	margin: 0 0 1.25rem;
	padding: 0.75rem 0.875rem;
	border: 1px solid #f7cbcb; /* primary-200 */
	border-radius: 0.5rem;
	background: #fdf5f5; /* primary-50 */
	font-size: 14px; /* caption */
	line-height: 1.5;
	color: #9d2222; /* primary-700：正文对比度够 */
}

.mytheme-auth__alert--ok {
	border-color: #DEDEDE;
	background: #F8F8F8; /* surface */
	color: #222;
}

.mytheme-auth__notice {
	margin: 0 0 1.5rem;
	padding: 0.75rem 0.875rem;
	border: 1px dashed #DEDEDE;
	border-radius: 0.5rem;
	font-size: 13px; /* footnote */
	line-height: 1.6;
	color: #666;
}

/* ===== 蜜罐：真人看不见、读屏器跳过、tab 不到 ===== */

.mytheme-auth__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ===== 提交中 ===== */

/*
 * 按钮文案在 loading 时保持不变（设计规范：不要把「登录」换成「登录中…」），
 * 只加一个转圈并禁用，避免用户以为点错了地方。
 */
.mytheme-auth__submit[data-loading='1'] {
	position: relative;
	color: transparent;
	pointer-events: none;
}

.mytheme-auth__submit[data-loading='1']::after {
	content: '';
	position: absolute;
	width: 1rem;
	height: 1rem;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 9999px;
	animation: mytheme-auth-spin 0.6s linear infinite;
}

@keyframes mytheme-auth-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mytheme-auth__card {
		animation: none;
	}

	.mytheme-auth__submit[data-loading='1']::after {
		animation-duration: 2s;
	}

	.mytheme-auth__input {
		transition: none;
	}
}

/* ===== 独立页：藏全站壳，只留居中小卡 ===== */

body.mytheme-auth-standalone {
	background: #f7f7f7;
}

body.mytheme-auth-standalone .app-sidebar,
body.mytheme-auth-standalone .mytheme-page-main > header,
body.mytheme-auth-standalone .mytheme-site-footer,
body.mytheme-auth-standalone #mount-post-panel {
	display: none !important;
}

body.mytheme-auth-standalone .mytheme-page-shell,
body.mytheme-auth-standalone .mytheme-page-main {
	display: block;
	width: 100%;
	min-height: 100vh;
	background: #f7f7f7;
}

body.mytheme-auth-standalone .mytheme-page-main > main {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 2rem 0;
	box-sizing: border-box;
}

body.admin-bar.mytheme-auth-standalone .mytheme-page-main > main {
	min-height: calc(100vh - 32px);
	min-height: calc(100dvh - 32px);
}

.mytheme-auth__close {
	position: fixed;
	top: 1.25rem;
	right: 1.25rem;
	z-index: 20;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 9999px;
	color: #666;
	font-size: 2rem;
	line-height: 1;
	text-decoration: none;
}

.mytheme-auth__close:hover {
	color: #222;
	background: #ededed;
}

.mytheme-auth__close:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
}

body.admin-bar .mytheme-auth__close {
	top: calc(1.25rem + 32px);
}

.mytheme-auth__brand {
	display: flex;
	justify-content: center;
	margin: 0 0 1.25rem;
}

.mytheme-auth__brand img {
	height: 28px !important;
	width: auto;
}

.mytheme-auth [data-auth-screen='identify'] .mytheme-auth__title {
	text-align: center;
	margin-bottom: 1.75rem;
}

.mytheme-auth [data-auth-screen='wechat'] .mytheme-auth__brand {
	margin-bottom: 1.75rem;
}

.mytheme-auth [data-auth-screen='wechat']:has(.wmc-login-box--profile) .mytheme-auth__brand {
	margin-bottom: 1.375rem;
}

/* 扫码同意文案：footnote，强制一行。两个协议名用链接蓝，方便看出能点。 */
.mytheme-auth__consent {
	margin: 16px 0 0;
	font-size: 13px;
	font-weight: 400;
	line-height: 21px;
	text-align: center;
	color: #999;
	white-space: nowrap;
}

@media (max-width: 399px) {
	.mytheme-auth__consent {
		white-space: normal;
	}
}

.mytheme-auth__consent-link {
	color: #1677ff;
	text-decoration: none;
}

.mytheme-auth__consent-link:hover {
	color: #0958d9;
}

.mytheme-auth__consent-link:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
	border-radius: 2px;
}

.mytheme-auth__method {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: fit-content;
	margin: 22px auto 0;
	padding: 6px 20px;
	min-height: 34px;
	border-radius: 9999px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	box-sizing: border-box;
}

.mytheme-auth__method-icon {
	display: block;
	flex-shrink: 0;
}

.mytheme-auth__method-label {
	font-size: 14px;
	font-weight: 500;
	line-height: 22px;
	color: #222;
}

.mytheme-auth [data-auth-screen='wechat']:has(.wmc-login-box--profile) .mytheme-auth__consent,
.mytheme-auth [data-auth-screen='wechat']:has(.wmc-login-box--profile) .mytheme-auth__method {
	display: none;
}

.mytheme-auth__input--pill {
	height: 3rem;
	border: 0;
	border-radius: 9999px;
	background: #f5f5f5;
	padding: 0 1.25rem;
	text-align: center;
}

.mytheme-auth__input--pill:hover {
	background: #f0f0f0;
}

.mytheme-auth__input--pill:focus {
	box-shadow: 0 0 0 2px #222;
}

.mytheme-auth .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mytheme-auth__divider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1.75rem 0 1.25rem;
	font-size: 13px;
	line-height: 1.45;
	color: #999;
}

.mytheme-auth__divider::before,
.mytheme-auth__divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #ededed;
}

.mytheme-auth__social {
	display: flex;
	justify-content: center;
	gap: 1rem;
}

.mytheme-auth__social-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: #f5f5f5;
	cursor: pointer;
}

.mytheme-auth__social-btn:hover {
	background: #ededed;
}

.mytheme-auth__social-btn:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
}
