/* ============================================================================
   验证码登录注册表单
   沿用站点语言：暖白底、近黑文字、香槟金点缀、直角、发丝线。
   不复刻参考站的深色配色——要的是那套流程，不是那身皮肤。
   ========================================================================= */

.mo-auth {
	max-width: 26rem;
	margin-inline: auto;
	padding: clamp(1.6rem, 4vw, 2.4rem);
	background: #fffdfa;
	border: 1px solid #ece6dd;
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI',
		'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
	color: #33312e;
}

/* ---- 注册 / 登录 切换 ---------------------------------------------------- */
.mo-auth__tabs {
	display: flex;
	gap: 1.6rem;
	margin-bottom: 1.8rem;
	border-bottom: 1px solid #ece6dd;
}

.mo-auth__tab {
	position: relative;
	padding: 0 0 0.85rem;
	font-size: 1.02rem;
	letter-spacing: 0.08em;
	color: #a49b91;
	background: none;
	border: 0;
	cursor: pointer;
	transition: color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-auth__tab::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 100%;
	height: 1px;
	background: #c9a86a;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.mo-auth__tab:hover { color: #6b6560; }

.mo-auth__tab.is-active { color: #17161a; }
.mo-auth__tab.is-active::after { transform: scaleX(1); }

/* ---- 字段 ---------------------------------------------------------------- */
.mo-auth__form { display: flex; flex-direction: column; gap: 1.15rem; }

.mo-auth__field { display: block; }

.mo-auth__label {
	display: block;
	margin-bottom: 0.45rem;
	font-size: 0.74rem;
	letter-spacing: 0.16em;
	color: #a49b91;
}

.mo-auth__input {
	width: 100%;
	height: 2.9rem;
	padding: 0 0.95rem;
	font-size: 0.98rem;
	color: #17161a;
	background: #fff;
	border: 1px solid #e2dad0;
	border-radius: 0;
	transition: border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-auth__input::placeholder { color: #bdb3a7; }

.mo-auth__input:focus {
	outline: none;
	border-color: #c9a86a;
}

/* 验证码一行：输入框 + 行内发送按钮 */
.mo-auth__code-row {
	display: flex;
	align-items: stretch;
	gap: 0.6rem;
}

.mo-auth__code-row .mo-auth__input { flex: 1; min-width: 0; }

.mo-auth__send {
	flex-shrink: 0;
	min-width: 7.4rem;
	padding: 0 1rem;
	font-size: 0.86rem;
	letter-spacing: 0.06em;
	color: #97794a;
	background: transparent;
	border: 1px solid #ddcaa5;
	cursor: pointer;
	transition: color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		background-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-auth__send:hover:not(:disabled) {
	color: #fff;
	background: #97794a;
	border-color: #97794a;
}

.mo-auth__send:disabled {
	color: #bdb3a7;
	border-color: #e8e0d5;
	cursor: default;
}

/* ---- 提交 ---------------------------------------------------------------- */
.mo-auth__submit {
	width: 100%;
	height: 3.1rem;
	margin-top: 0.4rem;
	font-size: 0.98rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	color: #fff;
	background: #17161a;
	border: 1px solid #17161a;
	cursor: pointer;
	transition: background-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-auth__submit:hover:not(:disabled) {
	background: #97794a;
	border-color: #97794a;
}

.mo-auth__submit:disabled { opacity: 0.45; cursor: default; }

/* ---- 状态提示 ------------------------------------------------------------ */
.mo-auth__status {
	margin: 0;
	padding: 0.75rem 0.95rem;
	font-size: 0.86rem;
	line-height: 1.7;
	color: #97794a;
	background: #f6efe2;
	border-left: 2px solid #c9a86a;
}

.mo-auth__status.is-error {
	color: #a4553f;
	background: #f9eeea;
	border-left-color: #c98a72;
}

/* ---- 隐私说明 ------------------------------------------------------------ */
.mo-auth__agree {
	margin: 0;
	font-size: 0.76rem;
	line-height: 1.8;
	color: #a49b91;
}

.mo-auth__agree a {
	color: #8d8375;
	border-bottom: 1px solid #e2dad0;
}

.mo-auth__agree a:hover { color: #97794a; border-bottom-color: #c9a86a; }

/* ---- 字段顺序 -------------------------------------------------------------
   两种模式的字段顺序不同，用 order 排，DOM 只写一份：
     注册：邮箱或手机号 → 安全验证 → 验证码 → 设置密码 → 确认密码
     登录：邮箱或手机号 → 密码 → 安全验证
   登录不发验证码（凭证是密码），滑块只用来挡自动化脚本，因此位置也放在最后。
   ------------------------------------------------------------------------- */
.mo-auth__form { display: flex; flex-direction: column; gap: 1.15rem; }

[data-field='identifier'] { order: 1; }
[data-field='password']   { order: 2; }
[data-field='code']       { order: 3; }
[data-field='captcha']    { order: 4; }
[data-field='confirm']    { order: 5; }
[data-field='extra']      { order: 8; }
.mo-auth__submit          { order: 9; }
.mo-auth__status          { order: 10; }
.mo-auth__agree           { order: 11; }

/* 注册模式：安全验证与验证码顺序对调 */
.mo-auth[data-mode='register'] [data-field='captcha'] { order: 2; }
.mo-auth[data-mode='register'] [data-field='code']    { order: 3; }
.mo-auth[data-mode='register'] [data-field='password'] { order: 4; }

/* 登录模式：不需要确认密码，也不需要验证码；滑块保留 */
.mo-auth[data-mode='login'] [data-field='confirm'],
.mo-auth[data-mode='login'] [data-field='code'] { display: none; }

.mo-auth[data-mode='login'] [data-field='captcha'] { order: 3; }

/* 忘记密码只在登录模式出现 */
[data-field='extra'] { display: none; }
.mo-auth[data-mode='login'] [data-field='extra'] { display: block; }

.mo-auth__extra {
	margin: -0.4rem 0 0;
	font-size: 0.78rem;
	line-height: 1.9;
	text-align: right;
}

.mo-auth__forgot {
	color: #8d8375;
	border-bottom: 1px solid #e2dad0;
	transition: color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-auth__forgot:hover { color: #97794a; border-bottom-color: #c9a86a; }

/* ---- 滑块验证 ------------------------------------------------------------ */
.mo-auth__captcha { display: block; }

.mo-auth__captcha[hidden] { display: none; }

.mo-cap__stage {
	position: relative;
	overflow: hidden;
	margin-bottom: 0.7rem;
	border: 1px solid #e2dad0;
	background: #f6f2ec;
	line-height: 0;
}

.mo-cap__stage[hidden] { display: none; }

.mo-cap__bg { display: block; width: 100%; height: auto; }

.mo-cap__piece {
	position: absolute;
	top: 0;
	left: 0;
	width: 16.25%;   /* 52 / 320，与后端拼图尺寸一致 */
	height: auto;
	cursor: grab;
	box-shadow: 0 2px 8px rgba(23, 22, 26, 0.28);
	touch-action: none;
	user-select: none;
}

.mo-cap__piece:active { cursor: grabbing; }

.mo-cap__refresh {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	padding: 0.2rem 0.55rem;
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	color: #fff;
	background: rgba(23, 22, 26, 0.55);
	border: 0;
	cursor: pointer;
}

.mo-cap__refresh:hover { background: rgba(23, 22, 26, 0.78); }

.mo-cap__track {
	position: relative;
	height: 2.9rem;
	background: #f4f0e9;
	border: 1px solid #e2dad0;
	overflow: hidden;
	touch-action: none;
}

.mo-cap__fill {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: 0;
	background: #f0e4cc;
	border-right: 1px solid #ddcaa5;
}

.mo-cap__hint {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 0.84rem;
	letter-spacing: 0.06em;
	color: #a49b91;
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-cap__track.is-passed .mo-cap__hint { opacity: 0; }

.mo-cap__handle {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	display: grid;
	place-items: center;
	width: 3.1rem;
	color: #97794a;
	background: #fff;
	border: 1px solid #ddcaa5;
	cursor: grab;
	transition: background-color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
		color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mo-cap__handle:hover { background: #fdf8ef; }
.mo-cap__handle:active { cursor: grabbing; }

.mo-cap__track.is-passed .mo-cap__handle {
	color: #fff;
	background: #97794a;
	border-color: #97794a;
}

.mo-cap__track.is-passed .mo-cap__fill { background: #f4ead4; }

/* ---- 登录模式下密码是必填，注册模式下也是必填 --------------------------- */
.mo-auth__field[data-field='password'] .mo-auth__input { display: block; }

/* ---- 页头弹窗里的形态 -----------------------------------------------------
   弹窗自带面板与内边距，表单在这里不必再画一层卡片，否则会出现双层边框。
   表单本身（间距、字段、滑块）不变，只是去掉外壳。
   -------------------------------------------------------------------------- */
#account-modal .mo-auth {
	max-width: none;
	padding: 0;
	background: transparent;
	border: 0;
}

#account-modal .mo-auth__tabs { margin-bottom: 1.4rem; }

/* ---- 窄屏 ----------------------------------------------------------------- */
@media (max-width: 420px) {
	.mo-auth { padding: 1.3rem 1.1rem; }
	#account-modal .mo-auth { padding: 0; }
	.mo-auth__code-row { gap: 0.45rem; }
	.mo-auth__send { min-width: 6.4rem; padding: 0 0.7rem; font-size: 0.8rem; }
	.mo-cap__handle { width: 2.7rem; }
}
