/* =========================================================
   Bahasa · 独立登录页样式
   设计：左侧品牌渐变区（桌面）+ 右侧表单卡片
   移动端：品牌区折叠为顶部渐变头部
   ========================================================= */
:root {
  --emerald: #10b981;
  --emerald-d: #059669;
  --emerald-l: #34d399;
  --sky: #0ea5e9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius: 16px;
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .28);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 布局 ---------------- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100%;
}

/* ---------------- 左侧品牌区 ---------------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 56px 56px 44px;
  color: #fff;
  background:
    radial-gradient(1000px 520px at -10% -20%, rgba(52, 211, 153, .55), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(14, 165, 233, .55), transparent 58%),
    linear-gradient(150deg, #065f46 0%, #047857 42%, #0f766e 72%, #0e7490 100%);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
/* 装饰光斑 */
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .45;
  z-index: -1;
}
.auth-brand::before {
  width: 380px; height: 380px; right: -110px; top: -90px;
  background: rgba(163, 230, 53, .5);
}
.auth-brand::after {
  width: 420px; height: 420px; left: -140px; bottom: -180px;
  background: rgba(56, 189, 248, .45);
}

.ab-top { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.ab-logo {
  width: 44px; height: 44px; display: grid; place-items: center;
  font-size: 24px; border-radius: 13px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px);
}
.ab-wordmark {
  font-size: 21px; font-weight: 800; letter-spacing: .4px;
  color: #fff;
}

.ab-title {
  margin: 0 0 18px;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -.4px;
}
.ab-title em {
  font-style: normal;
  background: linear-gradient(90deg, #bbf7d0, #a5f3fc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 2px;
}
.ab-sub {
  margin: 0 0 34px;
  max-width: 30em;
  font-size: 14.5px;
  line-height: 1.78;
  color: rgba(255, 255, 255, .82);
}

.ab-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 34em; }
.ab-points li {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px);
}
.ab-points span { grid-row: 1 / span 2; font-size: 20px; align-self: center; }
.ab-points b { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.ab-points small {
  font-size: 12.5px; line-height: 1.55;
  color: rgba(255, 255, 255, .72);
  margin-top: 3px;
}

.ab-foot {
  margin: auto 0 0;
  padding-top: 32px;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .58);
}

/* ---------------- 右侧表单区 ---------------- */
.auth-panel {
  display: grid;
  place-items: center;
  padding: 48px 32px;
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(16, 185, 129, .07), transparent 70%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 404px;
  animation: cardIn .5s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.ac-brand-mobile { display: none; }

.ac-head { margin-bottom: 22px; }
.ac-head h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.ac-head p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* Tabs */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: #eef2f7;
}
.auth-tab {
  position: relative;
  z-index: 1;
  padding: 9px 0;
  border: 0;
  background: transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}
.auth-tab.active { color: var(--emerald-d); }
.tab-ink {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .26s cubic-bezier(.3, .9, .3, 1);
}
.tab-ink.right { transform: translateX(100%); }

/* 表单 */
.auth-form { display: grid; gap: 15px; }
.auth-form[hidden] { display: none; }

.field { display: block; }
.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.field-hint { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--muted); }

.field-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 47px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field-box:focus-within {
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}
.field-box.err { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, .1); }
.field-ico {
  padding: 0 4px 0 13px;
  font-size: 14px;
  opacity: .68;
}
.field-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
}
.field-box input::placeholder { color: #a8b3c2; font-size: 13.5px; }
/* 关闭浏览器自动填充的黄底 */
.field-box input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 60px #fff inset;
  -webkit-text-fill-color: var(--ink);
}

.pw-eye {
  margin-right: 6px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.pw-eye:hover { background: #f1f5f9; color: var(--ink-2); }

.field-ok {
  margin-right: 13px;
  font-size: 13px;
  font-weight: 800;
  color: var(--emerald);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .18s, transform .18s;
}
.field-ok.on { opacity: 1; transform: none; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -3px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 16px; height: 16px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.submit-btn {
  position: relative;
  height: 49px;
  margin-top: 4px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--emerald-l), var(--emerald-d));
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(5, 150, 105, .8);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.submit-btn:hover:not(:disabled) { filter: brightness(1.04); }
.submit-btn:active:not(:disabled) { transform: scale(.985); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; letter-spacing: 0; }
.submit-btn.loading .btn-text { visibility: hidden; }
.submit-btn.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 19px; height: 19px;
  border: 2.5px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-msg {
  min-height: 18px;
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--danger);
}
.form-msg.ok { color: var(--emerald-d); }

/* 密码强度 */
.pw-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin-top: -6px;
}
.pw-meter i {
  height: 4px;
  border-radius: 3px;
  background: #e6ebf2;
  transition: background .25s;
}
.pw-meter span {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.pw-meter[data-strength="1"] i:nth-child(1) { background: #ef4444; }
.pw-meter[data-strength="2"] i:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-strength="3"] i:nth-child(-n+3) { background: #84cc16; }
.pw-meter[data-strength="4"] i { background: var(--emerald); }

.pw-rules {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin: -6px 0 0;
  padding: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.pw-rules li::before { content: "○ "; opacity: .7; }
.pw-rules li.ok { color: var(--emerald-d); }
.pw-rules li.ok::before { content: "● "; }

.auth-closed {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 12.5px;
  line-height: 1.7;
  color: #9a3412;
}
.auth-closed b { display: block; margin-bottom: 2px; }

.ac-foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: #94a3b8;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  padding: 11px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .auth-brand { padding: 44px 38px 34px; }
  .ab-points li { padding: 10px 12px; }
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }

  .auth-panel {
    padding: 0;
    place-items: start center;
    background: #fff;
    min-height: 100%;
  }
  .auth-card {
    max-width: none;
    padding: 0 22px 40px;
  }
  /* 移动端顶部渐变头部 */
  .ac-brand-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 -22px 26px;
    padding: calc(30px + env(safe-area-inset-top)) 22px 30px;
    background:
      radial-gradient(500px 260px at 0% 0%, rgba(163, 230, 53, .45), transparent 62%),
      linear-gradient(135deg, #065f46, #0f766e 60%, #0e7490);
    color: #fff;
  }
  .ac-brand-mobile .ab-logo {
    width: 36px; height: 36px; font-size: 19px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3);
  }
  .ac-brand-mobile .ab-wordmark { font-size: 18px; }
  .ab-tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
    color: rgba(255, 255, 255, .78);
  }

  .ac-head h2 { font-size: 23px; }
  .field-box { height: 50px; }        /* 移动端触控更友好 */
  .submit-btn { height: 51px; }
}

@media (max-width: 380px) {
  .pw-rules { grid-template-columns: 1fr; }
}
