/* ════════════════════════════════════════════════════
   🔐 BPE Auth Gate — 与 Boot Splash 风格一致的密码门
   ════════════════════════════════════════════════════ */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Text';
  animation: auth-gate-in 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-gate.unlocked {
  animation: auth-gate-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes auth-gate-in {
  from { opacity: 0; backdrop-filter: blur(0) saturate(100%); }
  to   { opacity: 1; backdrop-filter: blur(28px) saturate(180%); }
}

@keyframes auth-gate-out {
  from { opacity: 1; transform: scale(1); filter: blur(0); }
  to   { opacity: 0; transform: scale(1.04); filter: blur(8px); }
}

/* 背景装饰：网格 + 微粒 */
.auth-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(56, 139, 253, 0.10), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(196, 181, 253, 0.08), transparent 50%),
    linear-gradient(0deg, rgba(255,255,255,0.015) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px) 0 0 / 32px 32px;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 460px;
  max-width: calc(100vw - 48px);
  background: linear-gradient(180deg, rgba(22, 24, 30, 0.92) 0%, rgba(16, 18, 22, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 60px rgba(56, 139, 253, 0.08);
  overflow: hidden;
  animation: auth-card-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 标题栏（macOS 风） ── */
.auth-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
}

.auth-titlebar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.auth-titlebar .dot.red    { background: #ff5f57; }
.auth-titlebar .dot.yellow { background: #febc2e; }
.auth-titlebar .dot.green  { background: #28c840; }

.auth-titlebar .title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  font-weight: 500;
}

/* ── 主体 ── */
.auth-body {
  padding: 36px 36px 28px;
}

.auth-logo {
  display: flex;
  gap: 8px;
  font-size: 42px;
  font-weight: 100;
  letter-spacing: 0.15em;
  line-height: 1;
  margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto;
}
.auth-logo .l-b { color: #388bfd; }
.auth-logo .l-i { color: #00d4ff; }
.auth-logo .l-e { color: #c4b5fd; }

.auth-subtitle {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
  margin-bottom: 26px;
}

.auth-prompt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
}
.auth-prompt .sigil { color: #00d4ff; font-weight: 600; }
.auth-prompt .cmd   { color: rgba(255, 255, 255, 0.78); }
.auth-prompt .arg   { color: #c4b5fd; }

/* ── 输入框 ── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(56, 139, 253, 0.28);
  border-radius: 8px;
  padding: 0 14px;
  height: 46px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-wrap:focus-within {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow:
    0 0 0 3px rgba(0, 212, 255, 0.12),
    0 0 24px rgba(0, 212, 255, 0.12) inset;
}

.auth-input-wrap .lead {
  color: #00d4ff;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  margin-right: 8px;
  user-select: none;
}

.auth-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.18em;
  caret-color: #00d4ff;
  padding: 0;
}
.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.1em;
}

.auth-input-wrap .caret {
  width: 8px;
  height: 16px;
  background: #00d4ff;
  margin-left: 2px;
  animation: auth-caret 1.05s steps(2) infinite;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}
@keyframes auth-caret {
  50% { opacity: 0; }
}

/* ── 提交按钮 ── */
.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.auth-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.32);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
}
.auth-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 2px;
}

.auth-submit {
  background: linear-gradient(135deg, #388bfd 0%, #00d4ff 100%);
  border: none;
  border-radius: 6px;
  color: #061018;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 212, 255, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto;
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
  filter: brightness(1.05);
}
.auth-submit:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* ── 状态栏 ── */
.auth-status {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.06em;
}
.auth-status .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #28c840;
  border-radius: 50%;
  margin-right: 6px;
  animation: auth-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes auth-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #28c840; }
  50%      { opacity: 0.4; box-shadow: 0 0 0 transparent; }
}

/* ── 错误抖动 ── */
.auth-card.error {
  animation: auth-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.auth-card.error .auth-input-wrap {
  border-color: rgba(255, 95, 87, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 95, 87, 0.15), 0 0 24px rgba(255, 95, 87, 0.15) inset;
}
.auth-card.error .auth-input {
  color: #ff8a82;
}
@keyframes auth-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.auth-error-msg {
  margin-top: 10px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  color: #ff8a82;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
  min-height: 14px;
}
.auth-card.error .auth-error-msg {
  opacity: 1;
}

/* 当 auth-gate 在 DOM 时，禁止下面元素滚动 */
html.auth-locked, body.auth-locked {
  overflow: hidden !important;
}
