/**
 * Appily Fortyeight — Route Beacon tracker
 * New layout: centered ping hero → horizontal journey stepper → passport/result → ping chips
 */

.page-track-beacon {
  --rb-ink: #0C1A14;
  --rb-forest: #163528;
  --rb-lime: #C6F542;
  --rb-mint: #3DDC97;
  --rb-fog: #EAF6EF;
  --rb-mist: #F3FBF6;
  --rb-muted: #5F7468;
  --rb-line: rgba(12, 26, 20, 0.1);
  --rb-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rb-shadow: 0 22px 48px rgba(12, 26, 20, 0.12);
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(198, 245, 66, 0.14), transparent 55%),
    radial-gradient(700px 380px at 0% 100%, rgba(61, 220, 151, 0.1), transparent 50%),
    var(--rb-mist);
}

.page-track-beacon .page-main { padding-top: 0; }
.a48-route { padding-bottom: 0; }

.a48-route-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .65s var(--rb-ease) calc(var(--a48-delay, 0) * .08s),
              transform .65s var(--rb-ease) calc(var(--a48-delay, 0) * .08s);
}
.a48-route-reveal.is-visible { opacity: 1; transform: none; }

/* ── Hero ── */
.a48-route-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: clamp(2.6rem, 6vw, 4.25rem) 0 clamp(2.4rem, 5vw, 3.5rem);
  background: var(--rb-ink);
}

.a48-route-hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 20% 30%, rgba(198, 245, 66, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(61, 220, 151, 0.16), transparent 50%),
    linear-gradient(145deg, #0C1A14, #163528 55%, #0F241C);
  animation: rbGlow 14s ease-in-out infinite alternate;
}
@keyframes rbGlow {
  to { filter: saturate(1.1) hue-rotate(-6deg); }
}

.a48-route-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(198, 245, 66, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 245, 66, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
  animation: rbGrid 20s linear infinite;
}
@keyframes rbGrid {
  to { background-position: 48px 48px; }
}

.a48-route-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.a48-route-hero-top {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}

.a48-route-chip {
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(198, 245, 66, .45);
  background: rgba(198, 245, 66, .1);
  color: var(--rb-lime);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.a48-route-status-pill {
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .75);
}
.a48-route-status-pill.is-found {
  background: rgba(61, 220, 151, .18);
  color: var(--rb-mint);
}
.a48-route-status-pill.is-miss {
  background: rgba(255, 120, 90, .18);
  color: #ffb4a0;
}

.a48-route-hero h1 {
  margin: 0 0 .85rem;
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.a48-route-hero h1 span {
  background: linear-gradient(90deg, var(--rb-lime), var(--rb-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.a48-route-lede {
  margin: 0 auto 1.5rem;
  max-width: 48ch;
  color: rgba(234, 246, 239, .78);
  font-size: .96rem;
  line-height: 1.6;
}

/* Lookup card */
.a48-route-lookup {
  text-align: left;
  padding: 1.25rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .25);
}

.a48-route-lookup-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-bottom: 1rem;
}

.a48-route-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.a48-route-field span {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.a48-route-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  font: inherit;
  font-size: .95rem;
  padding: .85rem .95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.a48-route-field input::placeholder { color: rgba(255, 255, 255, .35); }
.a48-route-field input:focus {
  border-color: rgba(198, 245, 66, .65);
  box-shadow: 0 0 0 3px rgba(198, 245, 66, .12);
}

.a48-route-lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.a48-route-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.35rem;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s, filter .2s, background .2s, color .2s;
}
.a48-route-btn--primary {
  background: var(--rb-lime);
  color: var(--rb-ink);
}
.a48-route-btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}
.a48-route-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
}
.a48-route-btn--ghost:hover {
  border-color: var(--rb-lime);
  color: var(--rb-lime);
}

/* ── Horizontal stepper ── */
.a48-route-stepper-wrap {
  margin-top: -1.35rem;
  position: relative;
  z-index: 2;
  padding: 1.35rem 1.25rem 1.45rem;
  background: #fff;
  border: 1px solid var(--rb-line);
  border-radius: 24px;
  box-shadow: var(--rb-shadow);
}

.a48-route-stepper-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.a48-route-stepper-head h2 {
  margin: 0;
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: 1.35rem;
  color: var(--rb-ink);
}
.a48-route-stepper-head p {
  margin: 0;
  color: var(--rb-muted);
  font-size: .88rem;
}

.a48-route-stepper {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.a48-route-stepper::before,
.a48-route-stepper::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 34px;
  height: 3px;
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
}
.a48-route-stepper::before {
  background: var(--rb-fog);
}
.a48-route-stepper::after {
  width: 0;
  right: auto;
  background: linear-gradient(90deg, var(--rb-mint), var(--rb-lime));
  transition: width 1s var(--rb-ease);
}
.a48-route-stepper.is-animated::after {
  width: calc((76%) * (var(--route-pct, 0) / 100));
}

.a48-route-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .3rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s var(--rb-ease) calc(var(--node-i, 0) * .08s),
              transform .5s var(--rb-ease) calc(var(--node-i, 0) * .08s);
}
.a48-route-node.is-visible { opacity: 1; transform: none; }

.a48-route-node-orb {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rb-fog);
  border: 2px solid #fff;
  box-shadow: 0 8px 20px rgba(12, 26, 20, .08);
  position: relative;
  margin-bottom: .35rem;
  transition: transform .3s, background .3s, box-shadow .3s;
}
.a48-route-node-num {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--rb-line);
  font-size: .62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  color: var(--rb-forest);
}
.a48-route-node-icon { font-size: 1.35rem; line-height: 1; }

.a48-route-node strong {
  font-size: .88rem;
  color: var(--rb-ink);
}
.a48-route-node-place {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rb-mint);
}
.a48-route-node small {
  font-size: .75rem;
  color: var(--rb-muted);
}

.a48-route-node.is-done .a48-route-node-orb,
.a48-route-node.is-current .a48-route-node-orb {
  background: var(--rb-lime);
  box-shadow: 0 0 0 6px rgba(198, 245, 66, .18), 0 12px 24px rgba(12, 26, 20, .12);
}
.a48-route-node.is-current .a48-route-node-orb {
  animation: rbNodePulse 1.8s ease-out infinite;
}
@keyframes rbNodePulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(198, 245, 66, .18), 0 12px 24px rgba(12, 26, 20, .12); }
  50% { box-shadow: 0 0 0 12px rgba(198, 245, 66, 0), 0 12px 24px rgba(12, 26, 20, .12); }
}
.a48-route-node.is-muted { opacity: .55; }
.a48-route-node.is-muted.is-visible { opacity: .55; }

/* ── Result stage ── */
.a48-route-stage {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.a48-route-passport {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--rb-line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--rb-shadow);
}

.a48-route-passport-side {
  padding: 1.75rem 1.35rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(198, 245, 66, .2), transparent 50%),
    linear-gradient(165deg, var(--rb-forest), var(--rb-ink));
  color: #fff;
  text-align: center;
}

.a48-route-ring {
  --pct: 0;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, var(--rb-ink) 78%, transparent 79% 100%),
    conic-gradient(var(--rb-lime) calc(var(--pct) * 1%), rgba(255, 255, 255, .12) 0);
  display: grid;
  place-items: center;
  animation: rbRingIn 1s var(--rb-ease);
}
@keyframes rbRingIn {
  from { filter: saturate(.6); transform: scale(.92); }
  to { filter: none; transform: none; }
}
.a48-route-ring-core {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(12, 26, 20, .85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
}
.a48-route-ring-core strong {
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: 1.75rem;
  color: var(--rb-lime);
  line-height: 1;
}
.a48-route-ring-core span {
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}

.a48-route-passport-kicker {
  margin: 0 0 .35rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rb-lime);
}
.a48-route-passport-side h2 {
  margin: 0 0 .55rem;
  font-size: 1.15rem;
  word-break: break-word;
}
.a48-route-passport-status {
  display: inline-block;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(61, 220, 151, .18);
  color: var(--rb-mint);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.a48-route-passport-body {
  padding: 1.5rem 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.a48-route-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
}
.a48-route-facts div {
  padding: .9rem .95rem;
  border-radius: 16px;
  background: var(--rb-mist);
  border: 1px solid var(--rb-line);
}
.a48-route-facts--wide { grid-column: 1 / -1; }
.a48-route-facts dt {
  margin: 0 0 .25rem;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rb-muted);
}
.a48-route-facts dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rb-ink);
  word-break: break-word;
}

.a48-route-passport-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.a48-route-passport-actions .a48-route-btn--ghost {
  color: var(--rb-ink);
  border-color: var(--rb-line);
  background: #fff;
}
.a48-route-passport-actions .a48-route-btn--ghost:hover {
  border-color: var(--rb-mint);
  color: var(--rb-forest);
}

/* Idle / miss panels */
.a48-route-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.6rem 1.5rem;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--rb-line);
  box-shadow: var(--rb-shadow);
}
.a48-route-panel h2 {
  margin: 0 0 .45rem;
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: 1.45rem;
  color: var(--rb-ink);
}
.a48-route-panel p {
  margin: 0 0 1rem;
  color: var(--rb-muted);
  max-width: 52ch;
}

.a48-route-panel-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  background: #ffe8e2;
  color: #c44a2f;
}

.a48-route-radar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(61, 220, 151, .35);
  display: grid;
  place-items: center;
  position: relative;
}
.a48-route-radar::before,
.a48-route-radar::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(198, 245, 66, .45);
  animation: rbRadar 3.2s linear infinite;
}
.a48-route-radar::after {
  inset: 24px;
  animation-duration: 2.2s;
  animation-direction: reverse;
}
.a48-route-radar span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rb-lime);
  box-shadow: 0 0 0 0 rgba(198, 245, 66, .5);
  animation: rbRadarDot 1.8s ease-out infinite;
}
@keyframes rbRadar {
  to { transform: rotate(360deg); }
}
@keyframes rbRadarDot {
  70% { box-shadow: 0 0 0 14px rgba(198, 245, 66, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 245, 66, 0); }
}

.a48-route-hints {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.a48-route-hints li {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--rb-muted);
  font-size: .9rem;
}
.a48-route-hints span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 800;
  background: var(--rb-fog);
  color: var(--rb-forest);
}

.a48-route-idle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.a48-route-idle-grid div {
  padding: .85rem .9rem;
  border-radius: 14px;
  background: var(--rb-mist);
  border: 1px solid var(--rb-line);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.a48-route-idle-grid strong {
  font-family: var(--a48-font-serif, Georgia, serif);
  color: var(--rb-forest);
  font-size: 1.1rem;
}
.a48-route-idle-grid span {
  font-size: .8rem;
  color: var(--rb-muted);
  line-height: 1.4;
}

.a48-route-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.a48-route-panel-actions .a48-route-btn--ghost {
  color: var(--rb-ink);
  border-color: var(--rb-line);
  background: #fff;
}

/* ── Ping chips ── */
.a48-route-pings {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 2rem;
}

.a48-route-ping {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .55rem;
  padding: .9rem .95rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--rb-line);
  transition: transform .3s var(--rb-ease), border-color .25s, box-shadow .3s;
}
.a48-route-ping.is-pending {
  opacity: 0;
  transform: translateY(14px);
}
.a48-route-ping.is-visible {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 60ms);
}
.a48-route-ping:hover {
  transform: translateY(-3px);
  border-color: rgba(61, 220, 151, .45);
  box-shadow: 0 14px 28px rgba(12, 26, 20, .08);
}
.a48-route-ping-code {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  padding: .4rem .45rem;
  border-radius: 8px;
  background: var(--rb-fog);
  color: var(--rb-forest);
}
.a48-route-ping strong {
  font-size: .85rem;
  color: var(--rb-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.a48-route-ping-go {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rb-ink);
  color: var(--rb-lime);
  font-size: .85rem;
}
.a48-route-ping--mail { grid-column: span 1; }

/* ── Foot band ── */
.a48-route-foot {
  background: var(--rb-ink);
  color: #fff;
  padding: 1.25rem 0;
}
.a48-route-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.a48-route-foot-inner strong {
  display: block;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rb-lime);
  margin-bottom: .2rem;
}
.a48-route-foot-inner span,
.a48-route-foot-inner a {
  color: rgba(255, 255, 255, .8);
  font-size: .9rem;
}
.a48-route-foot-inner a:hover { color: var(--rb-lime); }

@media (prefers-reduced-motion: reduce) {
  .a48-route-hero-glow,
  .a48-route-hero-grid,
  .a48-route-node.is-current .a48-route-node-orb,
  .a48-route-radar::before,
  .a48-route-radar::after,
  .a48-route-radar span,
  .a48-route-ring { animation: none !important; }
  .a48-route-reveal,
  .a48-route-ping.is-pending,
  .a48-route-node { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
  .a48-route-lookup-fields { grid-template-columns: 1fr; }
  .a48-route-stepper { grid-template-columns: 1fr 1fr; gap: 1.1rem; }
  .a48-route-stepper-line { display: none; }
  .a48-route-passport { grid-template-columns: 1fr; }
  .a48-route-facts { grid-template-columns: 1fr 1fr; }
  .a48-route-idle-grid { grid-template-columns: 1fr; }
  .a48-route-pings { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .a48-route-stepper { grid-template-columns: 1fr; }
  .a48-route-panel { grid-template-columns: 1fr; text-align: center; }
  .a48-route-panel-mark,
  .a48-route-radar { margin-inline: auto; }
  .a48-route-hints li { justify-content: center; }
  .a48-route-panel-actions,
  .a48-route-passport-actions { justify-content: center; }
  .a48-route-pings { grid-template-columns: 1fr; }
  .a48-route-facts { grid-template-columns: 1fr; }
  .a48-route-foot-inner { flex-direction: column; align-items: flex-start; }
}
