/* ==========================================================================
   Global Auth Modal — 全站统一登录/注册弹窗
   严格 scoped 于 .hy-auth-modal 根（规格 §15），不定义任何无 scope 的
   .modal/.form/.button/input 全局规则。视觉令牌复用 huangye-v2
   style.css 的 :root 变量（--primary / --text / --border …），输入框与
   Google 按钮样式对齐 Auth V3（auth-v3.css：白底 #fff、灰边 #dadce0、
   高 50px、圆角 11px、100% 宽）。
   ========================================================================== */

.hy-auth-modal {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hy-auth-modal[hidden] { display: none; }

.hy-auth-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
	backdrop-filter: blur(2px);
}

.hy-auth-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 460px; /* 规格 §13：Desktop 约 430–480px */
	max-height: 90vh;
	overflow-y: auto; /* 内容过长时 Modal body 自己滚动 */
	background: var(--surface, #fff);
	border-radius: 18px; /* 约 16–20px */
	box-shadow: 0 24px 64px rgba(17, 24, 39, 0.28);
	padding: 34px 36px 28px;
	box-sizing: border-box;
}

.hy-auth-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 0;
	background: transparent;
	color: var(--text-muted, #8a8f98);
	font-size: 26px;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.hy-auth-modal__close:hover {
	background: var(--background, #f6f7f9);
	color: var(--text, #222);
}

.hy-auth-modal__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin-bottom: 18px;
}

.hy-auth-modal__brand-mark {
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--primary, #1769df), #3f8cff);
	display: inline-block;
}

.hy-auth-modal__brand-name {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.2px;
	color: var(--text, #222);
}

.hy-auth-modal__title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.3px;
	text-align: center;
	color: var(--text, #222);
}

.hy-auth-modal__sub {
	margin: 0 0 20px;
	font-size: 13.5px;
	text-align: center;
	color: var(--text-secondary, #5b5f66);
}

/* ------------------------------ 错误区 ------------------------------ */

.hy-auth-modal__errors {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid #f3c2c2;
	border-radius: 11px;
	background: #fdf3f3;
	color: #b3261e;
	font-size: 13.5px;
	line-height: 1.55;
}

.hy-auth-modal__errors[hidden] { display: none; }
.hy-auth-modal__errors ul { margin: 0; padding-left: 18px; }
.hy-auth-modal__errors .notice { background: transparent; border: 0; padding: 0; margin: 0 0 4px; }

/* ------------------------------ Google ------------------------------ */

/* 与 Auth V3（auth-v3.css）同一套 Google 按钮适配：白底 #fff、灰边
   #dadce0、G 图标 20px、高 50px、圆角 11px、100% 宽；只作用于 Modal
   内的按钮，全站其他位置不受影响。覆盖两种形态：
   1) 禁用占位 .hy-auth-google（dev / 提供方未启用时，hy_auth_google_button）
   2) Nextend 官方 .nsl-button（生产启用 Google 提供方后） */

.hy-auth-modal__social .hy-auth-google{
	display:flex;
	align-items:center;
	justify-content:center;
	gap:12px;
	width:100%;
	height:50px;
	margin:0;
	padding:0 16px;
	box-sizing:border-box;
	font-size:15px;
	font-weight:500;
	color:#3c4043;
	background:#fff;
	border:1px solid #dadce0;
	border-radius:11px;
	cursor:pointer;
	transition:background .15s ease,border-color .15s ease;
}

.hy-auth-modal__social .hy-auth-google .google-g{
	flex:0 0 auto;
	width:20px;
	height:20px;
}

.hy-auth-modal__social .hy-auth-google:disabled{
	opacity:.75;
	cursor:not-allowed;
}

.hy-auth-modal__social .nsl-container{
	margin:0;
}

.hy-auth-modal__social .nsl-container .nsl-container-buttons{
	display:block;
}

.hy-auth-modal__social .nsl-container a[data-provider="google"]{
	display:block;
	text-decoration:none;
	box-shadow:none;
}

.hy-auth-modal__social .nsl-container .nsl-button.nsl-button-google{
	display:flex;
	align-items:center;
	justify-content:center;
	gap:12px;
	width:100%;
	height:50px;
	padding:0 16px;
	box-sizing:border-box;
	border:1px solid #dadce0;
	border-radius:11px;
	box-shadow:none;
	color:#3c4043;
	font-size:15px;
	font-weight:500;
	line-height:50px;
	text-align:center;
	transition:border-color .15s ease,box-shadow .15s ease;
}

.hy-auth-modal__social > * { margin-bottom: 0; }

.hy-auth-modal__divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: var(--text-muted, #8a8f98);
	font-size: 12.5px;
}

.hy-auth-modal__divider::before,
.hy-auth-modal__divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border-strong, #dcdfe4);
}

/* ------------------------------ 表单 ------------------------------ */

.hy-auth-modal__form { display: block; }

.hy-auth-modal__field {
	display: block;
	margin-bottom: 14px;
}

.hy-auth-modal__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--text, #222);
}

.hy-auth-modal__field input[type="text"],
.hy-auth-modal__field input[type="email"],
.hy-auth-modal__field input[type="password"] {
	width: 100%;
	height: 50px;
	padding: 0 15px;
	box-sizing: border-box;
	font-size: 15px;
	color: var(--text, #222);
	background: #fff;
	border: 1px solid #dadce0;
	border-radius: 11px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hy-auth-modal__field input:focus {
	border-color: var(--primary, #1769df);
	box-shadow: 0 0 0 3px rgba(23, 105, 223, 0.14);
}

.hy-auth-modal__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 2px 0 18px;
}

.hy-auth-modal__check {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--text-secondary, #5b5f66);
	cursor: pointer;
}

.hy-auth-modal__check input { width: 15px; height: 15px; accent-color: var(--primary, #1769df); }

.hy-auth-modal__link {
	border: 0;
	padding: 0;
	background: none;
	font-size: 13px;
	color: var(--primary, #1769df);
	text-decoration: none;
	cursor: pointer;
}

.hy-auth-modal__link:hover { text-decoration: underline; }

.hy-auth-modal__submit {
	width: 100%;
	height: 50px;
	border: 0;
	border-radius: 11px;
	background: var(--primary, #1769df);
	color: #fff;
	font-size: 15.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.hy-auth-modal__submit:hover { background: var(--primary-hover, #0f55bb); }
.hy-auth-modal__submit:active { transform: translateY(1px); }
.hy-auth-modal__submit[disabled] { opacity: 0.65; cursor: default; }

.hy-auth-modal__switch {
	margin: 18px 0 0;
	text-align: center;
	font-size: 13.5px;
	color: var(--text-secondary, #5b5f66);
}

.hy-auth-modal__switch .hy-auth-modal__link { font-weight: 600; }

/* --------------------------- Mobile bottom sheet --------------------------- */

@media (max-width: 640px) {
	.hy-auth-modal {
		align-items: flex-end;
		padding: 0 16px 16px; /* 规格 §13：左右约 16px */
	}

	.hy-auth-modal__dialog {
		max-width: none;
		max-height: 90vh;
		border-radius: 18px 18px 14px 14px;
		padding: 28px 22px 22px;
	}
}
