/* ============================================================
   登录 / 注册页 —— 极简矢量风
   ============================================================ */

:root {
  --bg:        #F5E6D3;
  --surface:   #FFF6EA;
  --line:      #FFB74D;
  --line-soft: rgba(255, 183, 77, 0.35);
  --brand:     #D84315;
  --brand-lit: #FF6E40;
  --brand-dim: #A08060;
  --ink:       #5A3A28;
  --danger:    #C8503C;
  --ok:        #4C9A5B;
  --radius:    14px;
  --shadow:    0 6px 24px rgba(216, 67, 21, 0.10);
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  min-height: 100dvh;
}

/* 背景上淡淡的几条垄沟，纯装饰 */
.field-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

/* ---------- 品牌区 ---------- */
.brand {
  text-align: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: block;
}

.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--brand);
}

.brand-tagline {
  font-size: 13px;
  color: var(--brand-dim);
  margin-top: 6px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ---------- 分段切换 ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 183, 77, 0.14);
  border-radius: 10px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--brand-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.tab[aria-selected="true"] {
  background: var(--brand-lit);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 110, 64, 0.28);
}

.tab:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-lit);
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line-soft);
  border-radius: 9px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.field input:focus {
  border-color: var(--brand-lit);
  box-shadow: 0 0 0 3px rgba(255, 110, 64, 0.15);
}

.field input:disabled { background: #F4EDE4; cursor: not-allowed; }

.field-hint {
  font-size: 11px;
  color: var(--brand-dim);
  margin-top: 5px;
  line-height: 1.5;
}

/* 密码强度条 */
.pw-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.pw-bars {
  display: flex;
  gap: 3px;
  flex: 1;
}

.pw-bars i {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: rgba(160, 128, 96, 0.22);
  transition: background .2s;
}

.pw-bars[data-score="1"] i:nth-child(-n+1),
.pw-bars[data-score="2"] i:nth-child(-n+2),
.pw-bars[data-score="3"] i:nth-child(-n+3),
.pw-bars[data-score="4"] i:nth-child(-n+4) { background: var(--brand-lit); }

.pw-bars[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.pw-bars[data-score="4"] i { background: var(--ok); }

.pw-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dim);
  min-width: 28px;
  text-align: right;
}

/* 记住我 */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--brand-dim);
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-lit);
  cursor: pointer;
}

/* ---------- 按钮 ---------- */
.btn-submit {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--brand-lit);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 4px 14px rgba(255, 110, 64, 0.3);
}

.btn-submit:hover:not(:disabled) {
  background: #FF5722;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 110, 64, 0.38);
}

.btn-submit:active:not(:disabled) { transform: translateY(0); }

.btn-submit:disabled {
  opacity: .62;
  cursor: progress;
  box-shadow: none;
}

/* ---------- 提示条 ---------- */
.notice {
  display: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.notice.show { display: block; }

.notice.error {
  background: rgba(200, 80, 60, 0.10);
  border: 1px solid rgba(200, 80, 60, 0.32);
  color: var(--danger);
}

.notice.info {
  background: rgba(255, 183, 77, 0.16);
  border: 1px solid var(--line-soft);
  color: var(--brand);
}

.notice.ok {
  background: rgba(76, 154, 91, 0.12);
  border: 1px solid rgba(76, 154, 91, 0.32);
  color: var(--ok);
}

/* ---------- 页脚 ---------- */
.card-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--brand-dim);
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand-lit);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

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

.lang-toggle {
  border: 2px solid var(--line-soft);
  background: #fff;
  color: var(--brand);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color .18s;
}

.lang-toggle:hover { border-color: var(--brand-lit); }

/* 安全说明 */
.security-note {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--brand-dim);
  text-align: center;
  opacity: .85;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 小屏 ---------- */
@media (max-width: 420px) {
  .card { padding: 18px 16px; }
  .brand-mark { width: 54px; height: 54px; }
  .brand-name { font-size: 21px; }
  .field input { height: 40px; font-size: 16px; } /* 16px 防止 iOS 聚焦缩放 */
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
