/* 짐서폿 공식 홈페이지 토큰 (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(--white);
  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;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- 1086 x 680 무대 (화면에 맞춰 비례 축소) ---------- */
.fit { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.stage {
  position: relative;
  width: 1086px; height: 680px; flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px 1fr;
  gap: 40px;
  padding: 15px 24px;
  transform-origin: center center;
}

/* ---------- 왼쪽 ---------- */
.side { display: flex; flex-direction: column; min-width: 0; }
.left { padding-top: 12px; }
.brand .badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--blue-tint); color: var(--blue-deep);
  font-size: 13px; font-weight: 700;
}
.brand h1 { margin-top: 12px; font-size: 26px; line-height: 1.3; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); }

.steps { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 6px; }
.steps button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--sub);
  transition: background .2s, color .2s;
}
.steps button:hover { background: var(--paper); }
.steps .num {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--paper); color: var(--mute); font-size: 13px; font-weight: 800;
}
.steps li.done .num { background: var(--navy); color: var(--white); }
.steps li.done .num::before { content: "✓"; }
.steps li.done .num span { display: none; }
.steps li.on button { background: var(--blue-tint); color: var(--navy); font-weight: 800; }
.steps li.on .num { background: var(--blue); color: var(--white); }

.mission {
  margin-top: auto;
  padding: 18px 20px 20px; border-radius: 20px;
  background: var(--navy); color: var(--white);
  box-shadow: 0 20px 40px -24px rgba(14, 27, 51, .6);
}
.m-label { font-size: 13px; font-weight: 700; color: #8FB4FF; display: flex; align-items: center; gap: 6px; }
.m-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8FB4FF; animation: blink 1.4s infinite; }
.m-text { margin-top: 8px; font-size: 17px; 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: 14px; }
.m-actions:empty { display: none; }
.m-actions button {
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 700;
  background: var(--white); color: var(--navy);
}
.m-actions button.ghost { background: rgba(255,255,255,.12); color: var(--white); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- 핸드폰 (공식 홈페이지 .shot 과 동일) ---------- */
.phone-wrap { position: relative; width: 300px; height: 650px; }
.phone-wrap > .shot {
  position: relative; width: 300px; height: 650px;
  border-radius: 46px; border: 9px solid var(--navy);
  overflow: hidden; background: var(--white);
  box-shadow: rgba(14, 27, 51, .45) 0 30px 60px -30px;
}
.scr { position: absolute; inset: 0; overflow: hidden; border-radius: 37px; background: #fff; }
/* 앱 화면: Figma 430x932 그대로, app.js 에서 zoom 으로 632px 높이에 맞춤 */
.app { position: absolute; top: 0; width: 430px; height: 932px; }
#view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; z-index: 0;  /* 화면 안 z-index(탭바 등)가 팝업 위로 올라오지 않게 */
  scrollbar-width: none; -ms-overflow-style: none;
}
#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; z-index: 1; }
.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; right: -66px; bottom: 120px; width: 56px;
  font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; color: var(--blue-deep);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.scroll-hint::after { content: ""; display: block; width: 14px; height: 14px; margin: 8px auto 0; border-right: 3px solid var(--blue); border-bottom: 3px solid var(--blue); transform: rotate(45deg); animation: bounce 1s infinite; }
.scroll-hint.on { opacity: 1; }
@keyframes bounce { 50% { translate: 0 6px; } }

/* ---------- 오른쪽 ---------- */
.right { justify-content: center; }
.right .info-card {
  border-radius: 24px; background: var(--paper); padding: 26px 24px;
  animation: fadeIn .3s ease;
}
.right .info-card .eyebrow { font-size: 13px; font-weight: 800; color: var(--blue-deep); }
.right .info-card h2 { margin-top: 8px; font-size: 22px; line-height: 1.35; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; word-break: keep-all; }
.right .info-card p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--sub); word-break: keep-all; }
.right .info-card ul { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.right .info-card li { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 600; word-break: keep-all; }
.right .info-card li::before { content: ""; flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }


.right .finish h2 { font-size: 24px; }

/* ---------- 좁은 화면 (모바일) ---------- */
body.narrow { overflow: auto; }
body.narrow .fit { position: static; display: block; }
body.narrow .stage {
  width: 100%; height: auto; transform: none !important;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 16px;
}
body.narrow .side { width: 100%; max-width: 420px; }
body.narrow .left { padding-top: 0; }
body.narrow .brand h1 { display: none; }
body.narrow .steps { flex-direction: row; gap: 2px; margin-top: 10px; }
body.narrow .steps li { flex: 1; min-width: 0; }
body.narrow .steps button { flex-direction: column; gap: 4px; padding: 6px 0; font-size: 10.5px; letter-spacing: -0.04em; text-align: center; white-space: nowrap; }
body.narrow .mission { margin-top: 10px; padding: 12px 14px; border-radius: 16px; }
body.narrow .m-label { display: none; }
body.narrow .m-text { margin-top: 0; font-size: 14px; }
body.narrow .m-actions { margin-top: 10px; }
body.narrow .scroll-hint { display: none; }
body.narrow .phone-wrap { order: 2; }
body.narrow .right { order: 3; }
body.narrow .right.guide-on { order: 1; }
body.narrow .right .info-card { padding: 20px; }

/* ---------- 팝업 (바텀시트) ---------- */
.ov > .pop { position: absolute; left: 0; animation: sheetUp .25s ease; }
.ov > .pop > .frame { box-shadow: 0 0 12px rgba(0, 0, 0, .25); }  /* Figma 팝업 그림자 */
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 오른쪽 핸드폰: 회원 앱(짐구독) ---------- */
.right.has-phone { justify-content: center; align-items: center; }
.member-phone { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: fadeIn .3s ease; }
.mp-label { padding: 6px 14px; border-radius: 999px; background: var(--orange-tint); color: var(--orange); font-size: 13px; font-weight: 700; }
.mp-label b { font-weight: 900; margin-right: 4px; }
.mp-phone { position: relative; width: 300px; height: 650px; zoom: .94; }
.mp-phone > .shot {
  position: relative; width: 300px; height: 650px;
  border-radius: 46px; border: 9px solid var(--navy);
  overflow: hidden; background: var(--white);
  box-shadow: rgba(14, 27, 51, .45) 0 30px 60px -30px;
}
.mp-view { position: absolute; inset: 0; overflow: hidden; }
.mp-content { position: relative; width: 430px; }
body.narrow .mp-phone { zoom: .7; }

/* 바뀐 곳 표시 (짐서폿·짐구독 연동): 주황 테두리 깜빡임 + 말풍선 */
.gs-flash { position: absolute; pointer-events: none; z-index: 55; }
.gs-flash::after {
  content: ""; position: absolute; inset: -5px; border-radius: inherit;
  border: 4px solid var(--orange); animation: flash .6s ease-in-out 3;
}
.gs-flash::before {
  content: attr(data-label); position: absolute; left: 50%; bottom: 100%; margin-bottom: 8px;
  padding: 6px 12px; border-radius: 999px; background: var(--orange); color: #fff;
  font: 800 18px/1 Pretendard, "Noto Sans KR", sans-serif; white-space: nowrap;
  transform: translateX(-50%); box-shadow: 0 6px 14px -6px rgba(255, 106, 19, .8);
  animation: bubble .3s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes flash { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes bubble { from { opacity: 0; transform: translateX(-50%) scale(.5); } to { opacity: 1; transform: translateX(-50%) scale(1); } }

/* 손가락 터치 표시 */
.gs-tap { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 60; }
.gs-tap::before, .gs-tap::after { content: ""; position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; }
.gs-tap::before { background: rgba(22, 103, 255, .35); animation: tapDot .5s ease-out both; }
.gs-tap::after { border: 4px solid var(--blue); animation: tapWave .5s ease-out both; }
@keyframes tapDot { 0% { transform: scale(.3); opacity: 0; } 40% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .9; } }
@keyframes tapWave { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }

/* 수업 완료 요청 흐름 — 한 단계씩: 지금 바뀌는 핸드폰만 또렷하게, 나머지는 흐리게 */
.req-flow { list-style: none; display: flex; gap: 4px; margin-bottom: 10px; }
.req-flow li { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; white-space: nowrap; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.4); font-size: 12px; font-weight: 700; line-height: 1; transition: background .3s, color .3s; }
.req-flow li span { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: rgba(255,255,255,.15); font-size: 10px; }
.req-flow li.done { color: rgba(255,255,255,.75); }
.req-flow li.done span { background: rgba(255,255,255,.35); color: var(--navy); }
.req-flow li.on { background: var(--orange); color: #fff; animation: pop .3s ease; }
.req-flow li.on span { background: #fff; color: var(--orange); }
.req-msg { display: block; animation: fadeIn .4s ease; }
.m-actions button.replay { background: rgba(255,255,255,.12); color: var(--white); }
.phone-wrap, .member-phone { transition: opacity .4s, filter .4s; }
body.req-right .phone-wrap, body.req-left .member-phone { opacity: .35; filter: grayscale(.6); }
body.req-right .mp-label { background: var(--orange); color: #fff; }
/* 계속 남는 안내 표시 (공지 배너 위치) — 말풍선은 배너 안 아래쪽 */
.gs-flash.keep::after { animation: flash .6s ease-in-out 3; }
.gs-flash.below::before { bottom: 36px; margin: 0; }
