/* 语伴 · 登录 / 注册页样式 */

:root {
  --color-brand: #6f7ce0;
  --color-brand-soft: #a3acea;
  --color-brand-bg: #eef0fb;
  --gradient-brand: linear-gradient(135deg, #7884e8 0%, #a87bd2 100%);
  --gradient-brand-soft: linear-gradient(135deg, #eef1fc 0%, #f6edfa 100%);

  --color-text: #1f2030;
  --color-text-soft: #5a5c70;
  --color-text-mute: #9295a8;

  --color-border: #ececf1;
  --color-border-strong: #d8d9e3;
  --color-bg-cool: #f4f5fa;
  --color-card: #ffffff;

  --color-bad: #d8595a;
  --color-bad-bg: #fdecec;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 3px rgba(30,32,55,0.04), 0 8px 28px rgba(30,32,55,0.06);
  --shadow-brand: 0 4px 14px rgba(120,132,232,0.30);
  --shadow-brand-hover: 0 6px 20px rgba(120,132,232,0.45);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--color-text);
  background:
    radial-gradient(1200px 700px at 80% -10%, #ede4f6 0%, transparent 65%),
    radial-gradient(1000px 600px at -10% -5%, #e6ebfa 0%, transparent 60%),
    #fdfdff;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.back-link {
  position: fixed; top: 1.2rem; left: 1.5rem;
  color: var(--color-text-soft); font-size: 0.9rem;
  padding: 0.4rem 0.7rem; border-radius: var(--radius-pill);
  transition: var(--transition);
}
.back-link:hover { color: var(--color-brand); background: var(--color-brand-bg); }

/* === 居中卡片 === */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem 2rem;
}
.auth-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 2.2rem;
  width: 100%;
  max-width: 420px;
  animation: pop-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.brand {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-weight: 700; font-size: 1.1rem; letter-spacing: 0.04em;
  margin-bottom: 1.6rem;
}
.brand .logo { font-size: 1.4rem; filter: drop-shadow(0 2px 4px rgba(120,132,232,0.4)); }
.brand .name {
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.auth-card h1 {
  font-size: 1.7rem; line-height: 1.3; letter-spacing: -0.01em;
  font-weight: 700; margin-bottom: 0.5rem;
}
.lead {
  color: var(--color-text-soft); font-size: 0.95rem;
  line-height: 1.6; margin-bottom: 1.8rem;
}
.lead strong { color: var(--color-brand); font-weight: 600; }

/* === 表单 === */
.field { display: block; margin-bottom: 1.1rem; }
.field > span {
  display: block; font-size: 0.88rem; color: var(--color-text-soft);
  margin-bottom: 0.4rem; font-weight: 500;
}
.field input {
  width: 100%; padding: 0.75rem 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit;
  background: #fff; color: var(--color-text);
  transition: var(--transition);
}
.field input:focus {
  outline: none; border-color: var(--color-brand-soft);
  box-shadow: 0 0 0 3px rgba(111,124,224,0.15);
}
.field-hint {
  display: block; color: var(--color-text-mute);
  font-size: 0.78rem; margin-top: 0.3rem;
}

/* 错误展示 */
.error {
  min-height: 1.2em;
  padding: 0;
  color: var(--color-bad); font-size: 0.88rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.error:not(:empty) {
  background: var(--color-bad-bg);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid #f0c1c1;
}

/* === 主按钮 === */
.btn-primary {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand); color: #fff;
  font-weight: 500; font-size: 0.95rem;
  border: none; cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: var(--transition);
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-brand-hover);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none !important; }
.btn-primary.big { padding: 0.95rem 2rem; font-size: 1.05rem; }
.btn-primary.full { display: block; width: 100%; text-align: center; }

.btn-primary .lbl-loading { display: none; }
.btn-primary.loading .lbl-default { display: none; }
.btn-primary.loading .lbl-loading { display: inline; }

/* === 底部链接 === */
.auth-foot {
  margin-top: 1.5rem; padding-top: 1.4rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-soft); font-size: 0.92rem;
}
.auth-foot a {
  color: var(--color-brand); font-weight: 500;
  border-bottom: 1px dashed transparent;
  transition: var(--transition);
}
.auth-foot a:hover { border-bottom-color: var(--color-brand); }

/* 注册同意勾选 */
.agree-row {
  display: flex; align-items: flex-start; gap: 0.55rem;
  margin: 0 0 1.1rem;
  padding: 0.65rem 0.8rem;
  background: var(--color-brand-bg, #eef0fb);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.agree-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin: 3px 0 0;
  accent-color: var(--color-brand, #6f7ce0);
  cursor: pointer;
}
.agree-row span {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-soft, #5a5c70);
}
.agree-row a {
  color: var(--color-brand, #6f7ce0);
  text-decoration: underline;
}
.agree-row a:hover { color: var(--color-text); }

/* === 手机 === */
@media (max-width: 480px) {
  .back-link { top: 0.8rem; left: 0.8rem; font-size: 0.85rem; }
  .auth-shell { padding: 3rem 1rem 1rem; }
  .auth-card { padding: 2rem 1.5rem; }
  .auth-card h1 { font-size: 1.45rem; }
  .lead { font-size: 0.92rem; }
}
