/* PC 登录/注册/找回密码：两栏卡片 + 弹窗（参考 www.wuye.tv，TASK-V2-PC-AUTH-DIALOG）
 * 由 PC RouHomeShell 统一加载；依赖同模板 ys002-rou-tokens.css，深浅主题跟随 html.ys-dark。
 * 结构：.ys2-auth-dialog > __panel > .ys2-auth-card（独立页为 .ys2-auth-page-main > .ys2-auth-card）
 *       .ys2-auth-card > __aside（广告 / 品牌） + __main.ys2-auth（表单，类名沿用 ys2-auth__*）
 * mobile 模板有自己的 ys002-auth.css，本文件不影响移动端。
 */

/* ---------- 弹窗 ---------- */
html.ys2-auth-dialog-open,
html.ys2-auth-dialog-open body {
  overflow: hidden;
}

.ys2-auth-dialog {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 2000;
}

.ys2-auth-dialog__backdrop {
  background: rgba(8, 10, 14, 0.62);
  inset: 0;
  position: absolute;
}

.ys2-auth-dialog__panel {
  animation: ys2-auth-in 0.18s ease-out;
  max-height: calc(100vh - 48px);
  overflow: auto;
  position: relative;
}

@keyframes ys2-auth-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 独立页 ---------- */
.ys2-auth-page-main {
  display: flex;
  justify-content: center;
  padding: 48px 0 64px;
}

/* ---------- 卡片 ---------- */
.ys2-auth-card {
  background: var(--ys2-surface);
  border: 1px solid var(--ys2-line);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-columns: 380px 460px;
  min-height: 540px;
  overflow: hidden;
  width: 840px;
}

.ys2-auth-card.is-page {
  box-shadow: var(--ys2-shadow);
}

.ys2-auth-card *,
.ys2-auth-card *::before,
.ys2-auth-card *::after {
  box-sizing: border-box;
}

.ys2-auth-card__aside {
  background:
    radial-gradient(
      120% 80% at 0% 0%,
      color-mix(in srgb, var(--ys2-accent) 38%, transparent),
      transparent 60%
    ),
    radial-gradient(
      90% 70% at 100% 100%,
      color-mix(in srgb, var(--ys2-accent) 22%, transparent),
      transparent 65%
    ),
    var(--ys2-bg);
  border-right: 1px solid var(--ys2-line);
  min-height: 100%;
  overflow: hidden;
  position: relative;
}

.ys2-auth-card__aside.has-ad {
  background: var(--ys2-bg);
}

.ys2-auth-card__ad,
.ys2-auth-card__ad img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.ys2-auth-card__ad-tag {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  left: 10px;
  line-height: 1;
  padding: 4px 6px;
  pointer-events: none;
  position: absolute;
  top: 10px;
}

.ys2-auth-card__brand {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
}

.ys2-auth-card__logo {
  height: 72px;
  margin: 0 0 18px;
  max-width: 220px;
  object-fit: contain;
}

.ys2-auth-card__brand strong {
  color: var(--ys2-text);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ys2-auth-card__brand p {
  color: var(--ys2-muted);
  font-size: 14px;
  line-height: 1.9;
  margin: 14px 0 0;
}

.ys2-auth-card__main {
  color: var(--ys2-text);
  display: flex;
  flex-direction: column;
  padding: 72px 64px 24px;
  position: relative;
}

.ys2-auth-card__close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ys2-muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
}

.ys2-auth-card__close:hover {
  background: color-mix(in srgb, var(--ys2-text) 8%, transparent);
  color: var(--ys2-text);
}

.ys2-auth-card__close svg {
  height: 22px;
  width: 22px;
}

.ys2-auth-card__back {
  color: var(--ys2-muted);
  font-size: 14px;
  left: 28px;
  position: absolute;
  text-decoration: none;
  top: 24px;
}

.ys2-auth-card__back:hover {
  color: var(--ys2-text);
}

.ys2-auth-card__body {
  flex: 1 1 auto;
}

/* ---------- 表单（类名沿用 ys2-auth__*） ---------- */
.ys2-auth__tabs {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin: 0 0 28px;
}

.ys2-auth__tab {
  background: transparent;
  border: 0;
  color: var(--ys2-muted);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  padding: 0 0 10px;
  position: relative;
}

.ys2-auth__tab.is-active {
  color: var(--ys2-accent);
  cursor: default;
}

.ys2-auth__tab.is-active::after {
  background: var(--ys2-accent);
  border-radius: 2px;
  bottom: 0;
  content: '';
  height: 2px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 20px;
}

.ys2-auth__tab:disabled {
  cursor: not-allowed;
}

.ys2-auth__form {
  display: block;
}

.ys2-auth__field {
  margin: 0 0 14px;
}

/* 参考站只用占位提示，不显示字段标题；保留 label 给读屏 */
.ys2-auth__label {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.ys2-auth__control-wrap {
  align-items: center;
  border: 1px solid var(--ys2-line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  transition: border-color 0.15s ease;
}

.ys2-auth__control-wrap:focus-within {
  border-color: var(--ys2-accent);
}

.ys2-auth__control {
  background: transparent;
  border: 0;
  color: var(--ys2-text);
  flex: 1 1 auto;
  font: inherit;
  font-size: 14px;
  min-width: 0;
  outline: none;
  padding: 12px 0;
}

.ys2-auth__control::placeholder {
  color: var(--ys2-muted);
  opacity: 0.8;
}

.ys2-auth__control:disabled {
  opacity: 0.6;
}

.ys2-auth__control[aria-invalid='true'] {
  caret-color: #e5484d;
}

.ys2-auth__control-wrap:has(.ys2-auth__control[aria-invalid='true']) {
  border-color: #e5484d;
}

.ys2-auth__toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ys2-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px;
}

.ys2-auth__toggle:hover {
  color: var(--ys2-text);
}

.ys2-auth__control-wrap .ys2-auth__link {
  flex: 0 0 auto;
  font-size: 13px;
  white-space: nowrap;
}

.ys2-auth__error {
  color: #e5484d;
  font-size: 12px;
  line-height: 1.5;
  margin: 6px 0 0;
}

.ys2-auth__meta {
  align-items: center;
  color: var(--ys2-muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  margin: 14px 0 0;
}

.ys2-auth__meta.is-end {
  justify-content: flex-end;
  margin-top: 10px;
}

.ys2-auth__check {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
}

.ys2-auth__check input {
  accent-color: var(--ys2-accent);
  height: 14px;
  margin: 0;
  width: 14px;
}

.ys2-auth__link {
  background: transparent;
  border: 0;
  color: var(--ys2-accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
}

.ys2-auth__link:hover {
  text-decoration: underline;
}

.ys2-auth__link:disabled {
  color: var(--ys2-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.ys2-auth__link.is-muted {
  color: var(--ys2-muted);
}

.ys2-auth__link.is-muted:hover {
  color: var(--ys2-text);
}

.ys2-auth__submit {
  background: var(--ys2-accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 18px 0 0;
  min-height: 48px;
  transition:
    filter 0.15s ease,
    opacity 0.15s ease;
  width: 100%;
}

.ys2-auth__submit:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ys2-auth__submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ys2-auth__alert,
.ys2-auth__notice {
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
  padding: 10px 12px;
}

.ys2-auth__alert {
  background: color-mix(in srgb, #e5484d 12%, transparent);
  border: 1px solid color-mix(in srgb, #e5484d 35%, transparent);
  color: #e5484d;
}

.ys2-auth__notice {
  background: color-mix(in srgb, #22c55e 12%, transparent);
  border: 1px solid color-mix(in srgb, #22c55e 35%, transparent);
  color: #16a34a;
}

html.ys-dark .ys2-auth__notice {
  color: #4ade80;
}

.ys2-auth__legal {
  color: var(--ys2-muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 24px 0 0;
  opacity: 0.85;
  text-align: center;
}

/* 注册邮箱第 2 步、找回密码第 2 步的“返回修改邮箱”行（组件内联 margin 覆盖） */
.ys2-auth__meta .ys2-auth__legal {
  margin: 0;
  text-align: left;
}

/* ---------- 窄屏：隐藏左栏，只保留表单 ---------- */
@media (max-width: 920px) {
  .ys2-auth-card {
    grid-template-columns: 1fr;
    min-height: 0;
    width: min(460px, calc(100vw - 32px));
  }

  .ys2-auth-card__aside {
    display: none;
  }

  .ys2-auth-card__main {
    padding: 64px 28px 24px;
  }

  .ys2-auth-page-main {
    padding: 24px 0 40px;
  }
}
