/* 아르모니아 설문 — 휴대폰 한 화면(최대 480px), 위는 병원 사진 띠, 아래는 질문 시트 */
:root {
  --sheet: #FAF8F5; --card: #FFFFFF; --ink: #3A332D; --muted: #746A60; --line: #E5DDD2; --stone: #EFE9E0; --soft: #F3EDE4;
  --band: 232px;
  /* 글꼴은 두 벌만: 세리프 Noto Serif KR = 큰 제목·숫자, 산세리프 Noto Sans KR = 나머지 전부 (Cormorant는 글자 로고 대체용에만) */
  --serif: 'Noto Serif KR', 'Batang', serif;
  --logo: 'Cormorant Garamond', serif;
  --sans: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --ease: cubic-bezier(.65, 0, .25, 1);
  color-scheme: light;
}
@media (max-height: 700px) { :root { --band: 176px } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent }
html, body { height: 100%; margin: 0 }
body { background: #CFC6B9; font-family: var(--sans); color: var(--ink); line-height: 1.6; word-break: keep-all; -webkit-text-size-adjust: 100% }
button, input, textarea { font-family: inherit; color: inherit; font-size: inherit }
[hidden] { display: none !important }

#app { position: relative; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; background: #B7AA98;
  box-shadow: 0 0 0 1px rgba(58,51,45,.06), 0 24px 70px rgba(58,51,45,.25) }

/* 사진 띠 */
.photo { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--band) + env(safe-area-inset-top, 0px)); overflow: hidden;
  background: radial-gradient(95% 40% at 50% 12%, rgba(255,244,226,.9) 0%, rgba(255,244,226,0) 72%), linear-gradient(165deg, #E9E0D4 0%, #D4C9BA 52%, #B7AA98 100%);
  transition: height .85s var(--ease) }
#app.hero .photo { height: 100% }
.motif { position: absolute; left: 0; bottom: 0; width: 100%; height: 62%; color: #fff; opacity: .5 }
.ph { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease }
.ph.on { opacity: 1; animation: kb 10s ease-out forwards }
@keyframes kb { from { transform: scale(1.08) } to { transform: scale(1) } }
.shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(40,31,24,.5) 0%, rgba(40,31,24,.14) 56%, rgba(40,31,24,.26) 100%) }
.shade::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease;
  background: linear-gradient(to bottom, rgba(40,31,24,.46) 0%, rgba(40,31,24,.36) 50%, rgba(40,31,24,.55) 100%) }
#app.hero .shade::after { opacity: 1 }

/* 위: 로고·진행 */
.top { position: relative; z-index: 2; flex: none; height: calc(var(--band) - 22px + env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 22px 0; color: #fff; transition: height .85s var(--ease) }
#app.hero .top { height: calc(env(safe-area-inset-top, 0px) + 80px) }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px }
.brand { display: flex; align-items: center }
.brand img { display: block; height: 30px; width: auto }
.textlogo { display: flex; align-items: center; gap: 10px }
.mono { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid currentColor; border-radius: 50%; font-family: var(--logo); font-weight: 500; font-size: 18px; line-height: 1; padding-bottom: 3px }
.lock { display: flex; flex-direction: column; align-items: center }
.wm { font-family: var(--logo); font-weight: 500; font-size: 23px; letter-spacing: .13em; line-height: 1; margin-right: -.13em }
.sub { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-family: var(--logo); font-weight: 600; font-size: 10px; letter-spacing: .42em; line-height: 1 }
.sub::before, .sub::after { content: ""; width: 16px; height: 1px; background: currentColor; opacity: .85 }
.count { font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: .06em; font-variant-numeric: lining-nums }
.dots { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap }
.dots i { display: block; width: 5px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.5); transition: width .35s, background .35s }
.dots i.past { background: rgba(255,255,255,.95) }
.dots i.cur { width: 22px; background: #fff }
.top.quiet .count, .top.quiet .dots { visibility: hidden }

/* 질문 시트 */
.stage { position: relative; z-index: 3; flex: 1; min-height: 0; background: var(--sheet); transition: background-color .7s ease }
#app.hero .stage { background: transparent }
.wave { position: absolute; left: 0; top: -23px; width: 100%; height: 24px; display: block; color: var(--sheet); pointer-events: none;
  filter: drop-shadow(0 -4px 8px rgba(40,31,24,.14)); transition: opacity .5s ease }
#app.hero .wave { opacity: 0 }
.screen { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px 24px 32px }
.screen h1 { font-weight: 700; font-size: 21px; line-height: 1.45; letter-spacing: -.025em; margin: 0 0 12px; outline: none }
.hint { display: inline-block; margin: 0 0 20px; padding: 4px 13px; background: var(--stone); color: #6A5E52; border-radius: 999px; font-size: 13.5px; font-weight: 500 }
.lead { margin: 0 0 22px; font-size: 16px; color: var(--muted); white-space: pre-line }
@keyframes inF { from { opacity: 0; transform: translateX(26px) } to { opacity: 1; transform: none } }
@keyframes inB { from { opacity: 0; transform: translateX(-26px) } to { opacity: 1; transform: none } }
.in-fwd { animation: inF .4s cubic-bezier(.2,.7,.2,1) both }
.in-back { animation: inB .4s cubic-bezier(.2,.7,.2,1) both }
@media (prefers-reduced-motion: reduce) { .screen, .ph.on { animation: none !important } .photo, .top, .stage { transition: none } }

/* 첫 화면 */
.intro { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; color: #fff; padding-bottom: 20px }
.intro .eyebrow { font-family: var(--serif); font-size: 36px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 0; text-shadow: 0 2px 14px rgba(30,22,16,.25) }
.intro h1 { font-family: var(--serif); font-size: 27px; font-weight: 600; color: #F2E6D3; margin: 6px 0 18px; letter-spacing: -.02em; line-height: 1.3; text-shadow: 0 2px 14px rgba(30,22,16,.25) }
.intro .lead { color: rgba(255,255,255,.92); font-size: 15px; margin: 0 0 24px }
.chips { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-bottom: 34px }
.chip { display: flex; align-items: center; gap: 13px; padding: 10px 20px 10px 10px; background: #F6EFE4; color: #4A3A2C; border-radius: 16px; text-align: left; box-shadow: 0 6px 20px rgba(40,30,20,.18) }
.chip .ico { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 13px; background: #EBE0CF; color: #8C7A64 }
.chip .ico svg { width: 26px; height: 26px }
.chip .pic { flex: none; width: 52px; height: 52px; border-radius: 13px; background: #2E3D38 center / cover no-repeat }
.chip b { display: block; font-size: 16px; font-weight: 700; line-height: 1.35 }
.chip small { display: block; font-size: 13px; color: #8A7A69; line-height: 1.35 }
.start { min-width: 180px; height: 52px; padding: 0 30px; border-radius: 999px; border: 0; background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(40,31,24,.25) }
.start:active { transform: scale(.98) }
.msg { justify-content: center }
.msg h1 { font-family: var(--serif); color: #fff; font-size: 26px; font-weight: 600; margin-bottom: 10px }

/* 보기 */
.opts { display: flex; flex-direction: column; gap: 8px }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 11px 16px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s }
.opt:focus-visible, .rate button:focus-visible, .btn:focus-visible, .inp:focus-visible, .mxr button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px }
.opt .txt { flex: 1; min-width: 0 }
.opt .t { display: block; font-size: 16px; font-weight: 500; line-height: 1.45 }
.opt .s { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); line-height: 1.45 }
.ind { flex: none; width: 24px; height: 24px; border: 1.5px solid #CDC3B6; border-radius: 50%; background: var(--card); display: grid; place-items: center; transition: background .2s, border-color .2s }
.ind::after { content: ""; opacity: 0; transition: opacity .15s }
.ind.sq::after { width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px) }
.ind.ci::after { width: 9px; height: 9px; border-radius: 50%; background: #fff }
.opt[aria-checked="true"] { background: var(--soft); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink) }
.opt[aria-checked="true"] .ind { background: var(--ink); border-color: var(--ink) }
.opt[aria-checked="true"] .ind::after { opacity: 1 }
.opt .ico, .mxi .ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #F4EFE7; color: #8C7A64; transition: background .2s, color .2s }
.opt .ico svg, .mxi .ico svg { width: 21px; height: 21px }
.opt[aria-checked="true"] .ico { background: var(--ink); color: #fff }
.other { display: none; margin: 2px 0 0 }
.other.show { display: block; animation: inF .25s ease both }

/* 별점(1~5) */
.rate { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 24px }
.rate::before { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 1px; background: var(--line) }
.rate button { position: relative; justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: var(--card); border: 1px solid #CDC3B6; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 20px; line-height: 1; font-variant-numeric: lining-nums; transition: transform .2s, background .2s, color .2s, box-shadow .2s }
.rate button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; transform: scale(1.12); box-shadow: 0 0 0 6px rgba(58,51,45,.12) }
.rate-labels { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 14px; font-size: 12px; line-height: 1.35; color: var(--muted); text-align: center; letter-spacing: -.03em }
.rate-labels span:nth-child(1) { grid-column: 1 } .rate-labels span:nth-child(2) { grid-column: 3 } .rate-labels span:nth-child(3) { grid-column: 5 }

/* 항목별 점수 */
.mx { display: flex; flex-direction: column; gap: 10px }
.mxi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 12px; transition: border-color .2s }
.mxi.ok { border-color: #CDBFAD }
.mxh { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 500; font-size: 15.5px }
.mxr { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px }
.mxr button { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #FBF9F6; cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1; transition: background .2s, color .2s, border-color .2s }
.mxr button[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink) }
.mxl { display: flex; justify-content: space-between; margin: 0 2px 10px; font-size: 12px; color: var(--muted) }

/* 글 입력 */
.inp { width: 100%; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 16px; line-height: 1.55; outline: none; transition: border-color .2s }
.inp:focus { border-color: var(--ink) }
textarea.inp { min-height: 180px; resize: vertical }
.cnt { margin-top: 6px; text-align: right; font-size: 12.5px; color: var(--muted) }
.field { margin-bottom: 14px }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500 }

/* 동의 */
.terms { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; margin-bottom: 16px }
.terms div { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--stone); font-size: 14.5px }
.terms div:last-child { border-bottom: 0 }
.terms dt { flex: none; width: 70px; color: var(--muted) }
.terms dd { margin: 0; font-weight: 500 }
.note { margin: 14px 2px 0; font-size: 13.5px; color: var(--muted); line-height: 1.55 }
.anon { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 8px; padding: 12px 14px; background: transparent; border: 1px dashed #CDC3B6; border-radius: 14px; text-align: left; cursor: pointer }
.anon[aria-checked="true"] { background: var(--soft); border-style: solid; border-color: var(--ink) }
.anon[aria-checked="true"] .ind { background: var(--ink); border-color: var(--ink) }
.anon[aria-checked="true"] .ind::after { opacity: 1 }
.anon b { display: block; font-size: 15px; font-weight: 500 }
.anon small { display: block; font-size: 12.5px; color: var(--muted) }
.box { background: var(--stone); border-radius: 14px; padding: 14px 16px; font-size: 14.5px; color: #5E5348; line-height: 1.6 }

/* 끝 화면 */
.done { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; padding-bottom: 30px }
.done .mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: #fff; margin-bottom: 18px }
.done .mark svg { width: 30px; height: 30px }
.done h1 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 10px }
.done p { margin: 0 0 26px; color: var(--muted); font-size: 15px; white-space: pre-line }
.link { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink); color: var(--ink); font-weight: 700; text-decoration: none }

/* 아래 단추 */
.nav { position: relative; z-index: 5; flex: none; display: flex; gap: 10px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--sheet); border-top: 1px solid var(--stone) }
.nav.hidden { display: none }
.btn { height: 52px; border-radius: 999px; font-size: 16px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: background .2s, opacity .2s }
.btn.ghost { flex: 0 0 92px; background: transparent; border-color: #CDC3B6 }
.btn.main { flex: 1; background: var(--ink); color: #fff }
.btn.main:disabled { background: #B8AFA5; cursor: default }
.btn.ghost:disabled { opacity: .35; cursor: default }

.toast { position: absolute; left: 50%; bottom: 96px; z-index: 9; transform: translate(-50%, 10px); max-width: calc(100% - 40px); padding: 11px 18px; border-radius: 12px; background: rgba(40,31,24,.92); color: #fff; font-size: 14px; line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; text-align: center }
.toast.show { opacity: 1; transform: translate(-50%, 0) }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0 }
.pv { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 66px); right: 22px; z-index: 6; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; font-size: 11px }
