/* =========================================================================
   Ebook Cloud · 登录 / 注册弹窗
   设计令牌沿用主题：主色 #4338ca → #7c3aed 渐变；柔和底色；圆角 14~18px
   ========================================================================= */

/* ---------- 遮罩与对话框 ---------- */
.es-auth {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.es-auth[hidden] { display: none; }

.es-auth__mask {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .52);
	backdrop-filter: saturate(140%) blur(3px);
	animation: es-auth-fade .22s ease both;
}

.es-auth__dialog {
	position: relative;
	width: 100%;
	max-width: 424px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: 20px;
	padding: 30px 30px 26px;
	box-shadow: 0 30px 70px -28px rgba(15, 23, 42, .55), 0 6px 18px -12px rgba(15, 23, 42, .25);
	animation: es-auth-pop .26s cubic-bezier(.2, .8, .3, 1) both;
}

.es-auth__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 10px;
	background: #f1f5f9;
	color: #475569;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: .16s;
}
.es-auth__close:hover { background: #e2e8f0; color: #0f172a; }

/* ---------- 品牌区 ---------- */
.es-auth__brand {
	display: flex;
	align-items: center;
	gap: 11px;
	margin-bottom: 20px;
}
.es-auth__logo {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #4338ca, #7c3aed);
	color: #fff;
	box-shadow: 0 10px 22px -12px rgba(67, 56, 202, .9);
}
.es-auth__brand strong {
	font-size: 18px;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: -.01em;
}

/* ---------- 标签 ---------- */
.es-auth__tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: #f1f5f9;
	border-radius: 12px;
	margin-bottom: 22px;
}
.es-auth__tabs button {
	flex: 1;
	padding: 10px 0;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: #475569;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: .16s;
}
.es-auth__tabs button.is-active {
	background: #fff;
	color: #4338ca;
	box-shadow: 0 4px 12px -6px rgba(15, 23, 42, .22);
}
.es-auth__tabs button[hidden] { display: none; }

/* ---------- 表单 ---------- */
.es-auth__form { display: none; }
.es-auth__form.is-active { display: block; animation: es-auth-fade .2s ease both; }

.es-auth__field {
	display: block;
	margin-bottom: 14px;
}
.es-auth__field > span {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
}
.es-auth__field input[type="text"],
.es-auth__field input[type="email"],
.es-auth__field input[type="password"] {
	width: 100%;
	height: 46px;
	padding: 0 15px;
	border: 1.5px solid #e2e8f0;
	border-radius: 11px;
	background: #fff;
	font-size: 14.5px;
	color: #0f172a;
	transition: .16s;
}
.es-auth__field input::placeholder { color: #aab3c2; }
.es-auth__field input:focus {
	outline: 0;
	border-color: #6366f1;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}
.es-auth__invite input { background: #fafbff; }

.es-auth__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 2px 0 16px;
	font-size: 13px;
}
.es-auth__remember {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: #475569;
	cursor: pointer;
}
.es-auth__remember input { width: 15px; height: 15px; accent-color: #4338ca; }
.es-auth__lost { color: #6366f1; text-decoration: none; }
.es-auth__lost:hover { text-decoration: underline; }

.es-auth__agree {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 16px;
	font-size: 12.5px;
	line-height: 1.6;
	color: #64748b;
}
.es-auth__agree input { margin-top: 2px; width: 15px; height: 15px; accent-color: #4338ca; flex: 0 0 auto; }
.es-auth__agree a { color: #6366f1; text-decoration: none; }
.es-auth__agree a:hover { text-decoration: underline; }

/* 图形验证码 */
.es-auth__captcha .es-auth__captcha-controls {
	display: flex;
	align-items: stretch;
	gap: 10px;
}
.es-auth__captcha .es-auth__captcha-input {
	flex: 1 1 auto;
	width: auto;
}
.es-auth__captcha-img {
	flex: 0 0 auto;
	width: 100px;
	height: 40px;
	border-radius: 10px;
	border: 1.5px solid #e2e8f0;
	background: #f1f5f9;
	cursor: pointer;
}
.es-auth__captcha-refresh {
	flex: 0 0 auto;
	width: 44px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	background: #fff;
	color: #6366f1;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: .16s;
}
.es-auth__captcha-refresh:hover { background: #eef2ff; border-color: #c7d2fe; }

/* 邮箱验证码 */
.es-auth__mailcode .es-auth__mailcode-controls {
	display: flex;
	align-items: stretch;
	gap: 10px;
}
.es-auth__mailcode .es-auth__mailcode-input {
	flex: 1 1 auto;
	width: auto;
}
.es-auth__mailcode-send {
	flex: 0 0 auto;
	padding: 0 16px;
	border: 1.5px solid #6366f1;
	border-radius: 11px;
	background: #fff;
	color: #6366f1;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: .16s;
}
.es-auth__mailcode-send:hover:not(:disabled) { background: #eef2ff; border-color: #c7d2fe; }
.es-auth__mailcode-send:disabled { opacity: .6; cursor: not-allowed; color: #94a3b8; border-color: #e2e8f0; }
.es-auth__mailcode-status {
	display: block;
	margin-top: 7px;
	font-size: 12.5px;
	line-height: 1.5;
}
.es-auth__mailcode-status.is-ok { color: #16a34a; }
.es-auth__mailcode-status.is-err { color: #dc2626; }

/* 错误提示 */
.es-auth__error {
	margin: 0 0 14px;
	padding: 10px 13px;
	border-radius: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #dc2626;
	font-size: 13px;
	line-height: 1.5;
}
.es-auth__error[hidden] { display: none; }

/* 注册提示语（「用户模块 → 注册提示语」配置，留空则不输出） */
.es-auth__tip {
	margin: 0 0 14px;
	padding: 10px 13px;
	border-radius: 10px;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	color: #4338ca;
	font-size: 12.5px;
	line-height: 1.6;
}

/* 提交按钮 */
.es-auth__submit {
	width: 100%;
	height: 48px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, #4338ca, #7c3aed);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 12px 24px -12px rgba(67, 56, 202, .85);
	transition: .18s;
}
.es-auth__submit:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(67, 56, 202, .9); }
.es-auth__submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ---------- 分割线 ---------- */
.es-auth__divider {
	position: relative;
	text-align: center;
	margin: 22px 0 16px;
}
.es-auth__divider::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: #e8ebf3;
}
.es-auth__divider span {
	position: relative;
	display: inline-block;
	padding: 0 14px;
	background: #fff;
	font-size: 12.5px;
	color: #94a3b8;
}
.es-auth__divider[hidden] { display: none; }

/* ---------- 社交登录 ---------- */
.es-auth__social {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.es-auth__social[hidden] { display: none; }

.es-auth__social-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 46px;
	padding: 0 14px;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	background: #fff;
	color: #475569;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: .16s;
}
.es-auth__social-btn[hidden] { display: none; }
.es-auth__social-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(15, 23, 42, .4); }

.es-auth__social-btn--qq {
	color: #fff;
	background: #12b7f5;
	border-color: #12b7f5;
}
.es-auth__social-btn--qq:hover { background: #0ea6e0; border-color: #0ea6e0; }

.es-auth__social-btn--wechat {
	color: #fff;
	background: #07c160;
	border-color: #07c160;
}
.es-auth__social-btn--wechat:hover { background: #06ad56; border-color: #06ad56; }

/* ---------- 动画 ---------- */
@keyframes es-auth-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes es-auth-pop {
	from { opacity: 0; transform: translateY(14px) scale(.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.es-auth__mask,
	.es-auth__dialog,
	.es-auth__form.is-active { animation: none; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
	.es-auth { padding: 14px; }
	.es-auth__dialog { padding: 24px 20px 22px; border-radius: 16px; }
	.es-auth__social { grid-template-columns: 1fr; }
}
