/* ==========================================================================
   TWBR 全域管理員權限守衛樣式 (auth-guard.css)
   僅允許白名單授權管理員查閱內部技術規範與評鑑系統；公眾訪客僅開放 /petition
   ========================================================================== */

/* 嚴格防護：未通過白名單驗證前，完全隱藏頁面任何 DOM 內容，杜絕內容外洩與閃爍 */
html.auth-locked body {
  display: none !important;
}

body.auth-locked {
  overflow: hidden !important;
}

/* 全螢幕權限攔截閘道遮罩 (若有需要獨立彈窗備用) */
.admin-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.admin-auth-modal {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: authModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes authModalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-header {
  background: linear-gradient(135deg, #0f294a 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 24px 24px 20px;
  text-align: center;
}

.auth-emblem {
  font-size: 38px;
  margin-bottom: 8px;
  display: inline-block;
}

.auth-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.auth-title {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 6px;
  color: #ffffff;
}

.auth-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.5;
}

.auth-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* 公開導向引導卡片 (訪客首選) */
.public-redirect-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.public-redirect-text {
  font-size: 13px;
  color: #166534;
  margin: 0 0 10px;
  line-height: 1.5;
}

.btn-public-petition {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #16a34a;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.btn-public-petition:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 10px;
}

/* 登入成功後，內部頁面頂部管理員認證與快捷導覽列 */
.admin-verified-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(59, 130, 246, 0.5);
  border-radius: 999px;
  padding: 6px 16px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: fadeInDownBar 0.3s ease;
  max-width: min(1160px, 96vw);
  box-sizing: border-box;
}

@keyframes fadeInDownBar {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.admin-bar-main {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
  flex-wrap: wrap;
  justify-content: center;
}

.admin-verified-tag {
  color: #86efac;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: clamp(11px, 1.1vw, 12px);
}

.admin-verified-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-bar-link {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.admin-bar-link:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.btn-admin-logout {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-admin-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

@media (max-width: 768px) {
  .admin-verified-bar {
    border-radius: 12px;
    padding: 6px 10px;
    top: 6px;
  }
}
