/* Journey Navigation Bar — stage progress indicator styles
   Used by the authenticated app bar (header.app-bar).
   Class schema matches the handoff doc: .stages > .stage[.done|.active]
*/

/* ─── Authenticated app bar ───────────────────────────────────────────────────
   Single bar replacing site-header + journey-nav for signed-in users.
   Layout: [ logo ] [ stages (flex-grow) ] [ account actions ]
   ──────────────────────────────────────────────────────────────────────────── */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  background: color-mix(in srgb, var(--bp-paper) 80%, transparent);
  border-bottom: 1px solid var(--bp-rule);
}

.app-bar__inner {
  display: flex;
  align-items: center;
}

/* Logo */
.app-bar .brand {
  flex-shrink: 0;
  padding-right: var(--bp-s-3);
}

/* Stages list — grows to fill available space between logo and account */
.app-bar__stages {
  flex: 1 1 auto;
  min-width: 0;
}

/* Account actions (Profile, Log out) */
nav.account {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

nav.account a {
  display: flex;
  align-items: center;
  padding: var(--bp-s-2) var(--bp-s-3);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--bp-ink-muted);
  text-decoration: none;
  transition: background var(--bp-dur-fast) var(--bp-easing),
              color var(--bp-dur-fast) var(--bp-easing);
}

nav.account a:hover {
  background: color-mix(in srgb, var(--bp-ink) 5%, transparent);
  color: var(--bp-ink);
}

nav.account a:focus-visible {
  outline: 2px solid var(--bp-accent);
  outline-offset: -2px;
}

/* Medium viewports: collapse stage names to badge-only.
   Names stay in the DOM so screen readers still have labels (badge is aria-hidden). */
@media (max-width: 1024px) {
  .app-bar__stages .stage > a > span:last-child,
  .app-bar__stages .stage > span > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .app-bar__stages .stage {
    flex: 1 1 0;
  }

  .app-bar__stages .stage > a,
  .app-bar__stages .stage > span {
    justify-content: center;
    padding: var(--bp-s-2) var(--bp-s-1);
  }

  .app-bar__stages .stages {
    overflow-x: visible;
  }
}

@media (max-width: 640px) {
  .app-bar .brand {
    padding-right: var(--bp-s-1);
  }

  nav.account a {
    padding: var(--bp-s-2) var(--bp-s-2);
  }
}

/* ─── Stage list ─────────────────────────────────────────────────────────────── */

.stages {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 0;
}

.stages::-webkit-scrollbar {
  display: none;
}

/* Each stage item */
.stage {
  flex: 0 0 auto;
  position: relative;
}

/* Divider between stages */
.stage + .stage::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: var(--bp-rule-soft);
}

/* Inner content — both <a> and <span> share layout */
.stage > a,
.stage > span {
  display: flex;
  align-items: center;
  gap: var(--bp-s-2);
  padding: var(--bp-s-2) var(--bp-s-3);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--bp-ink-muted);
  transition: background var(--bp-dur-fast) var(--bp-easing),
              color var(--bp-dur-fast) var(--bp-easing);
}

.stage > a:hover {
  background: color-mix(in srgb, var(--bp-ink) 5%, transparent);
  color: inherit;
  text-decoration: none;
}

/* Number / checkmark badge */
.stage .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--bp-mono-family);
  flex-shrink: 0;
  background: var(--bp-surface-2);
  color: var(--bp-ink-muted);
}

/* In progress — active */
.stage.active > a,
.stage.active > span {
  color: var(--bp-accent);
}

.stage.active .num {
  background: var(--bp-accent);
  color: var(--bp-accent-ink);
}

.stage.active > a > span:last-child,
.stage.active > span > span:last-child {
  font-weight: 600;
}

/* Complete — done */
.stage.done > a,
.stage.done > span {
  color: var(--bp-success);
}

.stage.done .num {
  background: var(--bp-success);
  color: var(--bp-accent-ink);
}

/* Focus ring */
.stage > a:focus-visible {
  outline: 2px solid var(--bp-accent);
  outline-offset: -2px;
}
