/* BODHI Dashboard · css/auth.css · 登录门（品牌主视觉 + 账号表单）+ 顶栏用户 chip
   ⚠ 层叠顺序 = index.html 里 <link> 的先后，别随手调换。*/

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200; /* 高于 lightbox(100)/picker(160) —— 未登录时谁都别想弹出来 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 52px);
  overflow: auto;
  color: var(--b-text);
  background:
    radial-gradient(circle at 14% 18%, rgb(176 134 66 / .09), transparent 30%),
    var(--b-surface-2);
}
.dark .auth-overlay {
  background:
    radial-gradient(circle at 14% 18%, rgb(201 163 107 / .08), transparent 30%),
    rgb(12 10 9);
}

.auth-shell {
  width: min(1120px, 100%);
  height: min(760px, calc(100vh - clamp(32px, 8vw, 104px)));
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
  overflow: hidden;
  border: 1px solid var(--b-line);
  border-radius: 18px;
  background: var(--b-surface);
  box-shadow: 0 30px 80px -36px rgb(28 25 23 / .46);
}
.dark .auth-shell {
  box-shadow: 0 32px 90px -36px rgb(0 0 0 / .86);
}

.auth-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #1c1917;
}
.auth-visual > picture {
  position: absolute;
  inset: 0;
  display: block;
}
.auth-visual-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 56%;
  transform: scale(1.015);
  animation: auth-image-settle 900ms cubic-bezier(.2, .7, .2, 1) both;
}
.auth-visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(12 10 9 / .38), transparent 32%, transparent 62%, rgb(12 10 9 / .68)),
    linear-gradient(90deg, transparent 72%, rgb(12 10 9 / .18));
}
.auth-brand {
  position: absolute;
  top: clamp(24px, 4vw, 42px);
  left: clamp(24px, 4vw, 44px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.auth-brand img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 3px 12px rgb(0 0 0 / .3));
}
.auth-brand div {
  display: grid;
  gap: 1px;
}
.auth-brand strong {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: .14em;
}
.auth-brand span {
  font-size: 11px;
  color: rgb(231 229 228 / .72);
  letter-spacing: .08em;
}
.auth-visual-copy {
  position: absolute;
  right: clamp(24px, 4vw, 44px);
  bottom: clamp(26px, 4vw, 44px);
  left: clamp(24px, 4vw, 44px);
  color: #fff;
}
.auth-visual-rule {
  display: block;
  width: 42px;
  height: 2px;
  margin-bottom: 14px;
  background: var(--b-gold-soft);
}
.auth-visual-copy p {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.35;
  letter-spacing: .04em;
  text-shadow: 0 2px 18px rgb(0 0 0 / .45);
}
.auth-visual-copy small {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: rgb(231 229 228 / .72);
  letter-spacing: .18em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(42px, 6vw, 76px);
  background: var(--b-surface);
}
.auth-form {
  width: min(360px, 100%);
}
.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  color: var(--b-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
}
.auth-mobile-brand img {
  width: 32px;
  height: 32px;
}
.auth-kicker {
  margin-bottom: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  color: var(--b-gold-deep);
  letter-spacing: .18em;
}
.dark .auth-kicker { color: var(--b-gold-soft); }
.auth-title {
  margin: 0;
  color: var(--b-text);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.035em;
}
.auth-subtitle {
  margin: 10px 0 30px;
  color: var(--b-text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 28px;
  padding: 3px;
  border: 1px solid var(--b-line);
  border-radius: 10px;
  background: var(--b-surface-2);
}
.auth-tab {
  min-height: 34px;
  border-radius: 7px;
  color: var(--b-text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: color var(--b-ease), background var(--b-ease), box-shadow var(--b-ease);
}
.auth-tab:hover { color: var(--b-text); }
.auth-tab.is-active {
  color: var(--b-gold-deep);
  font-weight: 600;
  background: var(--b-surface);
  box-shadow: var(--b-shadow-sm);
}
.dark .auth-tab.is-active { color: var(--b-gold-soft); }

.auth-fields {
  display: grid;
  gap: 16px;
}
.auth-field-group {
  display: grid;
  gap: 7px;
}
.auth-field-group label {
  color: var(--b-text-2);
  font-size: 12px;
  font-weight: 500;
}
.auth-field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--b-surface-2);
}
.auth-field::placeholder { color: var(--b-text-dim); opacity: .72; }
.auth-password-wrap { position: relative; }
.auth-field-password { padding-right: 56px; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 11px;
  translate: 0 -50%;
  padding: 4px;
  border-radius: 5px;
  color: var(--b-text-dim);
  font-size: 11px;
  cursor: pointer;
}
.auth-password-toggle:hover { color: var(--b-gold-deep); }
.dark .auth-password-toggle:hover { color: var(--b-gold-soft); }
.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 22px;
  font-size: 14px;
}
.auth-error {
  min-height: 20px;
  margin-top: 10px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}
.dark .auth-error { color: #fca5a5; }
.auth-note {
  margin: 8px 0 0;
  color: var(--b-text-dim);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

@keyframes auth-image-settle {
  from { opacity: 0; transform: scale(1.045); }
  to { opacity: 1; transform: scale(1.015); }
}

@media (max-width: 820px) {
  .auth-overlay {
    align-items: flex-start;
    padding: 16px;
  }
  .auth-shell {
    height: auto;
    min-height: calc(100vh - 32px);
    grid-template-columns: 1fr;
    grid-template-rows: 230px 1fr;
  }
  .auth-visual-image { object-position: center 54%; }
  .auth-brand { display: none; }
  .auth-visual-copy p { font-size: 23px; }
  .auth-panel { padding: 42px 32px 48px; }
}

@media (max-width: 520px) {
  .auth-overlay { padding: 0; }
  .auth-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    grid-template-rows: 148px 1fr;
  }
  .auth-visual-copy {
    right: 20px;
    bottom: 18px;
    left: 20px;
  }
  .auth-visual-rule { width: 32px; margin-bottom: 8px; }
  .auth-visual-copy p { font-size: 18px; }
  .auth-visual-copy small { display: none; }
  .auth-panel {
    align-items: flex-start;
    padding: 36px 24px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual-image { animation: none; }
}

/* 顶栏用户 chip（main.js 挂在 #refresh-toggle 旁）*/
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: rgb(87 83 78);
  cursor: pointer;
  border: 1px solid rgb(231 229 228);
}
.user-chip:hover { background: rgb(245 245 244); }
.dark .user-chip { color: rgb(168 162 158); border-color: rgb(68 64 60); }
.dark .user-chip:hover { background: rgb(41 37 36); }
.user-chip-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  min-width: 140px;
  padding: 4px;
  border-radius: 8px;
  background: white;
  border: 1px solid rgb(231 229 228);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.15);
  z-index: 60;
}
.dark .user-chip-menu { background: rgb(28 25 23); border-color: rgb(68 64 60); }
.user-chip-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: inherit;
}
.user-chip-menu button:hover { background: rgb(245 245 244); }
.dark .user-chip-menu button:hover { background: rgb(41 37 36); }
