/* ==========================================================================
   LP03 · UNIT 5 · GET STARTED WITH GUIDED ONBOARDING — choose your path
   --------------------------------------------------------------------------
   Navy section. Centered copy, then a start node whose line forks into two
   paths, each ending at a photo card: Self-service guide · Assisted
   onboarding (the copy's own two options).
   The choice is a pair of NATIVE radio inputs (keyboard + screen readers
   for free); the cards are their <label>s. Lighting the chosen path is
   pure CSS (:has(:checked)), so it works without JS. onb.js only adds the
   entrance and lights the chosen card's guided steps in sequence.
   ========================================================================== */

.onb {
  background-color: var(--c-navy);
  color: var(--c-on-dark-body);
}

.onb__decor {
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(0, 169, 182, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 50% at 0% 100%, rgba(1, 62, 106, 0.9), transparent 70%),
    radial-gradient(ellipse 40% 40% at 100% 80%, rgba(1, 62, 106, 0.6), transparent 70%);
}

/* ---------------------------------------------------------------------------
   Copy
   --------------------------------------------------------------------------- */
.onb__copy {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
  max-inline-size: 46rem;
  margin-inline: auto;
}

.onb__copy h2 {
  color: var(--c-on-dark);
}

/* ---------------------------------------------------------------------------
   Start node + fork
   --------------------------------------------------------------------------- */
.onb__start {
  display: grid;
  place-items: center;
  inline-size: 3.5rem;
  block-size: 3.5rem;
  margin-block-start: clamp(2rem, 5vw, 3rem);
  margin-inline: auto;
  border-radius: 50%;
  background-color: var(--c-white);
  box-shadow: 0 0 0 8px rgba(0, 169, 182, 0.16), 0 0 40px rgba(0, 169, 182, 0.35);
}

.onb__start img {
  inline-size: 55%;
  block-size: auto;
}

.onb__fork {
  display: none;
}

@media (min-width: 48rem) {
  .onb__fork {
    display: block;
    inline-size: 100%;
    max-inline-size: 60rem;        /* same box as the cards → branch ends sit over their centres */
    margin-inline: auto;
    block-size: 6rem;
    overflow: visible;
  }

  [dir="rtl"] .onb__fork {
    scale: -1 1;               /* branches follow the card order */
  }
}

.onb__fork path {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.onb__fork-base {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 2;
  stroke-dasharray: 4 6;
}

/* Lit branch (non-scaling stroke keeps it crisp at any width, so it
   lights by opacity rather than a dash draw) */
.onb__fork-lit {
  stroke: var(--c-teal);
  stroke-width: 2.5;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(0, 169, 182, 0.6));
  transition: opacity 0.5s var(--ease-out);
}

/* Lit branch follows the checked radio (pure CSS) */
.onb:has(#onb-self:checked) .onb__fork-lit--self,
.onb:has(#onb-assisted:checked) .onb__fork-lit--assisted,
.onb__fork-lit--stem {
  opacity: 1;
}

/* ---------------------------------------------------------------------------
   Path choice: native radios + label cards
   --------------------------------------------------------------------------- */
.onb__choice {
  margin: 0;
  margin-block-start: var(--space-lg);
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

@media (min-width: 48rem) {
  .onb__choice {
    margin-block-start: 0;
  }
}

/* Invisible, but spread over its whole card: whatever part of the card is
   on screen, the focused radio is too — focusing it never scrolls the page */
.onb__radio {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.onb__cards {
  display: grid;
  gap: var(--space-lg);
  max-inline-size: 60rem;
  margin-inline: auto;
}

@media (min-width: 48rem) {
  .onb__cards {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
  }
}

.onb__card {
  position: relative;
  display: grid;
  border-radius: var(--r-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  cursor: pointer;
  overflow: hidden;
  opacity: 0.6;
  transform: scale(0.97);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out),
              border-color 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}

.onb__card:hover {
  opacity: 0.85;
}

/* Chosen card comes forward */
.onb:has(#onb-self:checked) .onb__card--self,
.onb:has(#onb-assisted:checked) .onb__card--assisted {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(0, 169, 182, 0.65);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 169, 182, 0.4);
}

/* Keyboard focus on the hidden radio shows on its card */
.onb:has(#onb-self:focus-visible) .onb__card--self,
.onb:has(#onb-assisted:focus-visible) .onb__card--assisted {
  outline: 3px solid var(--c-teal);
  outline-offset: 4px;
}

.onb__photo {
  position: relative;
  margin: 0;
}

.onb__photo img {
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: grayscale(0.6);
  transition: filter 0.45s var(--ease-out);
}

.onb__card--self .onb__photo img     { object-position: 70% 35%; }
.onb__card--assisted .onb__photo img { object-position: 50% 30%; }

.onb:has(#onb-self:checked) .onb__card--self .onb__photo img,
.onb:has(#onb-assisted:checked) .onb__card--assisted .onb__photo img {
  filter: none;
}

/* Radio indicator on the photo */
.onb__tick {
  position: absolute;
  inset-block-start: 0.875rem;
  inset-inline-end: 0.875rem;
  display: grid;
  place-items: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background-color: rgba(2, 17, 58, 0.35);
  color: transparent;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.onb__tick svg {
  inline-size: 1rem;
  block-size: 1rem;
}

.onb:has(#onb-self:checked) .onb__card--self .onb__tick,
.onb:has(#onb-assisted:checked) .onb__card--assisted .onb__tick {
  border-color: var(--c-teal);
  background-color: var(--c-teal);
  color: var(--c-navy);
}

/* Card body: title + guided-steps track */
.onb__body {
  display: grid;
  gap: var(--space-md);
  padding: clamp(1rem, 3vw, 1.5rem);
  justify-items: center;
  text-align: center;
}

@media (min-width: 48rem) {
  .onb__body {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: start;
    text-align: start;
  }
}

.onb__title {
  color: var(--c-on-dark);
}

.onb__photo,
.onb__body {
  display: block;
}

.onb__body {
  display: grid;
}

/* Guided steps: three icon stops joined by a line */
.onb__steps {
  position: relative;
  display: flex;
  gap: 0.6rem;
}

.onb__steps::before {
  content: "";
  position: absolute;
  inset-inline: 1rem;
  inset-block-start: 50%;
  block-size: 1px;
  background-color: rgba(255, 255, 255, 0.2);
}

.onb__step {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background-color: var(--c-navy);
  color: rgba(255, 255, 255, 0.6);
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.onb__step svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

.onb__step.is-lit,
.onb:not(.is-live):has(#onb-self:checked) .onb__card--self .onb__step,
.onb:not(.is-live):has(#onb-assisted:checked) .onb__card--assisted .onb__step {
  border-color: var(--c-teal);
  background-color: var(--c-teal);
  color: var(--c-navy);
}

/* GSAP entrance in progress (onb.js) — no CSS transitions meanwhile */
.onb__card.is-entering {
  transition: none;
}

/* ---------------------------------------------------------------------------
   Section CTA (→ hero form)
   --------------------------------------------------------------------------- */
.onb__cta {
  margin-block-start: clamp(2rem, 5vw, 3rem);
  justify-content: center;
}
