/* 登录 / 申请试用（UI 方案 1.1）
   左品牌区 + 右表单区整屏分栏；窄屏切换为「品牌头 + 卡片压叠」。
   同时保留旧卡片类（.login-card 等），供 /pending 与兼容跳转页复用。 */

[hidden] { display: none !important; }

/* ---------------- 基础 ---------------- */
.login-body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 旧版登录页的装饰光斑：新的整屏布局不需要，保留给 /pending */
.login-body:not(.auth-body) {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}
.login-body:not(.auth-body)::before,
.login-body:not(.auth-body)::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  pointer-events: none;
}
.login-body:not(.auth-body)::before {
  top: -12vmax;
  left: -8vmax;
  background: radial-gradient(circle, var(--brand-weak), transparent 68%);
  animation: login-float 18s ease-in-out infinite alternate;
}
.login-body:not(.auth-body)::after {
  bottom: -14vmax;
  right: -10vmax;
  background: radial-gradient(circle, #e7f7f1, transparent 68%);
  animation: login-float 22s ease-in-out infinite alternate-reverse;
}
@keyframes login-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-8vmax, -6vmax, 0) scale(1); }
}

/* ---------------- 旧卡片（/pending、兼容页） ---------------- */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-2);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
}
.login-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.login-mark {
  width: 44px; height: 44px; flex: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.login-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-brand h1 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text); }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }

.login-form { display: flex; flex-direction: column; gap: var(--sp-4); }

/* ---------------- 整屏两栏 ---------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* 左：品牌区 */
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(120, 180, 255, .38), transparent 60%),
    radial-gradient(700px 420px at 88% 92%, rgba(80, 255, 210, .16), transparent 62%),
    linear-gradient(135deg, #0b1a3a 0%, #123a8f 46%, #3370ff 100%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 90% at 30% 10%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 30% 10%, #000 30%, transparent 78%);
  pointer-events: none;
}
.brand-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  background: rgba(255, 255, 255, .12);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.brand-name small { display: block; font-size: 12px; font-weight: 400; opacity: .66; margin-top: 2px; }

.brand-main {
  margin-top: auto;
  margin-bottom: auto;
  position: relative;
  z-index: 1;
  max-width: 520px;
}
.brand-title {
  margin: 0;
  font-size: 40px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand-title em { font-style: normal; color: #a9c6ff; }
.brand-sub {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .72);
}
.brand-points { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 14px; }
.brand-points li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: rgba(255, 255, 255, .88);
}
.point-icon {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
}
.point-icon svg { width: 14px; height: 14px; }
.brand-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, .5); }

/* 右：表单区 */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 56px;
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 400px; animation: auth-rise .22s ease-out both; }
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* 分段 tab：白片滑动 */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.auth-tabs__ind {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--elev-1);
  transition: transform .18s ease;
  pointer-events: none;
}
.auth-tabs[data-active="register"] .auth-tabs__ind { transform: translateX(100%); }
.auth-tab {
  position: relative;
  z-index: 1;
  height: 40px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: color .18s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active { color: var(--text); font-weight: 600; }

/* 表单 */
.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .ui-field { gap: 8px; }
.auth-card .ui-field > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.auth-card .ui-input,
.auth-card .ui-select {
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 10px;
}
.auth-card .ui-select { background: var(--surface); }
.auth-card .ui-input:focus,
.auth-card .ui-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, .14);
  outline: none;
}
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.field input,
.field .ui-select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input::placeholder { color: var(--text-disabled); }
.field input:hover { border-color: #bfc5cc; }
.field input:focus,
.field .ui-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, .14);
}
.field--pass { position: relative; }
.field--pass input { padding-right: 46px; }
.login-pass { position: relative; }
.login-pass .ui-input { padding-right: 46px; }
.login-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 8px;
}
.login-eye:hover { color: var(--text); }
.login-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.login-eye svg { width: 18px; height: 18px; }
.login-eye__off { display: none; }
.login-eye.is-on .login-eye__on { display: none; }
.login-eye.is-on .login-eye__off { display: inline; }

.field input[aria-invalid="true"] { border-color: var(--danger); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-remember {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 13px; color: var(--text-2);
  user-select: none; cursor: pointer;
}
.login-remember input { width: 15px; height: 15px; accent-color: var(--brand); }

/* 主按钮 */
.btn-primary,
.login-submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #3f7bff 0%, #2b61e0 100%);
  box-shadow: 0 4px 14px rgba(51, 112, 255, .22);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.btn-primary:hover,
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(51, 112, 255, .28); }
.btn-primary:active,
.login-submit:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(51, 112, 255, .2); }
.btn-primary:disabled,
.login-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary.is-loading,
.login-submit.is-loading { position: relative; color: transparent; }
.btn-primary.is-loading::after,
.login-submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin .7s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }

/* 错误条 */
.alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-weak);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}
.login-error { margin: 0; font-size: 13px; color: var(--danger); }

/* 注册栅格 */
.reg-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.reg-grid .ui-field--full { grid-column: 1 / -1; }
.reg-agree {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; line-height: 1.6; color: var(--text-2);
}
.reg-agree input { margin-top: 2px; accent-color: var(--brand); }

/* 页脚说明 */
.foot-note {
  margin: 20px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
  text-align: center;
}
.foot-note a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot-note a:hover { color: var(--brand); border-bottom-color: var(--brand-weak); }
.login-hint { margin: var(--sp-1) 0 0; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1279px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .brand-title { font-size: 34px; }
  .auth-brand { padding: 48px; }
}
@media (max-width: 1023px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .brand-title { font-size: 28px; }
  .brand-points li { font-size: 13px; }
  .auth-panel { padding: 32px; }
}
@media (max-width: 767px) {
  .auth-shell { display: block; background: var(--bg); }
  .auth-brand {
    padding: 26px 20px 56px;
    border-radius: 0 0 24px 24px;
    min-height: 148px;
  }
  .brand-title { font-size: 24px; }
  .brand-sub, .brand-points, .brand-foot { display: none; }
  .brand-main { margin: 22px 0 0; }
  .auth-panel {
    padding: 0 16px 32px;
    margin-top: -32px;
    background: transparent;
    align-items: flex-start;
  }
  .auth-card {
    max-width: none;
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--elev-3);
  }
  .reg-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-tabs__ind { transition: none; }
  .btn-primary, .login-submit { transition: none; }
  .auth-card { animation: none; }
  .login-body:not(.auth-body)::before,
  .login-body:not(.auth-body)::after { animation: none; }
}

.req { color: #d92d20; font-style: normal; margin-left: 3px; }

.reg-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; grid-column: 1 / -1; }

.pwd-wrap { position: relative; }
.pwd-wrap .ui-input { padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 4px; border: 0; border-radius: 6px;
  background: transparent; color: #8a9099; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.pwd-eye:hover { color: #2f6bff; }
.pwd-eye svg { width: 20px; height: 20px; }

.pwd-eye .eye-off { display: none; }
.pwd-eye:not(.is-on) .eye-on { display: none; }
.pwd-eye:not(.is-on) .eye-off { display: block; }
