/* ── BizFlow auth.css — 잠금 화면 ── */

/* ── 오버레이 전체 화면 ── */
#auth-overlay,
#auth-change-panel {
  position: fixed; inset: 0; z-index: 9999;
  background: #0a101e;         /* 단순 단색 (backdrop-filter 제거 — 모바일 렌더링 버그 방지) */
  display: flex; align-items: center; justify-content: center;
  /* 애니메이션 제거: from{opacity:0}로 시작하면 모바일에서 흰 화면으로 보임 */
}
#auth-overlay.auth-success {
  animation: authFadeOut .3s ease forwards;
}
@keyframes authFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── 중앙 박스 ── */
#auth-box {
  width: 100%; max-width: 340px;
  padding: 36px 28px 28px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  /* 박스 애니메이션도 제거: 모바일 렌더링 안정성 */
}
/* 흔들기 */
#auth-box.shake {
  animation: authShake .45s ease;
}
@keyframes authShake {
  0%,100% { transform: translateX(0); }
  15%     { transform: translateX(-8px); }
  30%     { transform: translateX(8px); }
  45%     { transform: translateX(-6px); }
  60%     { transform: translateX(6px); }
  75%     { transform: translateX(-3px); }
  90%     { transform: translateX(3px); }
}

/* ── 로고 ── */
#auth-logo {
  font-size: 20px; font-weight: 800;
  color: #6366f1;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.3px;
}
#auth-logo i { font-size: 18px; }

/* ── 타이틀 ── */
#auth-title {
  font-size: 14px; font-weight: 600;
  color: #94a3b8;
  display: flex; align-items: center; gap: 6px;
}
#auth-title i { color: #6366f1; }

/* ── 입력 도트 4개 ── */
#auth-dots {
  display: flex; gap: 14px; margin: 4px 0;
}
.auth-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: transparent;
  border: 2px solid #475569;
  transition: background .15s, border-color .15s, transform .1s;
}
.auth-dot.filled {
  background: #6366f1;
  border-color: #6366f1;
  transform: scale(1.15);
}

/* ── 메시지 ── */
#auth-msg, .auth-msg-text {
  font-size: 12px; font-weight: 600;
  min-height: 18px; text-align: center;
  color: #94a3b8;
}
#auth-msg.err, .auth-msg-text.err { color: #ef4444; }
#auth-msg.ok,  .auth-msg-text.ok  { color: #10b981; }

/* ── 키패드 ── */
#auth-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.auth-key {
  height: 54px; border-radius: 12px;
  font-size: 20px; font-weight: 700;
  color: #f1f5f9;
  background: #334155;
  border: 1px solid #475569;
  cursor: pointer;
  transition: background .1s, transform .08s;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.auth-key:hover:not(:disabled) { background: #3d4f63; }
.auth-key:active:not(:disabled) {
  background: #6366f1;
  transform: scale(.94);
}
.auth-key:disabled {
  opacity: .3; cursor: not-allowed;
}
.auth-key-empty {
  background: transparent; border: none; cursor: default;
}
.auth-key-empty:hover { background: transparent; }

/* ── 삭제 키 ── */
.auth-key[data-k="del"] {
  font-size: 16px; color: #94a3b8;
}
.auth-key[data-k="del"]:active:not(:disabled) { background: #475569; }

/* ── 푸터 (비밀번호 변경 링크) ── */
#auth-footer {
  width: 100%; text-align: center;
  padding-top: 4px; border-top: 1px solid #334155;
}
.auth-link {
  font-size: 12px; color: #6366f1;
  background: none; border: none;
  cursor: pointer; font-family: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
  opacity: .8; transition: opacity .15s;
}
.auth-link:hover { opacity: 1; }

/* ── 비밀번호 변경 폼 ── */
.auth-form-group {
  width: 100%; display: flex; flex-direction: column; gap: 5px;
}
.auth-form-group label {
  font-size: 11px; font-weight: 600; color: #94a3b8;
}
.auth-form-group input {
  width: 100%; padding: 9px 12px;
  background: #0f172a; border: 1px solid #334155;
  border-radius: 8px; color: #f1f5f9;
  font-size: 13px; font-family: inherit;
  outline: none; transition: border .15s;
}
.auth-form-group input:focus { border-color: #6366f1; }

.auth-change-btns {
  display: flex; gap: 8px; width: 100%;
  padding-top: 4px;
}
.auth-btn-ghost {
  flex: 1; padding: 10px; border-radius: 10px;
  background: #334155; border: 1px solid #475569;
  color: #94a3b8; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .1s;
}
.auth-btn-ghost:hover { background: #3d4f63; }
.auth-btn-primary {
  flex: 1; padding: 10px; border-radius: 10px;
  background: #6366f1; border: none;
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: opacity .15s;
}
.auth-btn-primary:hover { opacity: .88; }

#cp-msg {
  font-size: 12px; font-weight: 600;
  min-height: 16px; text-align: center; width: 100%;
}

/* ── 모바일 최적화 ── */
@media (max-width: 400px) {
  #auth-box { padding: 28px 16px 20px; gap: 14px; }
  .auth-key  { height: 48px; font-size: 18px; }
}


/* ══════════════════════════════════
   기기 승인 대기 화면
══════════════════════════════════ */

/* 전체 오버레이 */
#auth-approval-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: #0a101e;
  display: flex; align-items: center; justify-content: center;
}

/* 중앙 박스 */
#auth-approval-box {
  width: 100%; max-width: 320px;
  padding: 40px 28px 36px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}

/* 로고 */
#auth-approval-logo {
  font-size: 20px; font-weight: 800;
  color: #6366f1;
  letter-spacing: -.3px;
  margin-bottom: 4px;
}

/* 스피너 */
.auth-approval-spinner {
  width: 52px; height: 52px;
  border: 4px solid #334155;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: authSpin 0.9s linear infinite;
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* 아이콘 (denied/error 상태) */
.auth-approval-icon {
  font-size: 48px;
  line-height: 1;
}

/* 타이틀 */
.auth-approval-title {
  font-size: 16px; font-weight: 700;
  color: #f1f5f9;
  margin-top: 4px;
}

/* 본문 메시지 */
.auth-approval-msg {
  font-size: 13px; font-weight: 400;
  color: #94a3b8;
  line-height: 1.6;
}

/* 서브 메시지 (pending 폴링 안내) */
.auth-approval-sub {
  font-size: 11px; color: #475569;
  margin-top: -4px;
}

/* 액션 버튼 */
.auth-approval-action-btn {
  width: 100%; padding: 12px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  margin-top: 4px;
}

/* 모바일 최적화 */
@media (max-width: 400px) {
  #auth-approval-box { padding: 32px 18px 28px; gap: 14px; }
  .auth-approval-spinner { width: 44px; height: 44px; }
  .auth-approval-title { font-size: 15px; }
}
