/* ============================================================
   yt.kdental.kr  퍼널 공통 스타일
   1 index.html  유튜브형 랜딩
   2 apply.html  상담신청 폼
   3 done.html   신청완료
   ============================================================ */

:root {
  --red: #ff0033;
  --red-dark: #e0002c;
  --blue: #3d7bff;
  --blue-dark: #2f66e0;
  --ink: #0f0f0f;
  --muted: #606060;
  --line: #e5e5e5;
  --bg: #ffffff;
  --radius: 12px;
  --shell: 500px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #f1f1f1;
  color: var(--ink);
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- 1. 유튜브형 헤더 ---------- */
.yt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
}
.yt-logo { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.yt-logo .play {
  width: 34px; height: 24px;
  background: var(--red);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.yt-logo .play::after {
  content: ''; width: 0; height: 0;
  border-left: 9px solid #fff;
  border-top: 5.5px solid transparent;
  border-bottom: 5.5px solid transparent;
  margin-left: 2px;
}
.yt-logo .name { font-size: 19px; font-weight: 800; letter-spacing: -0.8px; }
.yt-logo .name sup { font-size: 10px; font-weight: 600; color: var(--muted); }

.yt-search {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  color: #3c3c3c;
  min-width: 0;
}
.yt-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-mic {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}

/* ---------- 1. 영상 영역 ---------- */
.player { position: relative; background: #000; aspect-ratio: 16 / 9; overflow: hidden; }
.player > img, .player > video { width: 100%; height: 100%; object-fit: cover; }
.player .fallback {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 65%, #c2410c 0%, #7c2d12 35%, #1c1917 75%);
}
/* 재생 버튼. 썸네일에 그려진 일시정지 아이콘 자리에 겹쳐 놓아 하나만 보이게 한다. */
.player-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 21%; aspect-ratio: 1; min-width: 68px; max-width: 108px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255,255,255,.95); border-radius: 50%;
  /* 썸네일에 이미 그려져 있는 일시정지 아이콘을 가리려면 속이 비치면 안 된다. */
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.player-play svg { width: 40%; height: 40%; fill: #fff; margin-left: 8%; }
.player-play::before {
  content: ''; position: absolute; inset: -3px;
  border: 3px solid rgba(255,255,255,.7); border-radius: 50%;
  animation: playPulse 2.4s ease-out infinite;
}
@keyframes playPulse {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .player-play::before { animation: none; opacity: 0; }
}
.player-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 11px 7px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,0) 100%);
}
.player-bar { padding: 0 1px; margin-bottom: 9px; }
.player-bar .track { height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; position: relative; }
.player-bar .track i { position: absolute; left: 0; top: 0; bottom: 0; width: 49%; background: var(--red); border-radius: 2px; }
.player-bar .track i::after {
  content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; background: var(--red); border-radius: 50%;
}
.player-ctl {
  display: flex; align-items: center; gap: 15px;
  padding: 0;
  color: #fff; font-size: 12px;
}
.player-ctl svg { width: 19px; height: 19px; fill: #fff; flex-shrink: 0; opacity: .93; }
.player-ctl .time { margin-left: 3px; letter-spacing: .3px; opacity: .95; white-space: nowrap; }
.player-ctl .spacer { flex: 1; }

/* ---------- 1. 채널 / 액션 ---------- */
.channel {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px 12px;
}
.channel .avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: #eef4ff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.channel .meta { flex: 1; min-width: 0; }
.channel .meta b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.4px; }
.channel .meta small { color: var(--muted); font-size: 12px; }

.btn-apply {
  background: var(--red); color: #fff;
  border: none; border-radius: 8px;
  padding: 14px 26px;
  font-size: 17px; font-weight: 800;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-apply:active { background: var(--red-dark); }

.actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.pill {
  display: flex; align-items: center; gap: 8px;
  background: #f2f2f2; border: none; border-radius: 999px;
  padding: 9px 16px; font-size: 14px; font-weight: 600;
}
.pill .divider { width: 1px; height: 16px; background: #d5d5d5; }

.videoinfo {
  margin: 0 14px 16px;
  background: #f2f2f2; border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
}
.videoinfo .stat { font-weight: 700; margin-bottom: 4px; }
.videoinfo .tags { color: #065fd4; line-height: 1.5; }
.videoinfo .tags em { font-style: normal; color: var(--muted); }

.comments { padding: 0 14px 32px; }
.comments h3 { font-size: 16px; margin: 0 0 14px; }
.comment { display: flex; gap: 10px; margin-bottom: 16px; }
.comment .ava {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.comment .body { font-size: 13.5px; line-height: 1.55; }
.comment .body .who { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.comment .body .who b { color: var(--ink); font-size: 13px; margin-right: 5px; }
/* 새로 올라온 댓글이 위에서 밀려 들어온다. */
.comment.is-new { animation: cmtIn .45s ease-out both; }
@keyframes cmtIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .comment.is-new { animation: none; }
}

/* ---------- 2. 폼 페이지 ---------- */
/* 방금 신청한 사람 알림. 폼 위에 붙어 따라 내려온다. */
.live-proof[hidden] { display: none; }   /* display:flex 가 hidden 을 이기지 않도록 */
.live-proof {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: #111; color: #fff;
  font-size: 13.5px; letter-spacing: -0.2px;
}
.live-proof .dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.7);
  animation: proofDot 2s ease-out infinite;
}
.live-proof .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-proof .when { flex-shrink: 0; opacity: .6; font-size: 12px; }
.live-proof.is-in { animation: proofIn .4s ease-out both; }
@keyframes proofIn {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: none; }
}
@keyframes proofDot {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.7); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-proof.is-in { animation: none; }
  .live-proof .dot { animation: none; }
}

.form-wrap { padding: 28px 20px 44px; }
.hero-emoji { font-size: 76px; text-align: center; line-height: 1; margin-bottom: 18px; }

.timer-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 19px; font-weight: 800; letter-spacing: -0.6px;
  margin-bottom: 14px;
}
.timer-label .tag {
  background: var(--red); color: #fff;
  border-radius: 6px; padding: 3px 9px;
  font-size: 16px; font-weight: 800;
}
.countdown { display: flex; justify-content: center; gap: 6px; margin-bottom: 26px; }
.countdown .d {
  width: 48px; height: 62px;
  background: #111; color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.countdown .gap { width: 6px; }

.field { margin-bottom: 12px; }
.field input, .field select {
  width: 100%;
  border: 1.5px solid #d8d8d8;
  border-radius: 10px;
  padding: 17px 16px;
  font-size: 17px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  appearance: none;
}
.field select { background-image: none; }
.field input::placeholder { color: #b5b5b5; }
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.field .err { display: none; color: var(--red); font-size: 13px; margin: 6px 2px 0; }
.field.invalid .err { display: block; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '▼'; position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%); pointer-events: none;
  font-size: 13px; color: var(--blue);
}

.consent {
  border: 1.5px solid #e2e2e2; border-radius: 10px;
  padding: 14px 16px; margin: 16px 0 20px;
}
.consent .row { display: flex; align-items: center; gap: 9px; }
.consent .all { padding-bottom: 12px; border-bottom: 1px solid #ececec; margin-bottom: 12px; }
.consent .all label { font-size: 16px; font-weight: 700; }
.consent .sub { margin-bottom: 9px; }
.consent .sub:last-child { margin-bottom: 0; }
.consent .sub label { font-size: 14px; color: #333; flex: 1; }
.consent input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--blue); flex-shrink: 0; }
.consent .more {
  border: 1px solid #d5d5d5; background: #fff;
  border-radius: 999px; padding: 5px 11px;
  font-size: 12px; color: #555; flex-shrink: 0;
}

.btn-submit {
  width: 100%;
  background: var(--blue); color: #fff;
  border: none; border-radius: 10px;
  padding: 19px;
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.5px;
}
.btn-submit:active { background: var(--blue-dark); }
.btn-submit[disabled] { opacity: .55; }

.form-msg { margin-top: 14px; font-size: 14px; text-align: center; min-height: 20px; }
.form-msg.error { color: var(--red); }

/* 봇 트랩 — 화면에서 감추되 자동입력은 유도 */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 3. 완료 페이지 ---------- */
.done-wrap {
  padding: 40px 20px;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.done-wrap h1 { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin: 0 0 16px; }
.done-wrap p.lead { font-size: 20px; line-height: 1.5; color: #222; margin: 0; word-break: keep-all; }

/* ---------- 약관 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.on { display: block; }
.modal .dim { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal .sheet {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100% - 36px));
  max-height: 74vh; overflow-y: auto;
  background: #fff; border-radius: 14px;
  padding: 22px 20px;
}
.modal h4 { margin: 0 0 12px; font-size: 17px; }
.modal .doc { font-size: 13px; line-height: 1.7; color: #444; white-space: pre-line; }
.modal .close {
  margin-top: 18px; width: 100%;
  border: none; border-radius: 9px; padding: 13px;
  background: #f0f0f0; font-size: 15px; font-weight: 700;
}

/* 유튜브 컨트롤/액션 아이콘 (인라인 SVG) */
.ico { width: 20px; height: 20px; flex-shrink: 0; }
.yt-search .ico { fill: #606060; width: 21px; height: 21px; }
.yt-mic .ico { fill: #0f0f0f; width: 19px; height: 19px; }
.pill .ico { fill: #0f0f0f; width: 21px; height: 21px; }

/* ---------- 4. 한 장짜리(instant.html) ----------
   피그마 「[플란치과] 인스턴트」 1:321 「유튜브 전용 상담 시안 1」.
   헤더·영상은 1 과 같고, 채널 줄 아래에 신청 카드가 바로 붙는다.
   카드 글꼴은 시안대로 Pretendard. .instant 와 .apply-card 는 instant.html 에만 있어
   3단계 퍼널 화면에는 닿지 않는다. */
.instant {
  --pretendard: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
                'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}
.instant .player { cursor: pointer; }

.instant .channel { padding: 24px 20px 20px; }
.instant .channel .meta { font-family: var(--pretendard); }
.instant .channel .meta small { display: block; margin-top: 4px; }

.apply-card-wrap { padding: 0 20px 16px; }
.apply-card {
  display: flex; flex-direction: column; gap: 20px;
  padding: 24px 20px;
  background: #f7f7f7;
  border: 1px solid #e4e4e4;
  border-radius: 16px;
  font-family: var(--pretendard);
  color: var(--ink);
}
.apply-card h1 { margin: 0; font-size: 22px; font-weight: 700; line-height: normal; }
.apply-card h1 em { font-style: normal; color: var(--red); }

.apply-card form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.apply-card .q { display: flex; flex-direction: column; gap: 6px; }
.apply-card .q-label { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.25; word-break: keep-all; }

/* 네 / 아니오 — 라디오를 버튼 모양으로. 고른 쪽만 빨갛게. */
.apply-card .choice { display: flex; gap: 12px; }
.apply-card .choice label { flex: 1; min-width: 0; position: relative; }
.apply-card .choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.apply-card .choice span {
  display: block; padding: 16px;
  border-radius: 10px;
  background: #fff; color: #737784;
  font-size: 15px; line-height: 1.2; text-align: center;
  transition: background .15s, color .15s;
}
.apply-card .choice input:checked + span { background: var(--red); color: #fff; }
.apply-card .choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.apply-card .q.invalid .choice span { box-shadow: inset 0 0 0 1px var(--red); }

/* 입력란. 글자는 16px — iOS 사파리는 16px 보다 작은 입력란을 누르면 화면을 확대한다.
   시안의 15px 는 안내 문구(placeholder)에만 준다. */
.apply-card .q input[type=text],
.apply-card .q input[type=tel] {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid #e4e4e4; border-radius: 10px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 16px;
  appearance: none; -webkit-appearance: none;
}
.apply-card .q input::placeholder { color: #737784; font-size: 15px; opacity: 1; }
.apply-card .q input:focus { outline: none; border-color: var(--ink); }
.apply-card .q.invalid input { border-color: var(--red); }
.apply-card .err { display: none; margin: 0 2px; color: var(--red); font-size: 13px; }
.apply-card .q.invalid .err { display: block; }

/* 동의 */
.apply-card .agree { display: flex; flex-direction: column; }
.apply-card .agree label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.apply-card .agree-all { height: 40px; border-bottom: 1px solid #e4e4e4; }
.apply-card .agree-all b { font-size: 14px; font-weight: 700; }
.apply-card .agree-all small { font-size: 12px; color: var(--muted); }
.apply-card .agree-row { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.apply-card .agree-row label { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; word-break: keep-all; }
.apply-card .agree-row em { font-style: normal; font-weight: 700; color: var(--red); }
.apply-card .more {
  flex-shrink: 0; padding: 6px 0;
  border: 0; background: none;
  font-family: inherit; font-size: 12px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px;
}
.apply-card input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  flex-shrink: 0; width: 20px; height: 20px; margin: 0;
  display: grid; place-content: center;
  border: 1px solid #737784; border-radius: 4px;
  background: #fff; cursor: pointer;
}
.apply-card input[type=checkbox]::before {
  content: ''; width: 10px; height: 5px;
  border: solid #fff; border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.apply-card input[type=checkbox]:checked { background: var(--red); border-color: var(--red); }
.apply-card input[type=checkbox]:checked::before { opacity: 1; }
.apply-card input[type=checkbox]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.apply-card .submit {
  width: 100%; height: 56px;
  border: 0; border-radius: 10px;
  background: var(--red); color: #fff;
  font-family: 'Noto Sans KR', sans-serif; font-size: 18px; font-weight: 700;
  transition: background .15s;
}
.apply-card .submit:active { background: var(--red-dark); }
.apply-card .submit[disabled] { opacity: .55; }
.apply-card .form-msg { margin: 0; min-height: 0; word-break: keep-all; }
.apply-card .form-msg .nowrap { white-space: nowrap; }
/* 비어 있을 때도 화면낭독기의 안내 영역(role=status)으로 남겨 둔다 — display:none 이면
   나중에 채운 문구가 읽히지 않는 화면낭독기가 있다. 대신 폼 간격(16px)만 되돌린다. */
.apply-card .form-msg:empty { margin-top: -16px; }
