/* ═══════════════════════════════════════════════════════════════
   Life Snapshot AI — onboarding.css
   Onboarding overlay + PWA install banner
   Matches existing theme: Fraunces + Plus Jakarta Sans
   Terracotta × Sage × Gold palette
   ═══════════════════════════════════════════════════════════════ */

/* ── ONBOARDING OVERLAY ── */
/* Covers everything, sits above all other content */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  /* Warm blurred backdrop */
  background: rgba(245, 237, 228, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-theme="dark"] #onboarding-overlay {
  background: rgba(22, 18, 13, 0.94);
}

/* Fade-out class applied when finishing onboarding */
#onboarding-overlay.ob-hide {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

/* ── ONBOARDING CARD ── */
.ob-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(60, 30, 10, 0.18);
  max-width: 480px;
  width: 100%;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}

/* Decorative top accent bar */
.ob-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--terra), var(--sage), var(--gold));
  border-radius: 24px 24px 0 0;
}

/* ── PROGRESS DOTS ── */
.ob-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-hi);
  transition: all 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.ob-dot.active {
  background: var(--terra);
  width: 24px;
  border-radius: 4px;
}

.ob-dot.done {
  background: var(--sage);
}

/* ── STEP PANELS ── */
.ob-step {
  display: none;
  animation: ob-step-in 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.ob-step.active {
  display: block;
}

@keyframes ob-step-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── STEP CONTENT ── */
.ob-icon {
  font-size: 52px;
  display: block;
  text-align: center;
  margin-bottom: 16px;
  animation: ob-bounce 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s both;
}

@keyframes ob-bounce {
  from { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.ob-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 10px;
}

.ob-title em {
  font-style: italic;
  color: var(--terra);
}

.ob-sub {
  font-size: 14px;
  color: var(--ink3);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 28px;
  font-style: italic;
}

/* ── NAME INPUT (Step 1) ── */
.ob-input-wrap {
  margin-bottom: 24px;
}

.ob-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 8px;
}

.ob-input {
  width: 100%;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ob-input:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 4px var(--terra-soft);
}

.ob-input::placeholder {
  color: var(--ink3);
  font-style: italic;
}

/* ── HABIT CHIPS (Step 2) ── */
.ob-habits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.ob-habit-chip {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--ink2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 14px;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ob-habit-chip:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

.ob-habit-chip.selected {
  background: var(--terra-soft);
  border-color: var(--terra);
  color: var(--terra);
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(196, 103, 74, 0.18);
}

.ob-habit-chip .chip-icon {
  font-size: 18px;
}

/* ── NOTIFICATION STEP (Step 3) ── */
.ob-notif-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.ob-notif-btn {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 18px;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ob-notif-btn:hover {
  border-color: var(--sage);
  background: var(--sage-soft);
  transform: translateX(4px);
}

.ob-notif-btn .notif-icon { font-size: 22px; }
.ob-notif-btn .notif-text { flex: 1; }
.ob-notif-btn .notif-desc {
  font-size: 12px;
  color: var(--ink3);
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

/* ── FINISH STEP (Step 4) ── */
.ob-finish-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}

.ob-finish-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink2);
  padding: 10px 14px;
  background: var(--bg2);
  border-radius: 10px;
  animation: ob-step-in 0.35s ease both;
}

.ob-finish-list li:nth-child(2) { animation-delay: 0.07s; }
.ob-finish-list li:nth-child(3) { animation-delay: 0.14s; }
.ob-finish-list li:nth-child(4) { animation-delay: 0.21s; }

.ob-finish-list .fi-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* ── BUTTONS ── */
.ob-btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ob-btn-primary {
  flex: 1;
  background: var(--terra);
  border: none;
  border-radius: 100px;
  color: white;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  transition: all 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: 0 4px 16px rgba(196, 103, 74, 0.3);
  letter-spacing: 0.03em;
}

.ob-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 103, 74, 0.42);
  background: #b55a3f;
}

.ob-btn-primary:active { transform: scale(0.97); }

.ob-btn-skip {
  background: none;
  border: none;
  color: var(--ink3);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  transition: color 0.2s;
  white-space: nowrap;
}

.ob-btn-skip:hover { color: var(--ink); }

/* ── PWA INSTALL BANNER ── */
#pwa-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px); /* hidden below */
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(60, 30, 10, 0.18);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 380px;
  width: calc(100% - 40px);
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

#pwa-banner.show {
  transform: translateX(-50%) translateY(0);
}

.pwa-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.pwa-text { flex: 1; }

.pwa-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.pwa-sub {
  font-size: 12px;
  color: var(--ink3);
}

.pwa-install-btn {
  background: var(--terra);
  border: none;
  border-radius: 100px;
  color: white;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.pwa-install-btn:hover {
  background: #b55a3f;
  transform: scale(1.05);
}

.pwa-dismiss {
  background: none;
  border: none;
  color: var(--ink3);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.pwa-dismiss:hover { color: var(--ink); }

/* ── NOTIFICATION PERMISSION TOAST ── */
.notif-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 600;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(60, 30, 10, 0.15);
  padding: 16px 20px;
  max-width: 300px;
  animation: slide-in-right 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes slide-in-right {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.notif-toast-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.notif-toast-sub {
  font-size: 12px;
  color: var(--ink3);
  margin-bottom: 12px;
  line-height: 1.5;
}

.notif-toast-btn {
  background: var(--sage);
  border: none;
  border-radius: 100px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  transition: all 0.2s;
}

.notif-toast-btn:hover { background: #5a7e60; transform: scale(1.04); }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  .ob-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .ob-title { font-size: 22px; }
  .ob-habits-grid { grid-template-columns: 1fr; }

  #pwa-banner {
    flex-wrap: wrap;
    bottom: 16px;
  }
}