/* 消防職安活動 輔助樣式表 (嚴格遵循原版設計語言，拒絕廉價感) */

.fire-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 51, 59, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fireFadeIn 0.25s ease-out;
}

@keyframes fireFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fire-modal-card {
  background: #f7f5ee;
  border: 1px solid #d7dedc;
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
  padding: 30px 28px;
  box-shadow: 0 20px 48px rgba(34, 51, 59, 0.18);
  color: #22333b;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  animation: fireSlideUp 0.25s ease-out;
  position: relative;
}

@media (max-width: 480px) {
  .fire-modal-card {
    padding: 24px 20px;
  }
}

@keyframes fireSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fire-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fire-modal-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #22333b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fire-modal-close {
  background: none;
  border: 0;
  font-size: 22px;
  color: #8c9b97;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.fire-modal-close:hover {
  color: #d94730;
  background: #eae6db;
}

.fire-modal-card p.subtitle {
  font-size: 14px;
  color: #566a73;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.fire-form-group {
  margin-bottom: 16px;
}

.fire-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #22333b;
  margin-bottom: 6px;
}

.fire-form-group input[type="text"],
.fire-form-group input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cbd4d2;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  color: #22333b;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fire-form-group input:focus {
  border-color: #d94730;
  box-shadow: 0 0 0 3px rgba(217, 71, 48, 0.15);
}

.fire-consent-group {
  margin: 18px 0 22px 0;
  background: #eeebe1;
  padding: 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #566a73;
}

.fire-consent-group label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.fire-consent-group input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #d94730;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.fire-submit-btn {
  width: 100%;
  background: #d94730;
  color: #fff;
  border: 0;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 71, 48, 0.25);
  transition: background 0.2s, transform 0.1s;
}

.fire-submit-btn:hover {
  background: #bd3522;
}

.fire-submit-btn:active {
  transform: scale(0.98);
}

/* 頂部導航列融入之同仁身分資訊 */
.fire-user-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #566a73;
  margin-right: 8px;
}

.fire-user-badge {
  font-weight: 600;
  color: #22333b;
}

.fire-logout-link {
  color: #8c9b97;
  text-decoration: none;
  font-size: 12px;
  border-bottom: 1px dashed #cbd4d2;
  cursor: pointer;
  transition: color 0.2s;
}

.fire-logout-link:hover {
  color: #d94730;
  border-color: #d94730;
}

/* 原生微狀態指示器 (平時隱形，拒絕廉價感) */
.fire-sync-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
}

.fire-sync-indicator.syncing {
  opacity: 1;
}

.fire-sync-indicator.syncing svg {
  animation: fireSpin 0.8s linear infinite;
  color: #566a73;
}

.fire-sync-indicator.pending {
  opacity: 1;
  color: #efbd43;
  cursor: help;
}

@keyframes fireSpin {
  100% { transform: rotate(360deg); }
}

/* 關卡內部已通關進度記憶橫幅 */
.fire-completed-notice {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  border-radius: 12px;
  padding: 14px 20px;
  margin: 16px auto;
  max-width: 1380px;
  width: 92%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #065f46;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
  animation: fireSlideUp 0.3s ease-out;
}

.fire-completed-notice .notice-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.fire-completed-notice .hub-link {
  background: #10b981;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s;
}

.fire-completed-notice .hub-link:hover {
  background: #059669;
}

/* ============================================================
   FAANG Ambient Capsule HUD (無侵入式微型懸浮膠囊)
   完全不破壞原版遊戲排版、無廉價感、100% 向量 SVG + CSS 微呼吸燈 (絕無 Emoji)
   ============================================================ */

.fire-hud-capsule {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(203, 213, 225, 0.85);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  padding: 5px 14px 5px 12px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  font-size: 13px;
  color: #1e293b;
  line-height: 1;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .fire-hud-capsule {
    top: auto;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    font-size: 12px;
    padding: 6px 12px 6px 10px;
  }
}

.fire-hud-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.fire-hud-back:hover {
  color: #d94730;
}

.fire-hud-back svg {
  width: 12px;
  height: 12px;
  display: block;
}

.fire-hud-sep {
  width: 1px;
  height: 12px;
  background: #cbd5e1;
}

.fire-hud-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: #1e293b;
}

/* 純 CSS 綠色有機微呼吸燈 (絕無 Emoji) */
.fire-hud-beacon {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
}

.fire-hud-beacon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.5;
  animation: fireHudBeaconPulse 2.4s ease-in-out infinite;
}

@keyframes fireHudBeaconPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.fire-hud-status {
  font-size: 11px;
  font-weight: 500;
  color: #059669;
}

/* 通關成就動態展開態 (Dynamic Island Expansion) */
.fire-hud-capsule.success-expanded {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
  transform: translateX(-50%) scale(1.03);
}

.fire-hud-success-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.fire-hud-success-content svg {
  flex-shrink: 0;
}

.fire-hud-return-link {
  margin-left: 6px;
  color: #047857;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}
