/**
 * 登录页 / 注册页（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;
}

.mytheme-auth__card {
	width: 100%;
	max-width: 27.5rem; /* 440px：单栏表单的舒适阅读宽度 */
	padding: 2rem 1.75rem 1.75rem;
	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__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;
}

/* 验证码：等宽 + 字距，便于核对 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;
	}
}
