/* 001 시연판 스타일 (research.md R6, FR-022)
   글자 크기는 rem 단위: 본문 18px, 제목 22px 이상, 버튼 높이 52px 이상 */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2b2b;
  --text-soft: #5c5751;
  --line: #e4ddd3;
  --primary: #2f6b4f;
  --primary-text: #ffffff;
  --primary-soft: #e3f1ea;
  --badge: #c4561f;
  --recipient: #3f5f8a;
  --recipient-soft: #e6edf6;
  --radius: 0.875rem;
  --gap: 1rem;
  --actions-height: 5.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

/* 공통 영역: 시연용 표시, 입장 표시, 입장 전환 버튼, 단계 표시 */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1rem 0.625rem;
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

.top-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.demo-badge {
  background: var(--badge);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
}

.view-label {
  font-weight: 700;
  font-size: 1.125rem;
}

body[data-view="recipient"] .view-label {
  color: var(--recipient);
}

.view-toggle {
  margin-left: auto;
  min-height: 2.75rem;
  padding: 0.25rem 0.875rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 1rem;
  cursor: pointer;
}

.step {
  margin: 0.375rem 0 0;
  font-size: 1rem;
  color: var(--text-soft);
}

/* 본문: 아래쪽 주 버튼에 가려지지 않도록 여백을 둔다 */

.screen {
  display: block;
  padding: 1.25rem 1rem calc(var(--actions-height) + 1.5rem + env(safe-area-inset-bottom));
  max-width: 40rem;
  margin: 0 auto;
  outline: none;
}

body[data-view="recipient"] {
  background: var(--recipient-soft);
}

body[data-view="recipient"] .top {
  background: var(--recipient-soft);
}

h1 {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.375rem;
  line-height: 1.4;
  margin: 1.5rem 0 0.75rem;
}

p {
  margin: 0 0 0.75rem;
}

.guide {
  color: var(--text-soft);
}

.load-error {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 2rem 0;
  text-align: center;
}

/* 카드 */

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: var(--gap);
}

.card-button {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.card-button:focus-visible,
.option:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.avatar {
  width: 5rem;
  height: 5rem;
  flex: none;
}

.avatar-large {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.card-sub {
  margin: 0;
  color: var(--text-soft);
}

/* 활동 소식 */

.news {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news li {
  border-left: 4px solid var(--primary-soft);
  padding: 0.25rem 0 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
}

.news-date {
  display: block;
  font-size: 1rem;
  color: var(--text-soft);
}

/* 응원 선물 고르기 */

.option {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.option input {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  accent-color: var(--primary);
}

.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.gift-image {
  width: 4rem;
  height: 4rem;
  flex: none;
}

.amount {
  font-weight: 700;
}

.field-label {
  display: block;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  resize: vertical;
}

textarea:focus {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
}

.counter {
  font-size: 1rem;
  color: var(--text-soft);
  text-align: right;
  margin-top: 0.25rem;
}

.alert {
  background: #fff3e8;
  border: 2px solid #f0c7a6;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.notice {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

/* 배송 상태 세 칸 */

.track {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.track li {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--text-soft);
}

.track li.done {
  border-color: var(--primary-soft);
  color: var(--primary);
}

.track li.current {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* 아래쪽 버튼 영역: 주 버튼은 언제나 같은 자리 */

.actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.actions:empty {
  display: none;
}

body[data-view="recipient"] .actions {
  background: var(--recipient-soft);
}

.actions-inner {
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
  min-height: 2.75rem;
}

.btn:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

/* 확인 창 (C1) */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.dialog {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  width: 100%;
  max-width: 40rem;
  margin-bottom: env(safe-area-inset-bottom);
}

.dialog .actions-inner {
  margin-top: 1rem;
}

/* 앞으로 생길 기능 */

.preview-status {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-right: 0.375rem;
}

.preview-note {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: #fff3e8;
  color: var(--badge);
}

.summary {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cheer {
  margin: 0 0 var(--gap);
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.card h2 {
  margin-top: 0;
}
