/* 메디원 웹(W-01·첫 페이지). 값은 화면 정의서 v3.7 8장 B안 토큰과 기획서 07 7.4.1 구간 값이다. */
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/IBMPlexSansKR-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/IBMPlexSansKR-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* 색(8-2) */
  --bg: #F3F6F2;          /* dew */
  --surface: #FFFFFF;
  --text: #0F1B2D;        /* ink */
  --text-sub: #435264;    /* inkSub, dew 위 7.3:1 */
  --primary: #14532D;     /* pine */
  --primary-hi: #1A6338;  /* pineHi */
  --primary-pressed: #0E3F22;
  --on-primary: #FFFFFF;
  --accent-soft: #E8F5B8; /* limeSoft */
  --border-strong: #66766B; /* sage */
  --late-ink: #92400E;    /* amberInk */
  --late-soft: #FCEFD8;   /* amberSoft */
  /* 글자(rem, 1rem = 16px). regular 구간 */
  --title: 1.75rem;       /* 28 */
  --body: 1.375rem;       /* 22 */
  --body-small: 1.25rem;  /* 20, 하한 */
  --button: 1.5rem;       /* 24 */
  --digit: 2.25rem;       /* 36 */
  /* 간격·크기(px) */
  --gutter: 24px;
  --section-gap: 24px;
  --cell-w: 44px;
  --cell-h: 72px;
  --cell-gap: 8px;
  --group-gap: 12px;
  --max-width: none;
  --radius-button: 18px;
  --radius-input: 14px;
}

/* compact: 폭 360 미만 또는 높이 700 미만 */
@media (max-width: 359.98px), (max-height: 699.98px) {
  :root {
    --title: 1.5rem; --body: 1.25rem; --body-small: 1.25rem; --button: 1.5rem; --digit: 2rem;
    --gutter: 16px; --section-gap: 16px;
    --cell-w: 40px; --cell-h: 64px; --cell-gap: 6px; --group-gap: 12px;
  }
}
/* expanded: 짧은 변 600 이상(위 compact보다 우선) */
@media (min-width: 600px) and (min-height: 600px) {
  :root {
    --title: 2rem; --body: 1.5rem; --body-small: 1.375rem; --button: 1.625rem; --digit: 2.5rem;
    --gutter: 32px; --section-gap: 32px;
    --cell-w: 64px; --cell-h: 80px; --cell-gap: 12px; --group-gap: 24px;
    --max-width: 560px;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans KR", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 500;
  font-size: var(--body);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gutter);
}
main.wrap { flex: 1; display: flex; flex-direction: column; gap: var(--section-gap); }

.brand { margin: 0; font-size: var(--body-small); font-weight: 700; color: var(--primary); }
h1 {
  margin: 0;
  font-size: var(--title);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
p { margin: 0; }
.sub { font-size: var(--body-small); color: var(--text-sub); }

/* 번호 8칸(NumberCells): 4칸 묶음 2개. 글자가 커져 한 줄에 안 들어가면 묶음째 다음 줄로 */
.code { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--group-gap); margin: 0; }
.code .group { display: flex; gap: var(--cell-gap); }
.code .cell {
  min-width: var(--cell-w);
  min-height: var(--cell-h);
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-input);
  font-size: var(--digit);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.notice {
  padding: 16px;
  border-radius: var(--radius-input);
  background: var(--late-soft);
  color: var(--late-ink);
  font-weight: 700;
}

/* 주 버튼은 아래 고정, 본문만 스크롤 */
footer.wrap {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  padding-top: 16px;
  padding-bottom: max(var(--gutter), env(safe-area-inset-bottom));
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 12px 20px;
  border-radius: var(--radius-button);
  font-size: var(--button);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.btn.primary {
  background: linear-gradient(var(--primary-hi), var(--primary));
  color: var(--on-primary);
}
.btn.primary:active { background: var(--primary-pressed); }
.btn.secondary {
  min-height: 56px;
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border-strong);
}
/* 출시 전 안내 블록: 버튼처럼 보이지 않게(채운 배경 없음, 헤어라인 테두리) */
.info {
  display: block;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.4;
}
.info::before { content: "ⓘ "; color: var(--primary); }
#soon-note { font-size: var(--body-small); color: var(--text-sub); }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 언어 바꾸기 링크(페이지 맨 위, 작게) */
.lang { margin: 0; text-align: right; font-size: var(--body-small); }
.lang a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 8px 0; }
.lang a:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
