/* 짐구독 앱 체험하기 — 모바일 전용
   위: 앱 화면이 휴대폰 폭에 꽉 차게 (Figma 430 폭 → zoom), 아래: 체험 안내 카드 */
/* 짐서폿 공식 홈페이지 토큰 (gymss.co.kr :root) */
:root {
  --blue: #1667FF;
  --blue-deep: #0B4FD6;
  --blue-tint: #EAF1FF;
  --ink: #172238;
  --line: #DDE3EB;
  --mute: #8590A3;
  --navy: #0E1B33;
  --orange: #FF6A13;
  --orange-tint: #FFF1E8;
  --paper: #F4F6F9;
  --sub: #55627A;
  --white: #FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--navy);
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- 전체 틀: 화면 높이에 딱 맞춤 (PC 로 열면 가운데 휴대폰 폭) ---------- */
.m-root {
  position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  background: var(--white);
}

/* ---------- 앱 화면 ---------- */
.m-screen { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #fff; }
/* Figma 430 폭 그대로, app.js 에서 zoom 으로 화면 폭에 맞추고 높이는 남은 공간 */
.app { position: absolute; left: 0; top: 0; width: 430px; }
#view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
#view::-webkit-scrollbar { display: none; }
#content { position: relative; width: 430px; }
#content.fade { animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 터치 유도: 파란 링 (화면 요소 위에 겹침, Figma px 단위) */
.gs-ring, .ov > .gs-ring { position: absolute; pointer-events: none !important; z-index: 50; }
.gs-ring::after {
  content: ""; position: absolute; inset: -6px; border-radius: inherit;
  border: 4px solid var(--blue);
  animation: ring 1.3s ease-out infinite;
}
@keyframes ring {
  0% { opacity: 1; transform: scale(.96); box-shadow: 0 0 0 0 rgba(22, 103, 255, .45); }
  70% { opacity: .9; transform: scale(1.02); box-shadow: 0 0 0 14px rgba(22, 103, 255, 0); }
  100% { opacity: 0; transform: scale(1.04); }
}
/* 선택하기 버튼: Figma 두 상태(글자 white / #F37021) 번갈아 점멸 */
.gs-blink, .gs-blink * { animation: blinkWO .9s steps(1, end) infinite !important; }
@keyframes blinkWO { 0% { color: #fff; } 50% { color: #F37021; } }

/* 오버레이 (Alert / 고정 상태바) */
.ov { position: absolute; inset: 0; pointer-events: none; }
.ov > * { pointer-events: auto; }
.ov > .dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .25); animation: fadeIn .2s ease; }
.ov > .alert { position: absolute; animation: pop .22s ease; }
.ov > .sbfix { position: absolute; left: 0; top: 0; width: 430px; height: 59px; overflow: hidden; pointer-events: none; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* 아래로 내려보세요 (결제 확인 화면) */
.scroll-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 8px 18px -8px rgba(22, 103, 255, .8);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.scroll-hint::after { content: ""; width: 7px; height: 7px; margin-top: -4px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); animation: bounce 1s infinite; }
.scroll-hint.on { opacity: 1; }
@keyframes bounce { 50% { translate: 0 3px; } }

/* ---------- 아래 안내 카드 ---------- */
.m-card {
  position: relative; flex: 0 0 auto; z-index: 2;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--navy); color: var(--white);
  box-shadow: 0 -10px 24px -14px rgba(14, 27, 51, .55);
}
.m-head { display: flex; align-items: center; gap: 8px; }
.m-head .badge {
  flex: 0 0 auto; padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #8FB4FF; font-size: 11px; font-weight: 800;
}
.steps { list-style: none; flex: 1 1 auto; display: flex; justify-content: center; gap: 6px; }
.steps button {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .55); font-size: 12px; font-weight: 800;
}
.steps li.done button { background: rgba(255, 255, 255, .85); color: var(--navy); }
.steps li.done button span { display: none; }
.steps li.done button::before { content: "✓"; font-size: 12px; }
.steps li.on button { background: var(--blue); color: #fff; box-shadow: 0 0 0 3px rgba(22, 103, 255, .35); }
.fold {
  flex: 0 0 auto; width: 32px; height: 32px; margin-right: -6px; border-radius: 50%;
  display: grid; place-items: center;
}
.fold::before {
  content: ""; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid rgba(255, 255, 255, .7); border-bottom: 2px solid rgba(255, 255, 255, .7);
  transform: rotate(45deg); transition: transform .2s, margin .2s;
}
.m-card.folded .fold::before { transform: rotate(-135deg); margin-top: 4px; }

.m-body { margin-top: 10px; }
.m-card.folded .m-body { display: none; }
.m-label { font-size: 12px; font-weight: 700; color: #8FB4FF; display: flex; align-items: center; gap: 6px; }
.m-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8FB4FF; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.m-text { margin-top: 6px; font-size: 16px; line-height: 1.5; font-weight: 600; word-break: keep-all; }
.m-text b { color: #FFB27A; font-weight: 800; }
.m-actions { display: flex; gap: 8px; margin-top: 12px; }
.m-actions:empty { display: none; }
.m-actions button {
  flex: 1; padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 800;
  background: var(--white); color: var(--navy);
}

/* ---------- 입장 방법 (QR 화면): 카드 안에 출입기 스캔 움직임 ----------
   Figma '입장 방법'(673x788) 레이어 위치를 % 로 배치 */
.m-guide:empty { display: none; }
.m-guide { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.scan { position: relative; flex: 0 0 auto; width: 128px; aspect-ratio: 673 / 788; background: #fff; border-radius: 12px; overflow: hidden; container-type: inline-size; }
.scan .sc-gate { position: absolute; left: 0; top: 19.97%; width: 99.97%; }
.scan .sc-phone {
  position: absolute; left: 12.71%; top: 8.38%; width: 43.09%;
  mix-blend-mode: multiply; /* 핸드폰 이미지의 흰 배경을 지움 */
  transform: translate(-16%, -22%) rotate(-12deg); opacity: 0;
}
.scan.play .sc-phone { animation: phoneIn 2.1s cubic-bezier(.3, .7, .3, 1) forwards; }
@keyframes phoneIn {
  0%   { transform: translate(-16%, -22%) rotate(-12deg); opacity: 0; }
  18%  { transform: translate(-16%, -22%) rotate(-12deg); opacity: 1; }
  70%  { transform: translate(0, 0) rotate(0); opacity: 1; }
  80%  { transform: translate(2%, 4%) rotate(1deg); opacity: 1; }
  88%  { transform: translate(1%, 2%) rotate(0); opacity: 1; }
  100% { transform: translate(1%, 2%) rotate(0); opacity: 1; }
}
/* 출입기 파란 라이트 번쩍 */
.scan .sc-led {
  position: absolute; left: 12.5%; top: 49.5%; width: 34%; height: 9%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(80, 170, 255, .95), rgba(22, 103, 255, 0));
  mix-blend-mode: screen; opacity: 0;
}
.scan.play .sc-led { animation: led .5s ease-out 1.7s 3 both; }
@keyframes led { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
/* 스캔 파동 (리더 위치) */
.scan .sc-wave {
  position: absolute; left: 46.8%; top: 43%; width: 8%; aspect-ratio: 1; margin: -4% 0 0 -4%;
  border-radius: 50%; border: 2px solid var(--blue); opacity: 0;
}
.scan.play .sc-wave { animation: wave 1s ease-out 1.65s 2 both; }
.scan.play .sc-wave.w2 { animation-delay: 1.95s; }
@keyframes wave { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(5); } }
/* 삐빅! 말풍선 */
.scan .sc-beep {
  position: absolute; left: 56%; top: 20%; padding: .35em .7em; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 10cqw; font-weight: 900; letter-spacing: -0.02em;
  opacity: 0; transform: scale(.4); box-shadow: 0 8px 18px -8px rgba(22, 103, 255, .8);
}
.scan.play .sc-beep { animation: beepPop .5s cubic-bezier(.3, 1.6, .5, 1) 1.7s both, shake .12s linear 1.75s 4; }
@keyframes beepPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes shake { 50% { translate: 2px -1px; } }
/* Figma 텍스트: Noto Sans KR Bold 34 / #191919, 가운데 x 336.5, y 683 */
.scan .sc-cap {
  position: absolute; left: 0; right: 0; top: 86.68%; margin: 0;
  font-family: "Noto Sans KR", sans-serif; font-weight: 700; font-size: 5.05cqw; line-height: normal;
  color: #191919; text-align: center; letter-spacing: 0;
}
.sc-status { flex: 1; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); font-size: 14px; line-height: 1.45; font-weight: 700; color: rgba(255, 255, 255, .8); word-break: keep-all; transition: background .3s, color .3s; }
.m-guide.done .sc-status { background: var(--blue); color: #fff; }
.sc-status b { font-weight: 900; }
