/* ============================================================
   吉客π.AI自动化 — 登录 / 注册页样式
   依赖 style.css 的 :root token（--accent 等）
   ============================================================ */

/* ---------- 整体双栏骨架 ---------- */
.auth-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- 左栏：品牌视觉区 ---------- */
.auth-brand {
  position: relative;
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 4.5vw, 56px);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #131628 0%, #2a254f 55%, #4a3d8f 100%);
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

/* 紫 / 青 两组光晕 */
.auth-brand::before {
  width: 440px;
  height: 440px;
  top: -160px;
  right: -60px;
  background: radial-gradient(circle, rgba(143, 122, 250, .32) 0%, rgba(143, 122, 250, 0) 70%);
}

.auth-brand::after {
  width: 320px;
  height: 320px;
  left: -80px;
  bottom: -40px;
  background: radial-gradient(circle, rgba(95, 235, 211, .16) 0%, rgba(95, 235, 211, 0) 70%);
}

.auth-logo {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .04em;
}

.auth-logo svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.auth-brand-mid {
  position: relative;
  z-index: 2;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: .22em;
  color: rgba(255, 255, 255, .72);
}

.auth-headline {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.28;
  font-weight: 700;
}

.auth-sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .8);
}

.auth-stats {
  display: flex;
  gap: 40px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.auth-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.auth-stats span {
  font-size: 13px;
  color: rgba(255, 255, 255, .68);
}

.auth-copyright {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
}

/* 毛玻璃悬浮卡装饰 */
.auth-glass {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.auth-glass i {
  display: block;
  border-radius: 8px;
  background: rgba(255, 255, 255, .35);
}

.auth-glass .g-line {
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, .16);
}

.auth-glass .g-btn {
  height: 26px;
  width: 110px;
  background: rgba(109, 92, 246, .55);
}

.auth-glass--lg {
  right: 6%;
  bottom: 12%;
  width: 230px;
}

.auth-glass--lg i:first-child {
  height: 10px;
  width: 120px;
}

.auth-glass--sm {
  right: 12%;
  bottom: -34px;
  width: 180px;
  padding: 16px;
  gap: 10px;
}

.auth-glass--sm i:first-child {
  height: 8px;
  width: 90px;
  background: rgba(255, 255, 255, .3);
}

/* ---------- 右栏：表单区 ---------- */
.auth-panel {
  flex: 1 1 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 60px);
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 24px 60px -28px rgba(109, 92, 246, .35);
}

/* Tab 切换 */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--accent-soft, #f1f0f7);
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s var(--ease), background .2s var(--ease);
}

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

.auth-tab.is-active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 标题组 */
.auth-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.auth-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* 字段 */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.auth-input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.auth-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 92, 246, .12);
}

.auth-input svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: #9aa1ac;
}

.auth-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

.auth-input input::placeholder {
  color: #9aa1ac;
}

/* 验证码行：输入框 + 获取按钮 */
.auth-code {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-code .auth-input {
  flex: 1;
  min-width: 0;
}

.auth-code-btn {
  flex: none;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}

.auth-code-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.auth-code-btn:disabled {
  color: #9aa1ac;
  background: #f6f7f9;
  cursor: not-allowed;
}

/* 密码可见切换 */
.auth-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: -6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9aa1ac;
  cursor: pointer;
}

.auth-eye:hover {
  color: var(--ink-soft);
  background: var(--accent-soft);
}

/* 校验错误态 */
.auth-field.is-error .auth-input {
  border-color: #e5484d;
}

.auth-error {
  display: none;
  font-size: 12px;
  color: #e5484d;
}

.auth-field.is-error .auth-error {
  display: block;
}

/* 由脚本动态显示的错误提示（文案可变） */
.auth-error.is-on {
  display: block;
}

/* 选项行 */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}

.auth-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.auth-check input:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0, -1px);
}

.auth-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

/* 主按钮 */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 12px 24px -12px rgba(109, 92, 246, .55);
}

.auth-btn:hover {
  background: #5b49e8;
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* 提交反馈 */
#loginForm,
#registerForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-msg {
  display: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-msg.is-ok {
  display: block;
  background: #ecfaef;
  color: #1d7a3a;
}

.auth-msg.is-bad {
  display: block;
  background: #fdeeee;
  color: #c6373c;
}

/* 分割线 + 第三方登录 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9aa1ac;
  font-size: 12px;
}

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

.auth-social {
  display: flex;
  gap: 12px;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.auth-social-btn:hover {
  background: var(--accent-soft);
  border-color: #d8d2fb;
}

.auth-social-btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* 底部引导 */
.auth-switch {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -6px 0 0;
  font-size: 12px;
  color: #9aa1ac;
}

.auth-secure svg {
  width: 14px;
  height: 14px;
  color: #7b9f76;
}

/* 条款链接（注册页协议行） */
.auth-terms {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 13px;
  color: #4b5563;
}

/* ---------- 响应式 ---------- */
@media (max-width: 920px) {
  .auth-brand {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .auth-panel {
    padding: 24px 16px;
    align-items: flex-start;
  }

  .auth-panel .auth-card {
    margin-top: 8vh;
  }

  .auth-social {
    flex-direction: column;
  }
}

/* ---------- 右上角关闭按钮：返回首页 ---------- */
.auth-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #14181f;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  transition: transform .18s var(--ease, ease), background .18s var(--ease, ease);
}
.auth-close svg { width: 20px; height: 20px; }
.auth-close:hover { background: #2b3240; transform: scale(1.06); }
.auth-close:active { transform: scale(.96); }
@media (max-width: 720px) {
  .auth-close { top: 14px; right: 14px; width: 38px; height: 38px; }
  .auth-close svg { width: 17px; height: 17px; }
}
