/* ============================================================
   auth.css — 登录 / 注册页
   ============================================================ */

:root {
  --error: #a83a3a;
}

body { min-height: 100vh; }

/* ============ 布局 ============ */
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ---------- 左侧品牌区 ---------- */
.brand-pane {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.brand-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  position: relative;
  display: inline-block;
  padding: 8px 24px 9px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}

/* 与站内导航一致的细椭圆环 */
.brand-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transform: rotate(-8deg);
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.brand-logo:hover::before {
  border-color: var(--ink-mute);
}

.brand-logo::after {
  content: "ACADEMIC REVIEW";
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-weight: 400;
  margin-top: 2px;
}

.brand-issue {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: right;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.brand-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 0;
  max-width: 480px;
}

.brand-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ink-mute);
}

.brand-headline {
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin-bottom: 32px;
}

.brand-desc {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-soft);
  border-left: 2px solid var(--ink);
  padding-left: 20px;
  margin-bottom: 48px;
}

/* 信条清单 */
.creed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.creed li {
  display: flex;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.creed li:last-child { border-bottom: 1px solid var(--line); }

.creed-num {
  font-size: 0.7rem;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 24px;
  padding-top: 3px;
}

.creed-text {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.creed-text strong {
  color: var(--ink);
  font-weight: 550;
  letter-spacing: -0.005em;
}

.brand-foot {
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 右侧表单区 ---------- */
.form-pane {
  background: var(--bg);
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.form-pane-inner {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.form-back {
  position: absolute;
  top: 48px;
  right: 64px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}

.form-back:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Tab 切换 */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.tab {
  background: none;
  border: none;
  padding: 14px 0;
  margin-right: 40px;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  cursor: pointer;
  position: relative;
  transition: color .15s;
  font-weight: 450;
}

.tab:hover { color: var(--ink-soft); }

.tab.active {
  color: var(--ink);
  font-weight: 550;
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* 表单头 */
.form-head {
  margin-bottom: 32px;
}

.form-head h1 {
  font-size: 1.8rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin-bottom: 10px;
}

.form-head p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-mute);
  letter-spacing: 0.005em;
}

/* 表单字段 */
.field {
  margin-bottom: 24px;
  position: relative;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
  margin-bottom: 8px;
}

.field-label .optional {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 400;
  text-transform: none;
}

.field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 13px 16px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  letter-spacing: 0.005em;
  transition: border-color .15s;
  line-height: 1.4;
}

.field-input::placeholder {
  color: var(--ink-mute);
  font-size: 0.88rem;
}

.field-input:focus {
  outline: none;
  border-color: var(--ink);
}

.field-input.error {
  border-color: var(--error);
}

/* 错误提示 */
.field-error {
  font-size: 0.72rem;
  color: var(--error);
  letter-spacing: 0.02em;
  margin-top: 6px;
  min-height: 1em;
  display: none;
}

.field-error.show { display: block; }

/* 验证码输入 + 发送按钮 */
.code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.code-row .field-input {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

.code-send {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line-strong);
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background-color .15s;
}

.code-send:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
  background: #f5f5f2;
}

.code-send:disabled {
  opacity: .55;
  cursor: default;
}

/* 验证码提示（开发模式会显示本次验证码） */
.code-hint {
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  font-size: 0.74rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  line-height: 1.6;
  word-break: break-all;
}

/* 文本型操作按钮（重发验证码） */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-right: 16px;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}

.link-btn:hover:not(:disabled) {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.link-btn:disabled {
  opacity: .5;
  cursor: default;
}

/* 表单级错误 */
.form-error {
  font-size: 0.75rem;
  color: var(--error);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  display: none;
}

.form-error.show { display: block; }

/* 复选框（同意条款） */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  transition: border-color .15s, background-color .15s;
}

.checkbox-box svg {
  width: 11px;
  height: 11px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  opacity: 0;
  transition: opacity .15s;
}

.checkbox input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked + .checkbox-box svg { opacity: 1; }

.checkbox input:focus-visible + .checkbox-box {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.checkbox-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-soft);
  letter-spacing: 0.005em;
}

.checkbox-text a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-mute);
  transition: border-color .15s;
}

.checkbox-text a:hover { border-bottom-color: var(--ink); }

/* 主按钮 */
.btn-primary {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 15px 24px;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s;
  position: relative;
}

.btn-primary:hover:not(:disabled) { background: var(--accent); }

.btn-primary:disabled {
  background: var(--ink-mute);
  cursor: default;
}

/* 加载态 */
.btn-primary.loading {
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 底部辅助 */
.form-foot {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.7;
}

.form-foot a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-mute);
  transition: border-color .15s;
  margin-left: 4px;
}

.form-foot a:hover { border-bottom-color: var(--ink); }

/* 分隔线 */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 第三方登录（极简） */
.sso {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sso-btn {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 13px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sso-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: #f5f5f2;
}

.sso-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ============ 步骤指示器（注册用） ============ */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.step {
  flex: 1;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  position: relative;
  font-weight: 600;
}

.step-num {
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: background-color .15s, color .15s, border-color .15s;
}

.step.active { color: var(--ink); }
.step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.done { color: var(--ink-soft); }
.step.done .step-num {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: #fff;
}

/* 步骤内容切换 */
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .brand-pane { padding: 40px 48px; }
  .form-pane { padding: 40px 48px; }
  .brand-headline { font-size: 2.2rem; }
  .form-back { top: 40px; right: 48px; }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .brand-pane {
    padding: 32px 24px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    min-height: auto;
  }
  .brand-body {
    padding: 32px 0 0;
    max-width: none;
  }
  .brand-headline { font-size: 1.8rem; margin-bottom: 20px; }
  .brand-desc { font-size: 0.88rem; padding-left: 16px; margin-bottom: 24px; }
  .creed { display: none; }
  .brand-foot { padding-top: 20px; font-size: 0.68rem; }

  .form-pane {
    padding: 40px 24px 56px;
    min-height: auto;
  }
  .form-back {
    top: 24px;
    right: 24px;
  }
  .form-head h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .brand-headline { font-size: 1.5rem; }
  .tabs { margin-bottom: 28px; }
  .tab { margin-right: 28px; font-size: 0.85rem; }
  .sso { grid-template-columns: 1fr; }
  .form-head h1 { font-size: 1.35rem; }
}
