:root {
  --bg: #f7faf9;
  --bg-soft: #eef4f2;
  --surface: #ffffff;
  --border: #e5ecea;
  --text: #0f172a;
  --text-muted: #55635f;
  --brand: #10b981;
  --brand-strong: #059669;
  --brand-soft: #d1fae5;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04),
    0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px -8px rgba(15, 23, 42, 0.15);
  --shadow-lg: 0 20px 40px -20px rgba(15, 23, 42, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 30%);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

@supports (font-variation-settings: normal) {
  :root {
    --font: "Inter var", system-ui, -apple-system, "Segoe UI", Roboto,
      sans-serif;
  }
}

body {
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--brand-strong);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

/* ------ Header ------ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand-name {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-name span {
  color: var(--brand-strong);
}
.brand-logo {
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.site-nav {
  display: flex;
  gap: 28px;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}
@media (max-width: 720px) {
  .site-header {
    padding: 16px 20px;
  }
  .site-nav {
    display: none;
  }
}

/* ------ Views ------ */
.view {
  display: none;
}
.view.active {
  display: block;
}

/* ------ Hero ------ */
.view-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 40px 0 80px;
}
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 20px 0 60px;
  }
}
@media (max-width: 720px) {
  .view-hero {
    padding: 20px 20px 60px;
  }
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 20px 0 20px;
  font-weight: 800;
}
.accent {
  background: linear-gradient(90deg, #059669, #10b981 60%, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 32px;
  max-width: 560px;
}
.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.05s ease, box-shadow 0.2s ease, filter 0.2s ease;
  text-decoration: none;
}
.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 12px 28px -12px rgba(16, 185, 129, 0.45);
  text-decoration: none;
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-ghost:hover {
  background: var(--surface);
  text-decoration: none;
}
.trust-row {
  display: flex;
  gap: 24px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  flex-wrap: wrap;
}
.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ------ Hero card mock ------ */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1deg);
}
.hero-card-header,
.hero-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hero-card-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.chip-online {
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.chip-done {
  background: #dcfce7;
  color: #166534;
}
.sep {
  color: var(--border);
  margin: 0 6px;
}
.hero-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 4px;
}
.gallery-item {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.gi-1 { background: linear-gradient(135deg, #fde68a, #fca5a5); }
.gi-2 { background: linear-gradient(135deg, #bfdbfe, #a5b4fc); }
.gi-3 { background: linear-gradient(135deg, #bbf7d0, #86efac); }
.gi-4 { background: linear-gradient(135deg, #fbcfe8, #f9a8d4); }
.gi-5 { background: linear-gradient(135deg, #fed7aa, #fdba74); }
.gi-6 { background: linear-gradient(135deg, #a7f3d0, #6ee7b7); }

/* ------ Sections ------ */
.section {
  padding: 80px 0 40px;
}
.section h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  font-weight: 800;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 800px) {
  .steps {
    grid-template-columns: 1fr;
  }
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.step-num {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}
.step h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.step p {
  color: var(--text-muted);
  margin: 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 800px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.feature-card p {
  color: var(--text-muted);
  margin: 0;
}
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 12px;
}
details summary {
  cursor: pointer;
  font-weight: 600;
}
details p {
  color: var(--text-muted);
  margin: 10px 0 0;
}

/* ------ Flow ------ */
.view-flow {
  min-height: calc(100vh - 100px);
  padding: 20px 20px 80px;
}
.flow-container {
  max-width: 780px;
  margin: 0 auto;
}
.stepper {
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0 0 32px;
  list-style: none;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.stepper-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.stepper-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.stepper-item.done {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: var(--brand-soft);
}
.stepper-item.done .stepper-num {
  background: var(--brand);
  color: #fff;
}
.stepper-item.current {
  color: var(--text);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.stepper-item.current .stepper-num {
  background: var(--brand);
  color: #fff;
}

.step-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}
@media (max-width: 600px) {
  .step-panel {
    padding: 20px;
  }
}

/* --- QR --- */
.qr-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 640px) {
  .qr-card {
    grid-template-columns: 1fr;
  }
}
.qr-canvas-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
}
.qr-canvas-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-muted);
  font-weight: 500;
  border-radius: var(--radius);
}
.qr-overlay[hidden] {
  display: none;
}
.qr-instructions h2 {
  margin: 0 0 12px;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.qr-instructions ol {
  padding-left: 20px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.qr-instructions ol li {
  margin: 6px 0;
}
.hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.link-btn {
  background: none;
  border: none;
  color: var(--brand-strong);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}
.link-btn.danger {
  color: var(--danger);
}

/* --- Target --- */
.target-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}
.target-card h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.muted {
  color: var(--text-muted);
  margin: 0 0 24px;
}
.target-form label {
  display: block;
  margin-bottom: 16px;
}
.target-form label span {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phone-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.phone-input .prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-weight: 600;
  border-right: 1px solid var(--border);
}
.phone-input input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 12px;
  font: inherit;
  color: inherit;
  background: transparent;
}
.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0 0 12px;
}
.target-form button {
  width: 100%;
}

/* --- Sync --- */
.sync-card {
  text-align: center;
}
.sync-spinner {
  margin: 0 auto 20px;
  display: inline-flex;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.sync-card h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.counters {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 24px 0 24px;
}
.counter-num {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--brand-strong);
  letter-spacing: -0.02em;
}
.counter-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -6px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.gallery .media-thumb {
  border-radius: 12px;
  overflow: clip;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  grid-template-rows: 140px auto auto;
  animation: fade-in 0.35s ease both;
  text-align: left;
}
.gallery .media-thumb .media-preview {
  background: var(--bg-soft);
}
.gallery .media-thumb img,
.gallery .media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery .media-thumb .media-meta,
.done-gallery .media-thumb .media-meta {
  padding: 10px 10px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gallery .media-thumb .badge,
.done-gallery .media-thumb .badge {
  background: #0f172a;
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.media-time {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.media-actions {
  padding: 0 10px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-mini {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}
.btn-ghost.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.media-file {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  height: 100%;
  padding: 10px;
  text-align: center;
}
.audio-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--brand-strong);
  height: 100%;
}
.audio-chip svg {
  width: 38px;
  height: 38px;
}
.audio-chip span {
  color: var(--text-muted);
  font-size: 0.8rem;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Done --- */
.done-card {
  text-align: center;
}
.done-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.done-card h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.done-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 8px;
  flex-wrap: wrap;
}
.done-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.done-gallery .media-thumb {
  border-radius: 12px;
  overflow: clip;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  grid-template-rows: 140px auto auto;
  text-align: left;
}
.done-gallery .media-thumb img,
.done-gallery .media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.done-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* --- Media viewer + audio player --- */
body.no-scroll {
  overflow: hidden;
}
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.media-viewer[hidden] {
  display: none;
}
.media-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
}
.media-viewer-dialog {
  position: relative;
  margin: 5vh auto;
  width: min(92vw, 920px);
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}
.viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.media-viewer-stage {
  min-height: 300px;
  max-height: 72vh;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-viewer-stage img,
.media-viewer-stage video {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
}
.media-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}
.media-viewer-caption {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.audio-player {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 65;
  width: min(92vw, 380px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 12px;
}
.audio-player[hidden] {
  display: none;
}
.audio-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.audio-player-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.audio-player audio {
  width: 100%;
}

@media (max-width: 640px) {
  .gallery,
  .done-gallery {
    grid-template-columns: 1fr;
  }
  .media-viewer-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .audio-player {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 10px;
  }
}

/* ------ Footer ------ */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 40px 20px 32px;
}

/* ------ Toast ------ */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  z-index: 50;
  animation: fade-in 0.15s ease both;
}
