/* 문의·영업 흐름 시연 — 문의 폼 → 자동 답장 → 고객 시트 → 카톡 알림 → 견적 초안.
   앞부분은 4개 시연이 같이 쓰는 바탕(색·입력 칸·단추·안내)이고, 강조색만 시연마다 다르다. 클래스에 ce- 접두사는 쓰지 않는다. */

:root {
  --canvas: #eef1f5;
  --surface: #ffffff;
  --sunken: #f6f8fa;
  --ink: #172033;
  --ink-2: #3a4457;
  --muted: #5e6878;
  --line: #dce1e8;
  --line-2: #ebeef3;
  --accent: #5b3fd9;
  --accent-deep: #4630b0;
  --accent-soft: #eeeafd;
  --accent-edge: #d4cbf8;
  --accent-text: #2f2178;
  --accent-ring: rgba(91,63,217,.5);
  --bad: #c8281c;
  --bad-bg: #fde8e6;
  --warn: #9a5706;
  --warn-bg: #fef1d6;
  --ok: #0b7a47;
  --ok-bg: #ddf5e7;
  --kakao: #fee500;
  --chat: #bacbdc;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 앱 머리 ───────────────────────────── */
.app-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 2.4vw, 28px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 15px;
}
.brand-mark i { display: block; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 3px; transform: rotate(45deg); }
.brand strong { display: block; font-size: 15px; font-weight: 750; line-height: 1.2; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.app-title { font-size: 15px; font-weight: 650; color: var(--ink-2); padding-left: 14px; border-left: 1px solid var(--line); }
.app-date { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* 처음 보는 사람을 위한 한 줄 안내 */
.guide {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 14px clamp(14px, 2.4vw, 28px) 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-edge);
  border-radius: var(--r-md);
  color: var(--accent-text);
  font-size: 13.5px;
}
.guide b { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; }
.guide button { margin-left: auto; flex: none; border: 0; background: none; color: var(--accent-text); font-size: 12.5px; text-decoration: underline; padding: 2px 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.panel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 14px 16px 10px; }
.panel-head h2 { font-size: 16px; font-weight: 750; }
.panel-head p { font-size: 12.5px; color: var(--muted); }

/* ── 입력 칸 ───────────────────────────── */
.field { display: grid; gap: 4px; min-width: 0; }
.field > span, .field legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0; }
.field select, .field input, .field textarea {
  height: 40px; padding: 0 10px; min-width: 0; width: 100%;
  border: 1px solid #cbd2dc; border-radius: var(--r-sm); background: #fff;
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.field select:focus-visible, .field input:focus-visible, .field textarea:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--bad); background: #fff8f7; }
.form-msg { font-size: 12.5px; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: #fff; border-color: #cbd2dc; color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* 처음 사용자 강조: 눌러 볼 곳에 링 */
.coach-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent-ring); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 10px transparent; } }

@media (max-width: 680px) {
  .app-title { display: none; }
  .guide { flex-wrap: wrap; }
}
@media (max-width: 420px) { .app-date { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ══ 이 시연 ═══════════════════════════════ */
.brand-mark { background: var(--accent); }
.narrow-only { display: none; }

.layout {
  display: grid; grid-template-columns: 410px minmax(0, 1fr);
  gap: 18px; padding: 14px clamp(14px, 2.4vw, 28px) 28px; align-items: start;
}

/* ── 왼쪽: 가상 홈페이지 ───────────────── */
.site { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 16px 36px -24px rgba(23, 32, 51, .4); min-width: 0; }
.browser { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #e9ecf1; border-bottom: 1px solid var(--line); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #c5cbd4; }
.url { flex: 1; min-width: 0; padding: 4px 10px; border-radius: 6px; background: #fff; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-body { --site: #1f5b4a; }
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.site-logo { font-weight: 800; font-size: 16px; color: var(--site); letter-spacing: -0.03em; }
.site-nav { font-size: 12px; color: var(--muted); white-space: nowrap; }
.site-nav b { color: var(--site); }
.site-hero { padding: 18px 18px 6px; }
.site-hero h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.site-hero p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.inq { display: grid; gap: 10px; padding: 12px 18px 18px; }
.inq .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inq .field input, .inq .field select { height: 38px; }
.inq .field select:focus-visible, .inq .field input:focus-visible, .inq .field textarea:focus-visible { outline-color: var(--site); border-color: var(--site); }
.agree { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.agree input { width: 17px; height: 17px; margin: 0; accent-color: var(--site); }
.send { height: 46px; font-size: 15px; background: var(--site); }
.send:hover { background: #164537; }
.send[aria-busy="true"] { opacity: .75; cursor: progress; }
.coach-ring.send { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(31, 91, 74, .5); }

/* ── 오른쪽: 흐름 ──────────────────────── */
.flow { min-width: 0; outline: none; }
.flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.flow-head h2 { font-size: 17px; font-weight: 800; }
.flow-head p { font-size: 13px; color: var(--muted); }
.flow-head .btn { height: 36px; flex: none; }

.rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 12px; padding: 0; list-style: none; counter-reset: s; }
.rail li { position: relative; padding-top: 14px; font-size: 12px; font-weight: 650; color: var(--muted); text-align: center; }
.rail li::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 4px; background: var(--line); }
.rail li:first-child::before { border-radius: 2px 0 0 2px; }
.rail li:last-child::before { border-radius: 0 2px 2px 0; }
.rail li::after { content: ""; position: absolute; top: 4px; left: 0; height: 4px; width: 0; background: var(--accent); transition: width .5s ease; }
.rail li.on::after { width: 100%; }
.rail li.on { color: var(--accent-deep); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; display: flex; flex-direction: column; transition: border-color .3s, box-shadow .3s, opacity .3s; }
.step[data-state="idle"] { opacity: .72; }
.step[data-state="run"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); opacity: 1; }
.step[data-state="done"] { opacity: 1; }
.step-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.step-head h3 { font-size: 13.5px; font-weight: 750; min-width: 0; }
.n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--line-2); color: var(--muted); }
.step[data-state="run"] .n { background: var(--accent); color: #fff; }
.step[data-state="done"] .n { background: var(--ok); color: #fff; }
.state { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--sunken); white-space: nowrap; }
.step[data-state="run"] .state { color: var(--accent-deep); background: var(--accent-soft); }
.step[data-state="done"] .state { color: var(--ok); background: var(--ok-bg); }
.step-body { padding: 12px; flex: 1; min-width: 0; }

.skel { display: block; height: 9px; border-radius: 5px; background: var(--line-2); margin: 7px 0; }
.skel.short { width: 60%; }
.ph { color: #a2a9b4; }

/* 1 메일 */
.mail { display: grid; gap: 8px; align-content: start; }
.mail-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.mail-meta { margin: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 3px 8px; font-size: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.mail-meta dt { color: var(--muted); }
.mail-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
#m-subj:not(.ph) { font-weight: 700; }
.mail-text { font-size: 12.5px; line-height: 1.6; white-space: pre-line; }
.typed { border-right: 2px solid var(--accent); }

/* 2 시트 */
.sheet-wrap { overflow-x: auto; padding: 0; }
.sheet { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid #e1e5ea; padding: 5px 7px; white-space: nowrap; text-align: left; }
.sheet thead th { background: #f3f5f7; color: var(--muted); font-weight: 500; text-align: center; font-size: 11px; padding: 3px; }
.sheet .rn { background: #f3f5f7; color: var(--muted); text-align: center; width: 26px; font-size: 11px; }
.sheet tr.hdr td:not(.rn) { font-weight: 700; background: #eef6f1; }
.sheet .st { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--ok-bg); color: var(--ok); }
.sheet .st.new { background: var(--accent-soft); color: var(--accent-deep); }
.sheet tr.added td:not(.rn) { animation: cellBlink 1.8s ease-out; background: #f6f3ff; }
.sheet tr.added td:nth-child(2) { outline: 2px solid var(--accent); outline-offset: -2px; }
@keyframes cellBlink { 0%, 20%, 40% { background: #e2dafd; } 10%, 30% { background: #fff; } 100% { background: #f6f3ff; } }

/* 3 잠금 화면 알림 */
.lock { display: grid; place-items: center; padding: 12px; }
.lock-screen {
  width: 100%; max-width: 280px; min-height: 196px; border-radius: 22px; padding: 14px 12px;
  background: linear-gradient(160deg, #2b2f4a 0%, #4b3f86 55%, #8a6fd1 100%);
  color: #fff; text-align: center; display: grid; align-content: start; gap: 2px;
}
.lock-time { font-size: 34px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lock-date { font-size: 11.5px; opacity: .85; margin-bottom: 10px; }
.lock-empty { font-size: 11.5px; opacity: .6; margin-top: 18px; }
.noti { text-align: left; background: rgba(255, 255, 255, .88); color: #151821; border-radius: 14px; padding: 9px 11px; backdrop-filter: blur(8px); }
.noti.in { animation: notiIn .5s cubic-bezier(.2,.8,.2,1.15); }
@keyframes notiIn { from { transform: translateY(-14px) scale(.96); opacity: 0; } }
.noti-top { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #4b5260; }
.noti-top .k { font-size: 8px; font-weight: 900; background: var(--kakao); color: #3a2f00; border-radius: 4px; padding: 2px 3px; letter-spacing: 0; }
.noti-top .when { margin-left: auto; }
.noti-title { font-size: 13px; font-weight: 750; margin-top: 3px; }
.noti-text { font-size: 12.5px; line-height: 1.5; }

/* 4 견적 초안 */
.quote { display: grid; gap: 8px; align-content: start; font-size: 12.5px; }
.quote-empty { color: var(--muted); padding: 22px 6px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); }
.q-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.q-top b { font-size: 14px; font-weight: 800; }
.q-top span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.q-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.q-lines li span:last-child { white-space: nowrap; font-weight: 650; }
.q-sum { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; }
.q-note { font-size: 11.5px; color: var(--muted); background: var(--sunken); padding: 6px 8px; border-radius: 6px; }
.quote.in > * { animation: rise .4s ease-out backwards; }
.quote.in > *:nth-child(2) { animation-delay: .08s; }
.quote.in > *:nth-child(3) { animation-delay: .16s; }
.quote.in > *:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 360px minmax(0, 1fr); }
  .site-nav { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
}
@media (max-width: 600px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .inq .two { grid-template-columns: minmax(0, 1fr); }
  .flow-head { flex-wrap: wrap; }
}
