/* ===== auth 弹窗视觉升级，仅新增/覆盖，不改变现有变量含义 ===== */

:root {
  /* 沿用既定决策：44px 触控目标做成变量，而不是散落硬编码 */
  --touch-target: 44px;
}

.auth-panel {
  width: min(720px, 100%);
  padding: 0;
  overflow: hidden;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* 装饰侧栏：桌面端两栏，移动端隐藏 */
.auth-decor {
  display: none;
}

.auth-main {
  padding: 26px 26px 30px;
}

@media (min-width: 761px) {
  .auth-layout {
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  }
  .auth-decor {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 20px;
    background:
      linear-gradient(160deg, var(--mint) 0%, var(--soft) 100%);
    border-right: 1px solid var(--line);
  }
  .auth-main {
    padding: 30px 30px 32px;
  }
}

.auth-decor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(20, 62, 42, .08);
}

.auth-decor-title {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
}

.auth-decor-cards {
  display: grid;
  gap: 10px;
}

.auth-decor-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 6px 16px rgba(20, 62, 42, .06);
}

.auth-decor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.auth-decor-icon-orange { background: #fdf1e6; color: #d78339; }
.auth-decor-icon-green { background: var(--mint); color: var(--green-dark); }

.auth-decor-card-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.auth-decor-card-sub {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.auth-decor-footer {
  margin: 0;
  font-size: 12px;
  color: var(--green-dark);
  font-weight: 600;
}

/* 表单区域微调：统一触控目标、更明显的 focus 反馈 */
.auth-panel #loginTitle {
  margin: 0 0 18px;
  font-size: clamp(28px, 6vw, 40px);
}

.auth-tab {
  min-height: var(--touch-target);
}

.auth-channel-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: -4px 0 14px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--line);
}

.auth-channel-switch.hidden {
  display: none;
}

.auth-channel-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-channel-switch button.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 3px 10px rgba(20, 62, 42, .1);
}

.auth-panel input {
  min-height: var(--touch-target);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-panel input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 148, 96, .14);
}

.auth-submit-row .button,
#sendSmsCode,
#sendResetCode {
  min-height: var(--touch-target);
}

.auth-submit-row.single-action .button {
  flex: 1 1 100%;
}

.password-toggle {
  width: var(--touch-target);
  height: var(--touch-target);
}

/* 移动端安全高度，弹窗内容区不被系统栏遮挡 */
@media (max-width: 760px) {
  #loginClose {
    width: var(--touch-target);
    height: var(--touch-target);
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    padding: 0;
    display: grid;
    place-items: center;
  }
  #loginModal {
    padding: 0;
  }
  #loginModal > .auth-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  #loginModal .auth-layout {
    flex: 1;
    overflow-y: auto;
  }
  #loginModal .auth-main {
    padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
  }
}
