/* ==========================================================
   智慧课 · 前台注册登录页
   沿用统一 tokens，视觉与后台登录页保持一致
   ========================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px; color: var(--t2);
  background: var(--brand-grad);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wrap { width: var(--container); max-width: 100%; margin: 0 auto; padding: 0 16px; }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-page::before, .auth-page::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .07); pointer-events: none;
}
.auth-page::before { width: 520px; height: 520px; right: -160px; top: -180px; }
.auth-page::after { width: 380px; height: 380px; left: -120px; bottom: -140px; }

/* ---------- 头部 ---------- */
.auth-head { position: relative; z-index: 1; height: 64px; display: flex; align-items: center; }
.auth-head .wrap { display: flex; align-items: center; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.auth-brand .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
}
.auth-brand .txt { font-size: 19px; font-weight: 600; letter-spacing: 1px; }
.auth-brand .sub { font-size: 12px; opacity: .82; margin-left: 4px; }
.auth-head .back { color: rgba(255, 255, 255, .88); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.auth-head .back:hover { color: #fff; }

/* ---------- 主体卡片 ---------- */
.auth-main { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 16px 44px; }
.auth-card {
  width: 100%; max-width: 960px; background: #fff; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(13, 38, 96, .28);
  display: grid; grid-template-columns: 1fr 430px; overflow: hidden;
}

.auth-side {
  padding: 38px 36px;
  background: linear-gradient(160deg, #f2f8ff 0%, #e6f0ff 100%);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
}
.auth-side h1 { margin: 0 0 10px; font-size: 24px; color: var(--t1); letter-spacing: .5px; }
.auth-side .lead { margin: 0 0 24px; color: var(--t2); line-height: 1.9; font-size: 13.5px; }
.auth-side .lead b { color: var(--brand); font-weight: 600; }
.auth-feat { display: flex; flex-direction: column; gap: 16px; }
.auth-feat .item { display: flex; gap: 12px; align-items: flex-start; }
.auth-feat .ico {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-card);
}
.auth-feat h4 { margin: 1px 0 3px; font-size: 14px; color: var(--t1); }
.auth-feat p { margin: 0; font-size: 12.5px; color: var(--t3); line-height: 1.7; }
.auth-shot { margin-top: auto; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-soft); background: #fff; box-shadow: var(--shadow-card); }
.auth-shot img { width: 100%; height: 118px; object-fit: cover; display: block; }
.auth-shot .cap { padding: 8px 12px; font-size: 12px; color: var(--t3); }

.auth-form { padding: 30px 34px 30px; }

/* ---------- 登录 / 注册 切换 ---------- */
.seg { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 8px; margin-bottom: 20px; }
.seg button {
  flex: 1; height: 34px; border: 0; background: none; border-radius: 6px;
  color: var(--t2); font-size: 14px; cursor: pointer; transition: all .16s;
}
.seg button.active { background: #fff; color: var(--brand); font-weight: 500; box-shadow: var(--shadow-card); }

/* ---------- 登录方式子切换 ---------- */
.way { display: flex; gap: 18px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; }
.way button {
  border: 0; background: none; padding: 0 0 9px; font-size: 13.5px;
  color: var(--t3); cursor: pointer; position: relative;
}
.way button.active { color: var(--brand); font-weight: 500; }
.way button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px;
}

.panel { display: none; }
.panel.active { display: block; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--t2); }
.field .ctrl { position: relative; display: flex; align-items: center; }
.field .ctrl > svg { position: absolute; left: 12px; color: var(--t4); pointer-events: none; }
.field input[type=text], .field input[type=password], .field input[type=tel], .field select {
  width: 100%; height: 42px; padding: 0 12px 0 38px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--t1); transition: border-color .18s, box-shadow .18s;
}
.field select { padding-left: 12px; }
.field input::placeholder { color: var(--t4); }
.field input:focus, .field select:focus {
  border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(45, 140, 240, .14);
}
.field .toggle { position: absolute; right: 10px; border: 0; background: none; color: var(--t4); cursor: pointer; padding: 4px; display: flex; }
.field .toggle:hover { color: var(--primary); }
.field.err input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(237, 64, 20, .12); }
.field .tip { font-size: 12px; color: var(--t4); margin-top: 5px; }

/* 验证码行 */
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-btn {
  flex: none; width: 108px; height: 42px; border-radius: var(--radius);
  border: 1px solid var(--primary); background: #fff; color: var(--primary);
  font-size: 13px; cursor: pointer; transition: all .16s;
}
.code-btn:hover { background: var(--brand-tint); }
.code-btn[disabled] { border-color: var(--line); color: var(--t4); cursor: not-allowed; background: var(--bg-soft); }

/* 协议 */
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--t3); line-height: 1.7; margin: 4px 0 16px; }
.agree input { margin-top: 3px; }
.agree a { color: var(--primary); }

.btn-submit {
  width: 100%; height: 44px; border: 0; border-radius: var(--radius);
  background: var(--brand-grad); color: #fff; font-size: 15.5px; font-weight: 500;
  letter-spacing: 2px; cursor: pointer; transition: filter .18s, transform .12s;
}
.btn-submit:hover { filter: brightness(1.07); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit.ghost { background: #fff; border: 1px solid var(--line); color: var(--t2); }
.btn-submit.ghost:hover { border-color: var(--primary); color: var(--primary); }

.alert { display: none; margin: 0 0 14px; padding: 9px 12px; border-radius: var(--radius); font-size: 13px; background: #fff1f0; color: var(--danger); border: 1px solid #ffccc7; }
.alert.show { display: block; }
.alert.ok { background: #e8f8f0; color: var(--success); border-color: #b7ebcd; }

/* ---------- 注册步骤条 ---------- */
.steps { display: flex; align-items: center; margin: 2px 0 20px; }
.steps .st { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--t4); }
.steps .st i {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--bg-soft); color: var(--t4); font-style: normal; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.steps .st.on { color: var(--brand); font-weight: 500; }
.steps .st.on i { background: var(--brand-grad); color: #fff; }
.steps .st.done i { background: var(--success); color: #fff; }
.steps .st.done { color: var(--t2); }
.steps .line { flex: 1; height: 1px; background: var(--line); margin: 0 10px; }

/* ---------- 微信绑定区 ---------- */
.wx-box { border: 1px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; background: var(--bg-soft); }
.wx-box .qr {
  width: 132px; height: 132px; margin: 0 auto 12px; padding: 8px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 8px;
}
.wx-box .qr svg { width: 100%; height: 100%; display: block; }
.wx-box .t1 { font-size: 13.5px; color: var(--t1); margin-bottom: 4px; }
.wx-box .t2 { font-size: 12.5px; color: var(--t3); margin-bottom: 12px; line-height: 1.7; }
.wx-box .refresh { font-size: 12.5px; color: var(--primary); background: none; border: 0; cursor: pointer; }

.wx-done { display: none; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 10px; background: #e8f8f0; border: 1px solid #b7ebcd; }
.wx-done.show { display: flex; }
.wx-done .av {
  width: 42px; height: 42px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #19be6b, #43d68f); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.wx-done .info { flex: 1; min-width: 0; }
.wx-done .info b { display: block; font-size: 14px; color: var(--t1); }
.wx-done .info span { font-size: 12px; color: var(--t3); word-break: break-all; }
.wx-done button { border: 1px solid var(--line); background: #fff; color: var(--t2); border-radius: 5px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.wx-done button:hover { border-color: var(--danger); color: var(--danger); }

.step-btns { display: flex; gap: 10px; margin-top: 4px; }
.step-btns .btn-submit.ghost { flex: none; width: 94px; letter-spacing: 0; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; top: 26px; transform: translate(-50%, -14px);
  background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow-hover);
  border-radius: var(--radius); padding: 10px 18px; font-size: 13.5px; color: var(--t1);
  display: flex; align-items: center; gap: 9px; opacity: 0; pointer-events: none;
  transition: all .26s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.toast.warn i { background: var(--warning); }
.toast.err i { background: var(--danger); }

.auth-foot { position: relative; z-index: 1; padding: 14px 0 22px; text-align: center; color: rgba(255, 255, 255, .78); font-size: 12.5px; line-height: 1.9; }

/* 注册成功 */
.done-box { text-align: center; padding: 26px 6px 10px; }
.done-box .ok {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 16px;
  background: linear-gradient(135deg, #19be6b, #43d68f); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.done-box h3 { margin: 0 0 8px; font-size: 18px; color: var(--t1); }
.done-box p { margin: 0 0 20px; font-size: 13px; color: var(--t3); line-height: 1.9; }
.done-box .info-card {
  text-align: left; background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 13px 15px; margin-bottom: 20px; font-size: 13px; color: var(--t2); line-height: 2;
}
.done-box .info-card b { color: var(--t1); font-weight: 500; }

@media (max-width: 900px) {
  .auth-card { grid-template-columns: 1fr; max-width: 460px; }
  .auth-side { display: none; }
}
