/* 설문 앱 레이아웃 — 랜딩·위저드·완료 화면 (모바일 우선 375px 기준) */

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-4);
  /* 노치·홈 인디케이터 안전영역 반영 */
  padding-left: max(var(--sp-4), env(safe-area-inset-left));
  padding-right: max(var(--sp-4), env(safe-area-inset-right));
  padding-top: max(var(--sp-4), env(safe-area-inset-top));
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 랜딩 */
.landing { text-align: center; padding: var(--sp-6) 0; }
.landing .brand { font-size: 0.9rem; font-weight: 700; color: var(--c-cherry-700); letter-spacing: 0.08em; }
.landing h1 { font-size: 1.7rem; line-height: 1.4; color: var(--c-burgundy-900); margin: var(--sp-4) 0; }
.landing .sub { color: var(--c-text-muted); margin-bottom: var(--sp-5); }
.landing .promises { display: grid; gap: var(--sp-2); margin: var(--sp-5) 0; text-align: left; }
.landing .promises .card { padding: var(--sp-4); display: flex; gap: var(--sp-3); align-items: center; box-shadow: none; }
.landing .promises .ico { font-size: 1.3rem; flex: none; }

/* 위저드 — head 고정, body 스크롤, foot 하단 고정 */
#wizard { display: flex; flex-direction: column; flex: 1; }
.wizard-head {
  padding: var(--sp-3) 0 var(--sp-4);
  position: sticky; top: 0; z-index: 5;
  background: var(--c-cream-100);
}
.wizard-head .step-label { display: flex; justify-content: space-between; margin-bottom: var(--sp-2); font-size: 0.85rem; color: var(--c-text-muted); }
.q-title { font-size: 1.25rem; line-height: 1.45; color: var(--c-burgundy-900); margin-bottom: var(--sp-2); }
.q-hint { color: var(--c-text-muted); font-size: 0.92rem; margin-bottom: var(--sp-4); }
.q-body { flex: 1; }

.wizard-foot {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
  position: sticky; bottom: 0; z-index: 5;
  background: var(--c-cream-100);
  border-top: 1px solid var(--c-line);
  margin-top: var(--sp-4);
}
.wizard-foot .btn-ghost { width: auto; min-width: 88px; flex: none; }
.wizard-foot .btn-primary { flex: 1; }

/* 완료 화면 */
.done { text-align: center; padding: var(--sp-6) 0; }
.done .big { font-size: 2.4rem; }
.done h2 { color: var(--c-burgundy-900); margin: var(--sp-3) 0; }
.done .type-card { margin: var(--sp-5) 0; text-align: left; }
.done .type-card .badge { margin-bottom: var(--sp-2); }

/* ── 결과 페이지 ── */
.result { padding-bottom: var(--sp-7); }
.result-head { text-align: center; padding: var(--sp-5) 0; }
.result-head .brand { font-size: 0.85rem; font-weight: 700; color: var(--c-cherry-700); letter-spacing: 0.08em; }
.result-head .hello { font-size: 1.5rem; color: var(--c-burgundy-900); margin: var(--sp-3) 0 var(--sp-2); }

.section { margin: var(--sp-5) 0; }
.section-title { font-size: 1.15rem; color: var(--c-burgundy-900); margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); }

/* 유형 카드 */
.type-hero { text-align: center; background: linear-gradient(160deg, #FBEFF1, var(--c-cream-50)); border: 1px solid var(--c-line); border-radius: var(--radius-md); padding: var(--sp-6) var(--sp-4); }
.type-hero .badge { margin-bottom: var(--sp-3); }
.type-hero h1 { font-size: 1.6rem; color: var(--c-burgundy-900); margin-bottom: var(--sp-3); }
.type-hero .explain { color: var(--c-text); }

/* 근거(왜 이 유형) — 축 점수 막대 */
.axis-bar { margin: var(--sp-3) 0; }
.axis-bar .lbl { display: flex; justify-content: space-between; font-size: 0.88rem; margin-bottom: 4px; }
.axis-bar .track { height: 8px; background: var(--c-cream-200); border-radius: var(--radius-pill); overflow: hidden; }
.axis-bar .fill { height: 100%; border-radius: var(--radius-pill); background: var(--c-cherry-700); }

/* 안내 박스 (조언/무게/근육통/안전/특수) */
.note-box { background: var(--c-cream-50); border: 1px solid var(--c-line); border-left: 3px solid var(--c-cherry-700); border-radius: var(--radius-sm); padding: var(--sp-4); margin: var(--sp-3) 0; }
.note-box.amber { border-left-color: var(--c-amber); }
.note-box.sage { border-left-color: var(--c-sage); }
.note-box.danger { border-left-color: var(--c-danger); }
.note-box h4 { font-size: 0.98rem; margin-bottom: var(--sp-2); }
.note-box p { font-size: 0.94rem; }
.note-box p + p { margin-top: var(--sp-2); }

/* 14일 캘린더 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px solid var(--c-line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.75rem; background: var(--c-white); position: relative; }
.cal-cell.workout { background: #FBEFF1; border-color: #EBC6CD; font-weight: 700; cursor: pointer; }
.cal-cell.rest { color: var(--c-text-muted); }
.cal-cell.done { background: var(--c-sage); border-color: var(--c-sage); color: #fff; }
.cal-cell .dnum { font-size: 0.68rem; opacity: 0.7; }
.cal-cell .chk { font-size: 0.9rem; }

/* 세션 순번 카드 (체크+상세 통합) */
.session summary { gap: var(--sp-3); }
.session .s-title { flex: 1; }
.chk-btn {
  width: 34px; height: 34px; flex: none;
  border: 2px solid var(--c-line); border-radius: 50%;
  background: var(--c-white); color: #fff;
  font-size: 1rem; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.chk-btn.on { background: var(--c-sage); border-color: var(--c-sage); }
.session.next { border-color: var(--c-cherry-700); box-shadow: 0 0 0 1px var(--c-cherry-700); }
.next-pill { background: var(--c-cherry-700); color: #fff; font-size: 0.72rem; padding: 3px 10px; border-radius: var(--radius-pill); flex: none; }
.session.sdone summary { opacity: 0.65; }
.week-divider { font-size: 0.85rem; font-weight: 700; color: var(--c-cherry-700); margin: var(--sp-4) 0 var(--sp-2); }

/* 운동일 상세 (아코디언) */
.day-detail { border: 1px solid var(--c-line); border-radius: var(--radius-md); margin: var(--sp-2) 0; overflow: hidden; background: var(--c-cream-50); }
.day-detail summary { padding: var(--sp-4); font-weight: 700; color: var(--c-burgundy-900); display: flex; justify-content: space-between; align-items: center; }
.day-detail summary .wk { font-size: 0.78rem; color: var(--c-text-muted); font-weight: 400; }
.day-detail .inner { padding: 0 var(--sp-4) var(--sp-4); }
.phase-line { font-size: 0.88rem; color: var(--c-text-muted); padding: var(--sp-2) 0; border-top: 1px dashed var(--c-line); }
.ex-item { padding: var(--sp-3) 0; border-top: 1px solid var(--c-line); }
.ex-item .ex-head { display: flex; justify-content: space-between; align-items: baseline; }
.ex-item .ex-name { font-weight: 700; }
.ex-item .ex-presc { font-size: 0.82rem; color: var(--c-cherry-700); white-space: nowrap; }
.ex-item .ex-swap { font-size: 0.8rem; color: var(--c-amber); margin-top: 2px; }
.ex-item dl { margin: var(--sp-2) 0 0; font-size: 0.86rem; }
.ex-item dt { color: var(--c-text-muted); float: left; width: 44px; clear: left; }
.ex-item dd { margin: 0 0 4px 52px; }

/* 무료 가이드 그리드 */
.guide-item { padding: var(--sp-3) 0; border-top: 1px solid var(--c-line); }
.guide-item .g-name { font-weight: 700; }
.guide-item .g-cat { font-size: 0.78rem; }

/* CTA 카드 */
.cta-card { background: var(--c-burgundy-900); color: #fff; border-radius: var(--radius-md); padding: var(--sp-5); text-align: center; margin: var(--sp-5) 0; }
.cta-card h3 { font-size: 1.2rem; margin-bottom: var(--sp-2); }
.cta-card p { opacity: 0.9; font-size: 0.95rem; margin-bottom: var(--sp-4); }
.cta-card .btn { background: #fff; color: var(--c-burgundy-900); }
.cta-card.mind { background: var(--c-sage); }
.cta-card.mind .btn { color: var(--c-sage); }

/* ── 직원 현황판 ── */
.staff-login { padding: var(--sp-7) 0; text-align: center; }
.staff-login h1 { color: var(--c-burgundy-900); font-size: 1.4rem; margin-bottom: var(--sp-5); }
.staff-head { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-line); }
.staff-head h1 { font-size: 1.2rem; color: var(--c-burgundy-900); }
.staff-head .logout { width: auto; min-width: 0; padding: 8px 14px; font-size: 0.85rem; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin: var(--sp-4) 0; }
.stat { background: var(--c-cream-50); border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: var(--sp-3); text-align: center; }
.stat .n { font-size: 1.4rem; font-weight: 800; color: var(--c-cherry-700); }
.stat .l { font-size: 0.72rem; color: var(--c-text-muted); }
.stat.red .n { color: var(--c-danger); }

.tabs { display: flex; gap: var(--sp-2); margin: var(--sp-4) 0; }
.tabs button { flex: 1; padding: 10px; background: var(--c-white); border: 1.5px solid var(--c-line); border-radius: var(--radius-md); font-weight: 700; font-size: 0.9rem; }
.tabs button[aria-selected="true"] { border-color: var(--c-cherry-700); background: #FBEFF1; }

.row-card { background: var(--c-cream-50); border: 1px solid var(--c-line); border-radius: var(--radius-md); padding: var(--sp-4); margin-bottom: var(--sp-2); }
.row-card .r-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.row-card .r-name { font-weight: 700; }
.row-card .r-meta { font-size: 0.82rem; color: var(--c-text-muted); margin-top: 2px; }
.row-card .r-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: var(--sp-2); }
.pill { font-size: 0.72rem; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--c-beige-300); color: var(--c-burgundy-900); }
.pill.red { background: #F4D9D9; color: var(--c-danger); font-weight: 700; }
.pill.absent { background: #FBE9D2; color: var(--c-amber); }
.pill.member { background: #DCEBE0; color: var(--c-sage); }
.row-card select { margin-top: var(--sp-3); width: 100%; padding: 8px 10px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.row-card .tip { margin-top: var(--sp-2); font-size: 0.85rem; color: var(--c-text); background: var(--c-cream-200); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm); display: none; }
.row-card .tip.show { display: block; }
.row-card .tip-toggle { margin-top: var(--sp-2); font-size: 0.82rem; color: var(--c-cherry-700); background: none; border: 0; padding: 0; text-decoration: underline; width: auto; }

.recheck-form label { display: block; font-size: 0.88rem; font-weight: 700; margin: var(--sp-3) 0 var(--sp-1); }
.recheck-form .row2 { display: flex; gap: var(--sp-2); }
.recheck-form .row2 > * { flex: 1; }
.recheck-result { margin-top: var(--sp-4); padding: var(--sp-4); background: var(--c-cream-200); border-radius: var(--radius-md); display: none; }
.recheck-result.show { display: block; }

/* 접근성 — 시각적 숨김 */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); border: 0;
}

@media (min-width: 640px) {
  .landing h1 { font-size: 2rem; }
}
