/* Sprint 11.2 — Gamified onboarding checklist */

.uv-onboarding {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 320px;
  max-width: calc(100% - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1d2438;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 280ms var(--uv-ease-out, ease-out),
              transform 280ms var(--uv-ease-spring, ease-out);
}
.uv-onboarding[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.uv-onboarding__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
  border-bottom: 1px solid #f0f2f6;
}
.uv-onboarding__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.uv-onboarding__close {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  color: #a0a4ad;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}
.uv-onboarding__close:hover {
  background: #f0f2f6;
  color: #1d2438;
}

.uv-onboarding__progress {
  height: 4px;
  background: #f0f2f6;
  position: relative;
  overflow: hidden;
}
.uv-onboarding__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c89a4a 0%, #e0b870 100%);
  width: 0%;
  transition: width 480ms var(--uv-ease-spring, ease-out);
}

.uv-onboarding__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
.uv-onboarding__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #3a4250;
  position: relative;
  transition: background 140ms ease;
}
.uv-onboarding__item:hover {
  background: #fbf7ef;
}
.uv-onboarding__item--done .uv-onboarding__item-text {
  color: #9aa2af;
  text-decoration: line-through;
  text-decoration-color: rgba(154, 162, 175, 0.5);
}

.uv-onboarding__check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d4d8e0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: background 220ms ease, border-color 220ms ease, transform 220ms var(--uv-ease-spring, ease-out);
}
.uv-onboarding__item--done .uv-onboarding__check {
  background: #c89a4a;
  border-color: #c89a4a;
  transform: scale(1.08);
}
.uv-onboarding__check-icon {
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity 200ms ease 120ms;
}
.uv-onboarding__item--done .uv-onboarding__check-icon {
  opacity: 1;
}
@keyframes uvOnboardingDing {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1.08); }
}
.uv-onboarding__item--just-done .uv-onboarding__check {
  animation: uvOnboardingDing 540ms var(--uv-ease-spring, ease-out);
}

.uv-onboarding__item-text { font-weight: 600; }
.uv-onboarding__item-sub  { font-size: 12px; color: #6a7280; font-weight: 400; margin-top: 2px; }

.uv-onboarding__done {
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #2f7d4e;
  background: linear-gradient(180deg, rgba(47,125,78,0.06), rgba(47,125,78,0.02));
}

/* ----------------------------------------------------------------
   Mobile chip (Sprint 13, Bug #1)
   On small screens the full card was a fixed full-width blocker over
   the hero's edit areas. Default to a compact single-line chip; tap to
   expand into a scrollable sheet with a backdrop. Hidden on desktop
   (display:none here; only revealed inside the ≤640px media query).
   ---------------------------------------------------------------- */
.uv-onboarding__chip {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: #fff;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #1d2438;
  text-align: left;
  cursor: pointer;
}
.uv-onboarding__chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, #c89a4a 0%, #e0b870 100%);
  flex-shrink: 0;
}
.uv-onboarding__chip-text { flex: 1 1 auto; }
.uv-onboarding__chip-hint {
  font-weight: 500;
  color: #8a93a3;
  flex-shrink: 0;
}

/* Backdrop shown only when the mobile sheet is expanded. Sits just below
   the panel (99999) and above page content; toolbar/floatbar stay above. */
.uv-onboarding__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 28, 0.38);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--uv-ease-out, ease-out);
}
body.uv-onboarding-open .uv-onboarding__backdrop {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 641px) {
  .uv-onboarding__backdrop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .uv-onboarding,
  .uv-onboarding__progress-fill,
  .uv-onboarding__check,
  .uv-onboarding__item--just-done .uv-onboarding__check,
  .uv-onboarding__backdrop {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .uv-onboarding {
    left: 8px;
    right: 8px;
    bottom: 12px;
    width: auto;
    max-width: none;
  }
  /* When the sticky save/CTA floatbar is visible, lift the panel above it so
     neither blocks the other (floatbar is bottom:0, ~108px tall in draft). */
  body.uv-mode-draft .uv-onboarding,
  body.is-owner-editor.uv-dirty .uv-onboarding {
    bottom: calc(124px + env(safe-area-inset-bottom, 0px));
  }

  /* Collapsed = chip only: hide the card chrome, show the chip. */
  .uv-onboarding--collapsed .uv-onboarding__head,
  .uv-onboarding--collapsed .uv-onboarding__progress,
  .uv-onboarding--collapsed .uv-onboarding__list,
  .uv-onboarding--collapsed .uv-onboarding__done {
    display: none;
  }
  .uv-onboarding--collapsed .uv-onboarding__chip { display: flex; }

  /* Expanded = scrollable sheet capped to 60vh; chip hidden. */
  .uv-onboarding--expanded {
    display: flex;
    flex-direction: column;
    max-height: min(60vh, 420px);
    overflow: hidden;
  }
  .uv-onboarding--expanded .uv-onboarding__chip { display: none; }
  .uv-onboarding--expanded .uv-onboarding__list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Tap target >= 44px for the close button on touch screens */
  .uv-onboarding__close {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}
