/* =========================================================================
   onboarding.css - 첫 방문 스플래시 / 가이드 투어 / 팝업창(프로모션)
   ※ dlgFade, dlgPop 애니메이션은 app-ui.css 에 있으므로 app-ui.css 와 함께 불러와야 해요.
   짝꿍 스크립트: assets/js/onboarding.js
   ========================================================================= */

/* =====================================================
   첫 방문 스플래시 (로고 애니메이션)
   ===================================================== */
#introSplash {
  position: fixed; inset: 0; z-index: 100002;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #F2F8FF 0%, #FFFFFF 55%, #EAF3FF 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
  cursor: pointer;
}
#introSplash.is-leaving { opacity: 0; visibility: hidden; }
.splash-logo-wrap { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.splash-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(49, 130, 246, 0.4);
  animation: splashRing 1.8s ease-out infinite;
}
.splash-ring.r2 { animation-delay: 0.6s; }
.splash-logo {
  position: relative; width: 96px; height: 96px; object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(49, 130, 246, 0.28));
  animation: splashPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) both, splashFloat 2.6s 0.8s ease-in-out infinite;
}
.splash-title {
  margin: 24px 0 0; font-size: 1.75rem; font-weight: 900; letter-spacing: -0.03em; color: #191F28;
  opacity: 0; transform: translateY(12px); animation: splashUp 0.6s 0.45s ease forwards;
}
.splash-sub {
  margin: 8px 0 0; font-size: 0.9375rem; font-weight: 600; color: #6B7684; word-break: keep-all; text-align: center; padding: 0 24px;
  opacity: 0; transform: translateY(12px); animation: splashUp 0.6s 0.75s ease forwards;
}
.splash-bar { width: 140px; height: 4px; border-radius: 99px; background: #E5E8EB; margin-top: 34px; overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: #3182F6; animation: splashBar 2s 0.1s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.splash-skip {
  position: absolute; right: 20px; top: calc(16px + env(safe-area-inset-top, 0px));
  border: 0; background: rgba(25, 31, 40, 0.06); color: #6B7684;
  font-size: 0.8125rem; font-weight: 800; padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
@keyframes splashPop { 0% { opacity: 0; transform: scale(0.4) rotate(-14deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes splashFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes splashRing { 0% { transform: scale(0.85); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes splashUp { to { opacity: 1; transform: none; } }
@keyframes splashBar { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  #introSplash *, #introSplash { animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}

/* =====================================================
   가이드 투어 (스포트라이트)
   ===================================================== */
#tourLayer { position: fixed; inset: 0; z-index: 100001; display: none; }
#tourLayer.is-open { display: block; }
#tourHole {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(25, 31, 40, 0.68), 0 0 0 3px rgba(255, 255, 255, 0.95) inset;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1), top 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
#tourTip {
  position: fixed; width: min(330px, calc(100vw - 24px)); height: auto;
  background: #fff; border-radius: 24px; padding: 18px 18px 16px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
  animation: dlgPop 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#tourTip.is-center { inset: 0; margin: auto; height: fit-content; padding: 28px 22px 18px; text-align: center; }
.tour-close {
  position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border: 0; border-radius: 999px;
  background: #F2F4F6; color: #6B7684; font-size: 0.8rem; cursor: pointer;
}
.tour-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; background: #E8F3FF; color: #3182F6; display: flex; align-items: center; justify-content: center; }
.tour-icon svg { width: 32px; height: 32px; }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tour-count { font-size: 0.75rem; font-weight: 800; color: #3182F6; background: #E8F3FF; padding: 3px 9px; border-radius: 999px; }
.tour-skip { border: 0; background: transparent; color: #8B95A1; font-size: 0.75rem; font-weight: 800; cursor: pointer; padding: 4px 6px; }
.tour-title { margin: 0; font-size: 1.0625rem; font-weight: 800; color: #191F28; line-height: 1.4; word-break: keep-all; }
.tour-title--center { font-size: 1.25rem; }
.tour-desc { margin: 6px 0 0; font-size: 0.875rem; font-weight: 500; color: #4E5968; line-height: 1.65; word-break: keep-all; }
.tour-desc--center { color: #6B7684; }
.tour-points { list-style: none; margin: 16px 0 0; padding: 14px 16px; background: #F9FAFB; border-radius: 16px; text-align: left; }
.tour-points li { display: flex; align-items: center; gap: 12px; font-size: 0.8125rem; font-weight: 700; color: #333D4B; line-height: 1.5; padding: 6px 0; }
.tour-pt-ico { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tour-pt-ico svg { width: 17px; height: 17px; }
.tour-pt-ico.is-blue { background: #E8F3FF; color: #3182F6; }
.tour-pt-ico.is-green { background: #E8FAF0; color: #00C471; }
.tour-pt-ico.is-purple { background: #F3EEFF; color: #7B5CF0; }
.tour-pt-ico.is-orange { background: #FFF3E5; color: #F59F00; }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 0; }
.tour-dots--center { justify-content: center; }
.tour-dot { width: 6px; height: 6px; border-radius: 999px; background: #D1D6DB; transition: all 0.2s ease; }
.tour-dot.is-on { width: 18px; background: #3182F6; }
.tour-btns { display: flex; gap: 8px; margin-top: 16px; }
.tour-btn { flex: 1; height: 46px; border: 0; border-radius: 14px; font-size: 0.9rem; font-weight: 800; cursor: pointer; transition: background-color 0.15s ease, transform 0.1s ease; }
.tour-btn:active { transform: scale(0.97); }
.tour-btn.is-ghost { background: #F2F4F6; color: #4E5968; }
.tour-btn.is-ghost:hover { background: #E5E8EB; }
.tour-btn.is-primary { background: #3182F6; color: #fff; flex: 1.4; }
.tour-btn.is-primary:hover { background: #1B64DA; }

/* =====================================================
   팝업창 (프로모션) - 내용은 PROMO_POPUP 설정값으로 교체
   ===================================================== */
#promoPopup {
  position: fixed; inset: 0; z-index: 100000;
  display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(25, 31, 40, 0.55);
}
#promoPopup.is-open { display: flex; animation: dlgFade 0.2s ease forwards; }
.promo-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: 28px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(25, 31, 40, 0.35);
  animation: dlgPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.promo-visual { position: relative; width: 100%; aspect-ratio: 3 / 2; background: linear-gradient(135deg, #3182F6 0%, #7CB5FF 100%); }
.promo-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.92); font-size: 0.9rem; font-weight: 800; text-align: center; line-height: 1.6;
}
.promo-placeholder small { font-weight: 600; opacity: 0.8; }
.promo-badge {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  background: #fff; color: #3182F6; font-size: 0.6875rem; font-weight: 900; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px;
}
.promo-body { padding: 20px 20px 6px; }
.promo-body h3 { margin: 0; font-size: 1.1875rem; font-weight: 900; color: #191F28; line-height: 1.4; word-break: keep-all; }
.promo-body p { margin: 8px 0 0; font-size: 0.875rem; font-weight: 500; color: #6B7684; line-height: 1.65; word-break: keep-all; }
.promo-cta {
  margin-top: 16px; height: 50px; border-radius: 16px; background: #3182F6; color: #fff;
  display: none; align-items: center; justify-content: center; font-size: 0.9375rem; font-weight: 800; text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.promo-cta:hover { background: #1B64DA; }
.promo-cta:active { transform: scale(0.98); }
.promo-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 14px; }
.promo-foot button { border: 0; background: transparent; font-size: 0.8125rem; font-weight: 700; color: #8B95A1; cursor: pointer; padding: 8px 6px; border-radius: 8px; }
.promo-foot button:hover { background: #F2F4F6; color: #4E5968; }
#promoClose { color: #333D4B; font-weight: 800; }