/* /cases/ 첫 방문 튜토리얼 — 코치마크 + 중앙 모달.
   z-index: backdrop 1090 (Bootstrap offcanvas-backdrop=1040, modal=1055, toast=1080 위) */

.bt-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 1090;
  opacity: 0;
  transition: opacity .22s ease;
}
.bt-backdrop.is-open { opacity: 1; }

/* 스포트라이트 — 위치는 JS 가 top/left/width/height 로 박아넣는다.
   box-shadow 로 "구멍 뚫린" 효과: 9999px 의 거대한 shadow 가 화면 전체를 덮고,
   요소 자체는 비어있어 그 부분만 밝게 남는다. */
.bt-spot {
  position: absolute;
  z-index: 1091;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55),
              0 0 0 2px rgba(255, 255, 255, .8);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}

/* 말풍선 — JS 가 top/left 인라인으로 주입. arrow side 는 data-arrow="up|down" */
.bt-tip {
  position: absolute;
  z-index: 1092;
  width: min(92vw, 360px);
  background: #fff;
  border-radius: var(--radius-2xl, 16px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .25);
  padding: 18px 18px 14px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .22s ease, transform .22s ease;
}
.bt-tip.is-open { opacity: 1; transform: translateY(0); }
.bt-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 14px; height: 14px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: -2px -2px 4px rgba(15, 23, 42, .04);
}
.bt-tip[data-arrow="up"]::before   { top: -7px; }
.bt-tip[data-arrow="down"]::before { bottom: -7px; box-shadow: 2px 2px 4px rgba(15, 23, 42, .04); }

/* 중앙 모달 (환영/완료) — 스포트라이트 없이 화면 정중앙 */
.bt-modal {
  position: fixed;
  inset: 0;
  z-index: 1092;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}
.bt-modal-card {
  pointer-events: auto;
  width: min(92vw, 420px);
  background: #fff;
  border-radius: var(--radius-2xl, 16px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
  padding: 28px 24px 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .28s ease, transform .28s ease;
}
.bt-modal.is-open .bt-modal-card { opacity: 1; transform: translateY(0) scale(1); }

.bt-illu {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a365d, #2c5282);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 6px 16px rgba(26, 54, 93, .35);
}
.bt-illu.is-accent { background: linear-gradient(135deg, #d4a017, #b78712); box-shadow: 0 6px 16px rgba(212, 160, 23, .35); }

.bt-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text, #0f172a);
  margin: 0 0 8px;
}
.bt-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-muted, #475569);
  margin: 0 0 16px;
}

.bt-progress {
  display: flex; gap: 6px; justify-content: center;
  margin: 0 0 16px;
}
.bt-progress .dot {
  width: 24px; height: 4px;
  border-radius: 999px;
  background: var(--color-border, #e2e8f0);
  transition: background-color .2s ease, width .2s ease;
}
.bt-progress .dot.is-active { background: var(--color-primary, #1a365d); width: 32px; }
.bt-progress .dot.is-done { background: var(--color-success, #16a34a); }

.bt-actions {
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.bt-tip .bt-actions { justify-content: flex-end; }
.bt-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, transform .08s ease;
}
.bt-btn:active { transform: translateY(1px); }
.bt-btn-primary {
  background: var(--color-primary, #1a365d);
  color: #fff;
}
.bt-btn-primary:hover { background: #143052; }
.bt-btn-ghost {
  background: transparent;
  color: var(--color-text-muted, #475569);
  font-weight: 500;
}
.bt-btn-ghost:hover { color: var(--color-text, #0f172a); }

/* 모바일 — 말풍선 좌우 여백 12px 보장 + 화살표 위치는 JS 가 보정 */
@media (max-width: 640px) {
  .bt-tip { width: min(92vw, 340px); padding: 16px 16px 12px; }
  .bt-modal-card { padding: 24px 20px 18px; }
  .bt-title { font-size: 1.05rem; }
}

/* 접근성 — 키보드 포커스 링 */
.bt-btn:focus-visible {
  outline: 2px solid var(--color-accent, #d4a017);
  outline-offset: 2px;
}

/* prefers-reduced-motion — 트랜지션 제거 */
@media (prefers-reduced-motion: reduce) {
  .bt-backdrop, .bt-spot, .bt-tip, .bt-modal-card {
    transition: none !important;
  }
}
