/* auth.css — 점수판 로그인 게이트 오버레이 (Phase 5 / 05-01)
 * --bb-* 디자인 토큰 전용(새 색상 하드코딩 금지). base.css / themes.css 다음에 link.
 * 테마(led/broadcast/neon) 토큰을 그대로 따르므로 오버레이도 현재 테마와 어울린다.
 *
 * 게이트:
 *   [data-auth-gate="control"][data-locked="true"] → pointer-events/user-select 차단(JS가 data-locked 토글).
 *   #auth-overlay → 기본 표시(flex), .hidden 클래스로 숨김(로그인 성공 시 JS가 add).
 */

/* ============ 게이트 잠금 (컨트롤 조작 영역 비활성) ============ */
[data-auth-gate='control'][data-locked='true'] {
  pointer-events: none;
  user-select: none;
  /* 잠금 중 시각적 약화 — 오버레이가 전면을 덮으므로 가벼운 흐림만. */
  filter: blur(1px) saturate(0.7);
}

/* ============ 로그인 오버레이 ============ */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  /* --bb-bg(0b0e14) 기반 반투명 — 테마별 배경색을 받되 충분히 어둡게. */
  background: rgba(11, 14, 20, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--bb-space-5);
  padding: var(--bb-space-6);
}

#auth-overlay.hidden {
  display: none;
}

.auth-panel {
  background: var(--bb-surface);
  border: 1px solid var(--bb-border-strong);
  border-radius: var(--bb-radius);
  padding: var(--bb-space-6);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--bb-shadow);
  display: flex;
  flex-direction: column;
  gap: var(--bb-space-4);
}

.auth-brand {
  text-align: center;
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: calc(-1 * var(--bb-space-2));
}

.auth-title {
  color: var(--bb-accent);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
}

.auth-subtitle {
  color: var(--bb-text-dim);
  font-size: 0.85rem;
  text-align: center;
  margin: calc(-1 * var(--bb-space-2)) 0 var(--bb-space-2);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--bb-space-2);
}

.auth-field label {
  color: var(--bb-text-dim);
  font-size: 0.85rem;
}

.auth-field input {
  background: var(--bb-surface-2);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-sm);
  padding: var(--bb-space-2) var(--bb-space-3);
  color: var(--bb-text);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--bb-transition), box-shadow var(--bb-transition);
}

.auth-field input::placeholder {
  color: var(--bb-text-dim);
  opacity: 0.7;
}

.auth-field input:focus {
  border-color: var(--bb-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.18);
}

#auth-submit {
  background: var(--bb-accent);
  color: #1a1206;
  font-weight: 700;
  font-family: inherit;
  padding: var(--bb-space-3);
  border-radius: var(--bb-radius-sm);
  width: 100%;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: background var(--bb-transition), opacity var(--bb-transition);
}

#auth-submit:hover {
  background: var(--bb-accent-2);
}

#auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#auth-error {
  color: var(--bb-danger);
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

/* ============ 헤더 유저 표시 + 로그아웃 ============ */
#auth-user-label {
  color: var(--bb-text-dim);
  font-size: 0.9rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#btn-logout {
  font-size: 0.85rem;
  padding: var(--bb-space-1) var(--bb-space-3);
}

/* ============ 모바일 ============ */
@media (max-width: 480px) {
  .auth-panel {
    padding: var(--bb-space-4);
    max-width: 100%;
  }
  #auth-user-label {
    max-width: 120px;
  }
}
