/* onboarding.css: the client onboarding funnel (charleslesula.com/onboarding).
   Laid out like the Apex MD onboarding pages: five steps, one at a time, everything centered.
   Each step: a pill, the title, one line, the video, two sentences, then the buttons.
   Builds on tokens.css, base.css and components.css (buttons). */

/* ---------- Page ---------- */
.ob-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% -8%, rgba(229, 37, 33, 0.26), transparent 70%),
    radial-gradient(45% 35% at 100% 100%, var(--glow-soft), transparent 70%);
}

.ob-wrap {
  position: relative;
  z-index: var(--z-content);
  width: min(100% - 40px, 952px);
  margin-inline: auto;
  padding:
    calc(var(--space-6) + env(safe-area-inset-top)) 0
    calc(var(--space-8) + env(safe-area-inset-bottom));
  text-align: center;
}

/* The name at the top, centered like a logo */
.ob-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-7);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: var(--track-tight);
  text-decoration: none;
}
.ob-brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--glow); }

/* ---------- One step ---------- */
.ob-step { display: grid; justify-items: center; gap: var(--space-5); }
/* With JavaScript, only the current step shows. Without it, every step stays visible, top to bottom
   (steps 2 to 5 carry the hidden attribute in the HTML, so the first paint only shows step 1). */
html.ob-js .ob-step[hidden] { display: none; }
html:not(.ob-js) .ob-step[hidden] { display: grid; }
html.ob-js .ob-step.is-entering { animation: ob-in var(--dur-slow) var(--ease-out) both; }
html.motion-off .ob-step.is-entering { animation: none; }
@keyframes ob-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html:not(.ob-js) .ob-step + .ob-step { margin-top: var(--space-9); }

/* "Client onboarding | Step 1 of 5" */
.ob-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.ob-pill-step { padding-left: 0.75rem; border-left: 1px solid var(--line-strong); color: var(--red-text); }

/* "Video 1: Welcome", with the video's name in red */
.ob-title {
  max-width: 820px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.ob-title span { color: var(--red-text); }
.ob-title:focus { outline: none; }
.ob-sub { max-width: 640px; margin-top: calc(var(--space-2) * -1); font-size: var(--fs-lead); line-height: 1.5; color: var(--text-muted); text-wrap: balance; }

/* ---------- The video ----------
   A red gradient until the real video exists, with a play button and a "coming soon" pill.
   Paste a Loom, YouTube, Vimeo or .mp4 link into data-video and it plays right here instead. */
.ob-video {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: var(--space-2);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(50% 70% at 50% 46%, rgba(229, 37, 33, 0.42), transparent 72%),
    radial-gradient(45% 65% at 92% 100%, rgba(122, 14, 12, 0.55), transparent 70%),
    radial-gradient(40% 55% at 6% 0%, rgba(122, 14, 12, 0.4), transparent 70%),
    linear-gradient(160deg, #1b0b0c, #0b0b0e 55%, #13080a);
  box-shadow: 0 40px 90px -45px var(--glow), 0 0 0 6px rgba(255, 255, 255, 0.02);
}
.ob-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(60px, 9vw, 76px);
  height: clamp(60px, 9vw, 76px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: var(--on-red);
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(229, 37, 33, 0.16), 0 18px 50px -10px var(--glow);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.ob-play:hover { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 0 14px rgba(229, 37, 33, 0.2), 0 20px 60px -10px var(--glow); }
.ob-play:active { transform: translate(-50%, -50%) scale(0.97); }
.ob-play svg { width: 38%; height: 38%; margin-left: 6%; }
/* A slow ring around the play button. Reduce Motion turns it off (base.css). */
.ob-play::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(229, 37, 33, 0.45);
  border-radius: 50%;
  animation: ob-ring 2.4s var(--ease-out) infinite;
}
@keyframes ob-ring { from { opacity: 0.9; transform: scale(0.92); } to { opacity: 0; transform: scale(1.35); } }
html.motion-off .ob-play::after { animation: none; opacity: 0; }

/* "Video coming soon", along the bottom. It goes away once a link is in data-video. */
.ob-soon {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3vw, 24px);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(7, 7, 10, 0.6);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(245, 245, 247, 0.85);
  transform: translateX(-50%);
}
.ob-soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--glow); }
.ob-video:not([data-video=""]) .ob-soon { display: none; }
/* Pressing play on a placeholder gives the pill a small shake, so the press visibly did something */
.ob-soon.is-nudged { animation: ob-nudge 0.45s var(--ease-out); }
@keyframes ob-nudge {
  0%, 100% { transform: translateX(-50%); }
  25% { transform: translateX(calc(-50% - 5px)); }
  75% { transform: translateX(calc(-50% + 5px)); }
}

/* The red dot in the corner, like a channel logo */
.ob-mark {
  position: absolute;
  right: clamp(14px, 3vw, 22px);
  bottom: clamp(14px, 3vw, 22px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(229, 37, 33, 0.18), 0 0 14px var(--glow);
}

/* A real video, once there is one. While it plays, the placeholder layers step aside. */
.ob-video iframe, .ob-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.ob-video.is-playing > :not(iframe):not(video) { display: none; }

/* ---------- The two sentences under the video ---------- */
.ob-text { max-width: 640px; margin-top: var(--space-2); font-size: 1.125rem; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; }
.ob-text strong { color: var(--text); font-weight: 600; }

/* The step's one task (step 3: the intake form), as an outlined pill */
.ob-task { --btn-h: 52px; border-color: rgba(255, 90, 84, 0.5); color: var(--red-text); }
.ob-task:hover { border-color: var(--red); background: rgba(229, 37, 33, 0.08); }

/* ---------- Back and Next ---------- */
.ob-nav { display: flex; justify-content: center; gap: var(--space-3); width: 100%; }
.ob-nav .btn { --btn-h: 56px; min-width: 150px; font-size: 1rem; }
/* Without JavaScript there are no steps to move between, so Back and Next hide */
html:not(.ob-js) [data-next], html:not(.ob-js) [data-back] { display: none; }
/* On phones the buttons fill the row: one button takes all of it, two split it */
@media (max-width: 600px) {
  .ob-nav .btn { flex: 1; min-width: 0; }
  .ob-task { width: 100%; }
}

/* Back's arrow nudges left on hover, the way Next's nudges right (components.css) */
.ob-back-arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .ob-back-arrow { transform: translateX(-3px); }
