/* ---------- Onboarding walkthrough (premium glass + glow) ---------- */
body.onb-active{ overflow:hidden; }

.onb-root{
  position:fixed; inset:0; z-index:999;
  font-family:inherit;
}
.onb-root.onb-closing{ opacity:0; transition:opacity .2s ease; }
.onb-root.onb-closing .onb-card{ transform:scale(.94) translateY(6px); }

.onb-dim{
  position:absolute; inset:0;
  background:radial-gradient(120% 120% at 50% 0%, rgba(14,59,54,.5), rgba(4,8,7,.78));
  backdrop-filter:blur(2.5px);
  -webkit-backdrop-filter:blur(2.5px);
  animation:onbFadeIn .25s ease both;
}

/* The spotlight "hole": a transparent box whose oversized box-shadow darkens
   everything else on screen, leaving only this rect naturally lit. */
.onb-spot{
  position:fixed;
  border-radius:16px;
  box-shadow:0 0 0 9999px rgba(6,10,9,.72), 0 0 26px 4px rgba(192,151,58,.35);
  border:2px solid var(--gold, #C0973A);
  transition:top .32s cubic-bezier(.34,1.4,.4,1), left .32s cubic-bezier(.34,1.4,.4,1),
             width .32s cubic-bezier(.34,1.4,.4,1), height .32s cubic-bezier(.34,1.4,.4,1);
  pointer-events:none;
}

/* A soft breathing ring around the spotlighted element for extra polish. */
.onb-pulse{
  position:fixed;
  border-radius:20px;
  border:1.5px solid var(--gold, #C0973A);
  opacity:.55;
  pointer-events:none;
  transition:top .32s cubic-bezier(.34,1.4,.4,1), left .32s cubic-bezier(.34,1.4,.4,1),
             width .32s cubic-bezier(.34,1.4,.4,1), height .32s cubic-bezier(.34,1.4,.4,1);
  animation:onbBreathe 1.8s ease-in-out infinite;
}

@keyframes onbBreathe{
  0%, 100%{ transform:scale(1); opacity:.5; }
  50%{ transform:scale(1.07); opacity:0; }
}
@keyframes onbFadeIn{ from{ opacity:0; } to{ opacity:1; } }

.onb-card{
  position:fixed;
  width:min(330px, 88vw);
  background:linear-gradient(180deg, color-mix(in srgb, var(--parchment, #FBF6EC) 96%, white), var(--parchment, #FBF6EC));
  color:var(--ink, #1E2A26);
  border:1px solid var(--line, #D8CDB0);
  border-radius:max(var(--radius, 14px), 18px);
  box-shadow:0 24px 60px -12px rgba(0,0,0,.45), 0 2px 0 rgba(255,255,255,.5) inset;
  padding:18px 20px 20px;
  transition:top .3s cubic-bezier(.4,0,.2,1), left .3s cubic-bezier(.4,0,.2,1);
  overflow:hidden;
  animation:onbCardIn .32s cubic-bezier(.2,.9,.3,1.2) both;
}

@keyframes onbCardIn{
  from{ opacity:0; transform:scale(.92) translateY(8px); }
  to{ opacity:1; transform:scale(1) translateY(0); }
}

/* Replays a gentle pop whenever the step content changes. */
.onb-card.onb-pop .onb-title,
.onb-card.onb-pop .onb-text,
.onb-card.onb-pop .onb-icon-badge{
  animation:onbContentIn .3s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes onbContentIn{
  from{ opacity:0; transform:translateY(5px); }
  to{ opacity:1; transform:translateY(0); }
}

/* Subtle rotating gold sheen behind the card — barely visible, gives the
   whole widget a premium "living" feel without being distracting. */
.onb-card-glow{
  position:absolute; inset:-40%;
  background:conic-gradient(from 0deg, transparent 0deg, rgba(192,151,58,.16) 60deg, transparent 140deg);
  animation:onbSpin 7s linear infinite;
  pointer-events:none;
  z-index:0;
}
@keyframes onbSpin{ to{ transform:rotate(360deg); } }

.onb-card > *{ position:relative; z-index:1; }

/* Small triangular pointer on the card, aimed at the highlighted element. */
.onb-card::after{
  content:'';
  position:absolute;
  width:14px; height:14px;
  background:var(--parchment, #FBF6EC);
  border:1px solid var(--line, #D8CDB0);
  display:none;
  z-index:1;
}
.onb-card.onb-arrow-top::after{
  display:block; top:-8px; left:var(--onb-arrow-x, 24px);
  border-right:none; border-bottom:none;
  transform:translateX(-50%) rotate(45deg);
}
.onb-card.onb-arrow-bottom::after{
  display:block; bottom:-8px; left:var(--onb-arrow-x, 24px);
  border-left:none; border-top:none;
  transform:translateX(-50%) rotate(45deg);
}

.onb-card-head{
  display:flex; align-items:center; gap:10px;
  margin-bottom:10px;
}
.onb-icon-badge{
  width:34px; height:34px; border-radius:11px; flex:none;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(145deg, var(--teal, #0E3B36), var(--teal-deep, #092723));
  color:var(--gold-soft, #E8D6A8);
  font-size:14px;
  box-shadow:0 4px 10px -3px rgba(0,0,0,.4), 0 0 0 1px rgba(192,151,58,.25) inset;
}
.onb-step-count{
  font-size:12px; font-weight:700; color:var(--ink-soft, #4B5A54);
  letter-spacing:.03em;
  background:var(--sage, #DCE6DE);
  padding:3px 9px; border-radius:999px;
}
.onb-skip{
  margin-left:auto;
  display:flex; align-items:center; gap:5px;
  border:none; background:none; cursor:pointer;
  font-size:12px; color:var(--ink-soft, #4B5A54);
  padding:5px 9px; border-radius:8px;
  transition:background .15s ease, color .15s ease;
}
.onb-skip i{ font-size:10px; }
.onb-skip:hover{ background:var(--sage, #DCE6DE); color:var(--ink, #1E2A26); }

.onb-title{
  margin:2px 0 6px; font-size:17px; font-weight:700;
  color:var(--teal, #0E3B36);
}
.onb-text{
  margin:0 0 14px; font-size:14px; line-height:1.6;
  color:var(--ink, #1E2A26);
}

/* Step dots — used for tours with 8 or fewer steps (see onbRenderDots). */
.onb-dots{
  display:flex; align-items:center; gap:6px;
  margin-bottom:10px;
}
.onb-dot{
  width:6px; height:6px; border-radius:50%;
  background:var(--sage, #DCE6DE);
  transition:all .25s cubic-bezier(.4,0,.2,1);
}
.onb-dot.done{ background:var(--gold, #C0973A); }
.onb-dot.active{
  width:18px; border-radius:4px;
  background:var(--teal, #0E3B36);
}

.onb-progress{
  height:4px; border-radius:2px; background:var(--sage, #DCE6DE);
  overflow:hidden; margin-bottom:14px;
}
.onb-progress-fill{
  height:100%; border-radius:2px; transition:width .3s cubic-bezier(.4,0,.2,1);
  background:linear-gradient(90deg, var(--teal, #0E3B36), var(--gold, #C0973A));
  background-size:200% 100%;
  animation:onbShimmer 2.4s linear infinite;
}
@keyframes onbShimmer{
  0%{ background-position:0% 0; }
  100%{ background-position:-200% 0; }
}

.onb-actions{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.onb-actions button{
  display:flex; align-items:center; gap:6px;
  border:none; cursor:pointer; font-weight:600; font-size:14px;
  padding:10px 18px; border-radius:999px;
  transition:transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.onb-actions button:active{ transform:scale(.95); }
.onb-actions button i{ font-size:11px; }

.onb-prev{
  background:none; color:var(--ink-soft, #4B5A54);
  padding-left:8px;
}
.onb-prev:hover{ color:var(--ink, #1E2A26); }

.onb-next{
  background:linear-gradient(145deg, var(--teal, #0E3B36), var(--teal-deep, #092723));
  color:var(--gold-soft, #E8D6A8);
  margin-left:auto;
  box-shadow:0 6px 16px -6px rgba(0,0,0,.5), 0 0 0 1px rgba(192,151,58,.25) inset;
  flex-direction:row-reverse;
}
.onb-next:hover{ filter:brightness(1.1); }
.onb-next.onb-next-final{
  background:linear-gradient(145deg, var(--gold, #C0973A), #9c7526);
  color:var(--teal-deep, #092723);
}

/* Little celebratory flourish on the final step of a tour. */
.onb-card.onb-celebrate .onb-icon-badge{
  background:linear-gradient(145deg, var(--gold, #C0973A), #9c7526);
  color:var(--teal-deep, #092723);
  animation:onbCelebrate 1.1s ease-in-out infinite;
}
@keyframes onbCelebrate{
  0%, 100%{ transform:scale(1) rotate(0deg); }
  50%{ transform:scale(1.12) rotate(-6deg); }
}

@media (max-width:380px){
  .onb-card{ padding:16px 14px 16px; }
  .onb-title{ font-size:16px; }
  .onb-text{ font-size:13.5px; }
}

@media (prefers-reduced-motion:reduce){
  .onb-card, .onb-dim, .onb-pulse, .onb-card-glow, .onb-progress-fill, .onb-icon-badge{
    animation:none !important;
    transition:none !important;
  }
}
