/* ── Smile Simulator — 공통 디자인 시스템 (화이트라벨: --brand 만 교체) ── */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --brand: #0E7C7B;
  --ink: #1a1d21;
  --ink-soft: #6b7280;
  --line: #e8eaee;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(20, 30, 40, .08);
}

html, body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* header */
#app-header { padding: 20px 20px 4px; }
.header-inner { max-width: 560px; margin: 0 auto; }
.clinic-name { font-size: 12px; font-weight: 600; letter-spacing: .12em; color: var(--brand); text-transform: uppercase; }
.product-label { font-size: 20px; font-weight: 700; margin-top: 2px; }

#main { max-width: 560px; margin: 0 auto; padding: 16px 20px 48px; }

/* ── upload ── */
.hero-copy { margin: 24px 0 28px; }
.hero-copy h2 { font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; }
.hero-copy p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }

#upload-dropzone {
  position: relative;
  border: 1.5px dashed #cfd6de;
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 44px 24px 36px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
#upload-dropzone:hover, #upload-dropzone.dragover { border-color: var(--brand); background: #fff; }
.guide-oval {
  width: 96px; height: 124px; margin: 0 auto 16px;
  border: 2px solid var(--brand); opacity: .35;
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
}
.guide-icon { font-size: 22px; color: var(--brand); margin-bottom: 12px; }
.guide-title { font-size: 16px; font-weight: 700; }
.guide-sub { font-size: 13px; color: var(--ink-soft); margin: 6px 0 20px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 0;
  font: inherit; font-size: 15px; font-weight: 700;
  padding: 14px 26px; border-radius: 12px; cursor: pointer;
  text-decoration: none;
  transition: filter .15s, transform .1s;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; padding: 16px; font-size: 16px; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 12px 18px; border-radius: 12px; cursor: pointer; flex: 1;
}
.btn-secondary:hover { border-color: #c4ccd4; }

#consent-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 16px; font-size: 13px; color: var(--ink-soft); cursor: pointer;
}
#consent-row input { margin-top: 2px; accent-color: var(--brand); }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
#consent-detail { margin-top: 8px; font-size: 12px; color: var(--ink-soft); background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; line-height: 1.6; }

/* ── processing ── */
#processing-section { text-align: center; padding: 96px 0; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 24px;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#processing-msg { font-size: 16px; font-weight: 600; }
.processing-sub { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }

/* ── compare slider ── */
#compare-box {
  position: relative; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  touch-action: none;
  user-select: none;
}
#compare-box img { display: block; width: 100%; height: auto; pointer-events: none; }
#img-after { position: relative; }
#before-clip {
  position: absolute; inset: 0;
  overflow: hidden;
  width: 50%;
}
#before-clip img { width: auto; height: 100%; max-width: none; }
#compare-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 0; cursor: ew-resize;
}
.handle-line { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: rgba(255,255,255,.92); box-shadow: 0 0 8px rgba(0,0,0,.3); }
.handle-knob {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.95); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.tag {
  position: absolute; top: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(4px);
}
.tag-before { left: 12px; }
.tag-after { right: 12px; }

#gen-shimmer {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(255,255,255,.35); backdrop-filter: blur(2px);
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.shimmer-bar {
  width: 120px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--line) 25%, var(--brand) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.disclaimer { margin-top: 10px; font-size: 11px; color: var(--ink-soft); text-align: center; }

/* ── snap sliders ── */
#control-panel {
  margin-top: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 20px 18px 8px;
}
.slider-group { margin-bottom: 20px; }
.slider-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.slider-label strong { font-size: 15px; color: var(--brand); font-weight: 700; }

.snap-slider {
  position: relative; height: 36px; margin-top: 6px;
  cursor: pointer; touch-action: none;
}
.snap-track {
  position: absolute; top: 50%; left: 10px; right: 10px; height: 4px;
  transform: translateY(-50%);
  background: var(--line); border-radius: 2px;
}
.snap-fill {
  position: absolute; top: 50%; left: 10px; height: 4px;
  transform: translateY(-50%);
  background: var(--brand); border-radius: 2px;
  transition: width .18s ease;
}
.snap-dot {
  position: absolute; top: 50%; width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  background: #cdd4dc; border-radius: 50%;
}
.snap-dot.passed { background: var(--brand); }
.snap-thumb {
  position: absolute; top: 50%; width: 24px; height: 24px;
  transform: translate(-50%, -50%);
  background: #fff; border: 2.5px solid var(--brand); border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: left .18s ease;
}
.slider-ticks { display: flex; justify-content: space-between; padding: 2px 2px 0; font-size: 11px; color: var(--ink-soft); }
.slider-ticks span.active { color: var(--brand); font-weight: 700; }

/* ── CTA ── */
#cta-area { margin-top: 24px; }
.cta-row { display: flex; gap: 10px; margin-top: 10px; }

#demo-badge {
  margin-top: 16px; text-align: center; font-size: 12px;
  color: #a16207; background: #fef9c3; border-radius: 10px; padding: 10px 12px;
}

/* ── error ── */
#error-section { text-align: center; padding: 80px 0; }
.error-icon { font-size: 40px; color: var(--brand); opacity: .5; margin-bottom: 20px; }
#error-msg { font-size: 15px; line-height: 1.6; color: var(--ink); margin-bottom: 24px; }

/* footer */
#app-footer { max-width: 560px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); }
#app-footer p { font-size: 11px; color: var(--ink-soft); line-height: 1.6; }

@media (min-width: 640px) {
  .product-label { font-size: 22px; }
  .hero-copy h2 { font-size: 30px; }
}
