/*
  Auth stage: the premium, animated layout for sign-in and registration.
  Loaded by auth_base.html after gj-auth.css. Scoped to .gj-stage / .gj-stage-backdrop.
  Motion uses transform and opacity only and is switched off under prefers-reduced-motion.
*/

.gj-auth {
  --stage-ink-on-glow: #04201d;
  --stage-radius: 22px;
  --stage-ease: cubic-bezier(.22, 1, .36, 1);
  --stage-spring: cubic-bezier(.34, 1.56, .64, 1);
  --stage-elev-3: 0 40px 90px -30px rgb(9 14 22 / .45), 0 12px 30px -18px rgb(9 14 22 / .25);
}

/* ---------- Auth navbar (auth_navbar.html) ---------- */
.gj-authbar {
  position: sticky;
  top: .75rem;
  z-index: 1030;
  width: min(1140px, calc(100% - 1.5rem));
  margin: .75rem auto 0;
  overflow: hidden;
  color: var(--gj-color-text);
  background: color-mix(in srgb, var(--gj-color-surface) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 75%, transparent);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgb(16 24 40 / .05), 0 12px 32px -18px rgb(16 24 40 / .28);
  backdrop-filter: saturate(170%) blur(16px);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
  view-transition-name: gj-authbar;
  animation: gj-authbar-in .6s var(--stage-ease) both;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.gj-authbar.is-scrolled { background: color-mix(in srgb, var(--gj-color-surface) 88%, transparent); box-shadow: 0 2px 4px rgb(16 24 40 / .06), 0 18px 40px -18px rgb(16 24 40 / .35); }
[data-bs-theme="dark"] .gj-authbar { box-shadow: 0 12px 32px -18px rgb(0 0 0 / .6), inset 0 1px 0 rgb(255 255 255 / .05); }
.gj-authbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .6rem .55rem .75rem; }

.gj-authbar__brand { display: flex; align-items: center; gap: .7rem; min-width: 0; color: inherit; text-decoration: none; }
.gj-authbar__logo {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 80%, transparent);
  border-radius: 13px;
  box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--app-context) 60%, transparent);
  transition: transform .3s var(--stage-spring);
}
.gj-authbar__logo img { width: 32px; height: 32px; object-fit: contain; }
.gj-authbar__logo::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .85) 50%, transparent 65%);
  transform: translateX(-120%);
}
.gj-authbar__brand:hover .gj-authbar__logo { transform: rotate(-6deg) scale(1.05); }
.gj-authbar__brand:hover .gj-authbar__logo::after { transition: transform .8s var(--stage-ease); transform: translateX(120%); }
.gj-authbar__name { display: grid; min-width: 0; line-height: 1.15; }
.gj-authbar__name strong { font-size: 1rem; font-weight: 850; letter-spacing: -.01em; }
.gj-authbar__name small { overflow: hidden; color: var(--gj-color-muted); font-size: .66rem; font-weight: 750; letter-spacing: .1em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.gj-authbar__brand:focus-visible { border-radius: 14px; outline: 3px solid color-mix(in srgb, var(--app-context) 45%, transparent); outline-offset: 3px; }

.gj-authbar__actions { display: flex; flex: 0 0 auto; align-items: center; gap: .5rem; }
.gj-authbar__switch {
  position: relative;
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  padding: 4px;
  background: color-mix(in srgb, var(--gj-color-surface-muted) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 80%, transparent);
  border-radius: 999px;
}
.gj-authbar__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: linear-gradient(135deg, var(--app-context), var(--app-context-dark));
  border-radius: 999px;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--app-context) 75%, transparent);
  opacity: 0;
  view-transition-name: gj-authbar-indicator;
  transition: transform .45s var(--stage-spring), opacity .2s ease;
}
[data-bs-theme="dark"] .gj-authbar__indicator { background: linear-gradient(135deg, var(--app-context-glow), color-mix(in srgb, var(--app-context-glow) 70%, var(--app-context-accent2))); }
.gj-authbar__switch[data-active="signin"] .gj-authbar__indicator { opacity: 1; transform: translateX(0); }
.gj-authbar__switch[data-active="register"] .gj-authbar__indicator { opacity: 1; transform: translateX(100%); }
.gj-authbar__tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem .95rem;
  color: var(--gj-color-muted);
  font-size: .86rem;
  font-weight: 750;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 999px;
  transition: color .2s ease;
}
.gj-authbar__tab:hover { color: var(--gj-color-text); }
/* Sign Out is a POST button (CSRF), drawn exactly like the link tabs. */
button.gj-authbar__tab { background: none; border: 0; font-family: inherit; line-height: inherit; cursor: pointer; }
.gj-authbar__tab[aria-current="page"] { color: #fff; }
[data-bs-theme="dark"] .gj-authbar__tab[aria-current="page"] { color: var(--stage-ink-on-glow); }
.gj-authbar__tab i { transition: transform .25s var(--stage-spring); }
.gj-authbar__tab:hover i { transform: translateX(2px) scale(1.08); }
.gj-authbar__tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-context) 45%, transparent); outline-offset: 1px; }

.gj-authbar__theme {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--gj-color-text);
  background: color-mix(in srgb, var(--gj-color-surface-muted) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 80%, transparent);
  border-radius: 50%;
  transition: transform .2s ease, border-color .2s ease;
}
.gj-authbar__theme:hover { border-color: color-mix(in srgb, var(--app-context) 45%, var(--gj-color-border)); transform: translateY(-1px); }
.gj-authbar__theme:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-context) 45%, transparent); outline-offset: 2px; }
.gj-authbar__theme i { display: inline-block; transition: transform .5s var(--stage-spring); }
.gj-authbar__theme:active i { transform: rotate(160deg) scale(.85); }
[data-bs-theme="dark"] .gj-authbar__theme i { color: var(--app-context-accent2); }

.gj-authbar__beam { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; overflow: hidden; pointer-events: none; }
.gj-authbar__beam::before {
  position: absolute;
  inset: 0;
  width: 30%;
  content: "";
  background: linear-gradient(90deg, transparent, var(--app-context-glow), var(--app-context-accent2), transparent);
  animation: gj-stage-beam 6.5s var(--stage-ease) 1s infinite;
}

/* The auth navbar replaces the legacy bootstrap one on auth pages. */
.gj-auth .gj-auth-messages:empty { display: none; }

@media (max-width: 575.98px) {
  .gj-authbar__name small { display: none; }
  .gj-authbar__tab { padding: .5rem .7rem; }
  .gj-authbar__tab i { display: none; }
}
.gj-authbar__short { display: none; }
@media (max-width: 479.98px) {
  .gj-authbar__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gj-authbar__short { display: inline; }
  .gj-authbar__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gj-authbar__tab span { font-size: .8rem; }
}

/* ---------- Living backdrop (every auth page) ---------- */
/* One canvas behind the navbar and the page, so no band shows under the floating bar. */
body.gj-auth {
  background:
    radial-gradient(circle at top left, rgba(20, 163, 154, .14), transparent 34rem),
    linear-gradient(135deg, #eef4f6 0%, #f8fafc 52%, #edf3f0 100%) fixed;
}
[data-bs-theme="dark"] body.gj-auth {
  background:
    radial-gradient(circle at top left, rgba(20, 163, 154, .18), transparent 34rem),
    linear-gradient(135deg, #0f151b 0%, #121a22 52%, #111816 100%) fixed;
}
.gj-auth .gj-auth-main { position: relative; isolation: isolate; overflow: hidden; background: transparent !important; }

.gj-stage-backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.gj-stage-backdrop__orb {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .34;
  will-change: transform;
}
.gj-stage-backdrop__orb--a { top: -18vmax; left: -12vmax; background: radial-gradient(circle, var(--app-context-glow), transparent 68%); animation: gj-stage-drift-a 26s ease-in-out infinite alternate; }
.gj-stage-backdrop__orb--b { right: -16vmax; bottom: -20vmax; background: radial-gradient(circle, var(--app-context), transparent 66%); animation: gj-stage-drift-b 32s ease-in-out infinite alternate; }
.gj-stage-backdrop__orb--c { top: 30%; left: 45%; width: 28vmax; height: 28vmax; opacity: .18; background: radial-gradient(circle, var(--app-context-accent2), transparent 66%); animation: gj-stage-drift-c 38s ease-in-out infinite alternate; }
.gj-stage-backdrop__grid {
  position: absolute;
  inset: 0;
  opacity: .5;
  background: radial-gradient(circle, color-mix(in srgb, var(--gj-color-text) 14%, transparent) 1px, transparent 1.6px) 0 0 / 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000, transparent 75%);
}
[data-bs-theme="dark"] .gj-stage-backdrop__orb { opacity: .26; }
[data-bs-theme="dark"] .gj-stage-backdrop__orb--c { opacity: .12; }

/* ---------- Stage shell ---------- */
.gj-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: calc(100vh - 128px);
  padding: clamp(1rem, 3vw, 2.25rem);
}

.gj-stage__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  width: min(1140px, 100%);
  overflow: hidden;
  color: var(--gj-color-text);
  background: color-mix(in srgb, var(--gj-color-surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 80%, transparent);
  border-radius: var(--stage-radius);
  box-shadow: var(--stage-elev-3);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  animation: gj-stage-enter .7s var(--stage-ease) both;
}
.gj-stage__shell--wide { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
[data-bs-theme="dark"] .gj-stage__shell { box-shadow: var(--stage-elev-3), inset 0 1px 0 rgb(255 255 255 / .05); }

/* ---------- Live brand panel ---------- */
.gj-stage__aside {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  min-height: 640px;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  overflow: hidden;
  color: var(--theme-chrome-ink);
  background: var(--app-context-deeper);
}
.gj-stage__photo {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;
  transform-origin: 30% 40%;
  animation: gj-stage-kenburns 28s ease-in-out infinite alternate;
}
.gj-stage__aurora {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 70% at 100% 0%, color-mix(in srgb, var(--app-context-accent2) 30%, transparent), transparent 62%),
    radial-gradient(70% 80% at 0% 100%, color-mix(in srgb, var(--app-context-glow) 30%, transparent), transparent 58%),
    linear-gradient(160deg, color-mix(in srgb, var(--app-context-deep) 84%, transparent), color-mix(in srgb, var(--app-context-deeper) 94%, transparent) 70%);
}
.gj-stage__aurora::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .32;
  background: radial-gradient(circle, var(--theme-chrome-glass-strong) 1px, transparent 1.6px) 0 0 / 18px 18px;
  mask-image: linear-gradient(200deg, #000, transparent 70%);
}
.gj-stage__beam {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 2px;
  overflow: hidden;
}
.gj-stage__beam::before {
  position: absolute;
  inset: 0;
  width: 40%;
  content: "";
  background: linear-gradient(90deg, transparent, var(--app-context-glow), var(--app-context-accent2), transparent);
  animation: gj-stage-beam 5.5s var(--stage-ease) infinite;
}

.gj-stage__brand { display: flex; align-items: center; gap: .8rem; }
.gj-stage__logo {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--app-context-glow) 70%, transparent);
}
.gj-stage__logo img { width: 36px; height: 36px; object-fit: contain; }
.gj-stage__brand strong { display: block; font-size: 1.08rem; font-weight: 800; letter-spacing: .01em; }
.gj-stage__brand small { display: block; color: var(--theme-chrome-muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.gj-stage__pitch { display: grid; gap: .7rem; margin-top: auto; }
.gj-stage__kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: fit-content;
  padding: .32rem .7rem;
  color: var(--theme-chrome-ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--theme-chrome-glass);
  border: 1px solid var(--theme-chrome-line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}
.gj-stage__kicker i { color: var(--app-context-glow); }
.gj-stage__pitch h2 {
  max-width: 15ch;
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 3.3vw, 2.75rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.gj-stage__pitch h2 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--app-context-glow), var(--app-context-accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gj-stage__pitch p { max-width: 38ch; margin: 0; color: var(--theme-chrome-muted); font-size: .98rem; line-height: 1.55; }

/* Live operations module (decorative) */
.gj-stage__live {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: .9rem;
  background: var(--theme-chrome-glass);
  border: 1px solid var(--theme-chrome-line);
  border-radius: 18px;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.gj-stage__radar {
  position: relative;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 32%, color-mix(in srgb, var(--app-context-glow) 22%, transparent) 33% 34%, transparent 35% 64%, color-mix(in srgb, var(--app-context-glow) 22%, transparent) 65% 66%, transparent 67%),
    color-mix(in srgb, var(--app-context-deeper) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-context-glow) 35%, transparent);
}
.gj-stage__radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--app-context-glow) 55%, transparent), transparent 22%);
  animation: gj-stage-spin 3.6s linear infinite;
}
.gj-stage__radar-pin {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--app-context-glow);
  border-radius: 50%;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--app-context-glow) 60%, transparent);
  animation: gj-stage-ping 2.4s ease-out infinite;
}
.gj-stage__radar-pin:nth-child(2) { top: 30%; left: 64%; }
.gj-stage__radar-pin:nth-child(3) { top: 66%; left: 34%; animation-delay: .8s; background: var(--app-context-accent2); }
.gj-stage__radar-pin:nth-child(4) { top: 58%; left: 74%; animation-delay: 1.6s; }

.gj-stage__feed { display: grid; gap: .45rem; min-width: 0; }
.gj-stage__live-chip { display: inline-flex; align-items: center; gap: .45rem; color: var(--theme-chrome-muted); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.gj-stage__live-dot { position: relative; width: 8px; height: 8px; background: var(--theme-online); border-radius: 50%; }
.gj-stage__live-dot::after { position: absolute; inset: 0; content: ""; border-radius: 50%; background: var(--theme-online); animation: gj-stage-halo 1.8s ease-out infinite; }
.gj-stage__ticker { position: relative; height: 2.6rem; margin: 0; padding: 0; list-style: none; }
.gj-stage__ticker li {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--theme-chrome-ink);
  font-size: .86rem;
  font-weight: 650;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s var(--stage-ease), transform .45s var(--stage-ease);
}
.gj-stage__ticker li:first-child { opacity: 1; transform: none; }
.gj-stage__ticker[data-gj-ticker-ready] li { opacity: 0; transform: translateY(10px); }
.gj-stage__ticker[data-gj-ticker-ready] li.is-active { opacity: 1; transform: none; }
.gj-stage__ticker[data-gj-ticker-ready] li.is-leaving { opacity: 0; transform: translateY(-10px); }
.gj-stage__ticker i {
  display: grid;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  color: var(--stage-ink-on-glow);
  background: linear-gradient(135deg, var(--app-context-glow), var(--app-context-accent2));
  border-radius: 10px;
}
.gj-stage__ticker span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gj-stage__perks { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.gj-stage__perks li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  color: var(--theme-chrome-ink);
  font-size: .78rem;
  font-weight: 700;
  background: var(--theme-chrome-glass);
  border: 1px solid var(--theme-chrome-line);
  border-radius: 999px;
}
.gj-stage__perks i { color: var(--app-context-glow); }

/* ---------- Form side ---------- */
.gj-stage__main {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
  max-height: min(920px, calc(100vh - 150px));
  padding: clamp(1.4rem, 3.2vw, 2.6rem);
  overflow: auto;
}
.gj-stage__head { display: grid; gap: .35rem; }
.gj-stage__eyebrow { color: var(--app-context); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
[data-bs-theme="dark"] .gj-stage__eyebrow { color: var(--app-context-glow); }
.gj-stage__head h1 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.05rem); font-weight: 850; line-height: 1.12; letter-spacing: -.015em; }
.gj-stage__head p { margin: 0; color: var(--gj-color-muted); }

/* Stepper */
.gj-stage__steps { display: flex; gap: .35rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.gj-stage__steps li {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
  color: var(--gj-color-muted);
  font-size: .74rem;
  font-weight: 750;
}
.gj-stage__steps li::before {
  height: 4px;
  content: "";
  background: color-mix(in srgb, var(--gj-color-border) 90%, transparent);
  border-radius: 999px;
}
.gj-stage__steps li.is-done::before,
.gj-stage__steps li.is-current::before { background: linear-gradient(90deg, var(--app-context), var(--app-context-glow)); }
.gj-stage__steps li.is-current { color: var(--gj-color-text); }
.gj-stage__steps li.is-current::before { animation: gj-stage-fill .8s var(--stage-ease) both; transform-origin: left; }

/* Staggered entrance */
.gj-stage__reveal { animation: gj-stage-rise .6s var(--stage-ease) both; animation-delay: calc(140ms + var(--i, 0) * 70ms); }

/* Fields and inputs */
:is(.gj-stage, .gj-stage-scope) .form-control,
:is(.gj-stage, .gj-stage-scope) .form-select {
  min-height: 48px;
  color: var(--gj-color-text);
  background-color: var(--gj-color-surface);
  border: 1px solid var(--gj-color-border);
  border-radius: 12px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
:is(.gj-stage, .gj-stage-scope) .form-control:hover,
:is(.gj-stage, .gj-stage-scope) .form-select:hover { border-color: color-mix(in srgb, var(--app-context) 35%, var(--gj-color-border)); }
:is(.gj-stage, .gj-stage-scope) .form-control:focus,
:is(.gj-stage, .gj-stage-scope) .form-select:focus {
  border-color: var(--app-context);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-context) 20%, transparent);
  outline: 0;
}
[data-bs-theme="dark"] :is(.gj-stage, .gj-stage-scope) .form-control:focus,
[data-bs-theme="dark"] :is(.gj-stage, .gj-stage-scope) .form-select:focus {
  border-color: var(--app-context-glow);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-context-glow) 22%, transparent);
}
:is(.gj-stage, .gj-stage-scope) .is-invalid > .form-control,
:is(.gj-stage, .gj-stage-scope) .form-control.is-invalid { border-color: var(--gj-color-danger, #b42318); }

.gj-stage__field { display: grid; gap: .4rem; }
.gj-stage__field > label { font-size: .84rem; font-weight: 750; }
.gj-stage__input { position: relative; }
.gj-stage__input > i {
  position: absolute;
  top: 50%;
  left: .95rem;
  color: var(--gj-color-muted);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color .18s ease;
}
.gj-stage__input > .form-control { padding-left: 2.65rem; }
.gj-stage__input:focus-within > i { color: var(--app-context); }
[data-bs-theme="dark"] .gj-stage__input:focus-within > i { color: var(--app-context-glow); }
.gj-stage__input--reveal > .form-control { padding-right: 3rem; }

.gj-stage__reveal-btn {
  position: absolute;
  top: 50%;
  right: .4rem;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: var(--gj-color-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  transform: translateY(-50%);
}
.gj-stage__reveal-btn:hover { color: var(--gj-color-text); background: color-mix(in srgb, var(--gj-color-border) 45%, transparent); }
.gj-stage__reveal-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-context) 45%, transparent); outline-offset: 1px; }
.gj-stage__hint { display: flex; align-items: center; gap: .35rem; color: #9a5b00; font-size: .78rem; font-weight: 650; }
[data-bs-theme="dark"] .gj-stage__hint { color: #f7cf86; }
.gj-stage__hint[hidden] { display: none; }

/* The registration code input */
.gj-stage__code .form-control {
  min-height: 64px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: .32em;
  text-align: center;
  text-transform: uppercase;
  background:
    linear-gradient(var(--gj-color-surface), var(--gj-color-surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--app-context) 45%, var(--gj-color-border)), color-mix(in srgb, var(--app-context-accent2) 45%, var(--gj-color-border))) border-box;
  border: 1.5px solid transparent;
  border-radius: 16px;
}
.gj-stage__code .form-control::placeholder { color: color-mix(in srgb, var(--gj-color-muted) 55%, transparent); letter-spacing: .32em; }
.gj-stage__code .gj-auth-field > label { text-align: center; }
.gj-stage__code .gj-auth-help,
.gj-stage__code .invalid-feedback { text-align: center; }

/* Primary action */
.gj-stage__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  min-height: 52px;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none; /* also used on links (Go to Sign In) */
  background: linear-gradient(135deg, var(--app-context), var(--app-context-dark));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--app-context) 75%, transparent);
  transition: transform .16s ease, box-shadow .2s ease, filter .2s ease;
}
.gj-stage__submit::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .28) 50%, transparent 70%);
  transform: translateX(-120%);
}
.gj-stage__submit:hover { color: #fff; box-shadow: 0 18px 34px -14px color-mix(in srgb, var(--app-context) 85%, transparent); transform: translateY(-1px); }
.gj-stage__submit:hover::after { transition: transform .9s var(--stage-ease); transform: translateX(120%); }
.gj-stage__submit:active { transform: scale(.985); }
.gj-stage__submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-context) 50%, transparent); outline-offset: 3px; }
.gj-stage__submit i { transition: transform .2s ease; }
.gj-stage__submit:hover i { transform: translateX(3px); }
[data-bs-theme="dark"] .gj-stage__submit,
[data-bs-theme="dark"] .gj-stage__submit:hover {
  color: var(--stage-ink-on-glow);
  background: linear-gradient(135deg, var(--app-context-glow), color-mix(in srgb, var(--app-context-glow) 70%, var(--app-context-accent2)));
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--app-context-glow) 70%, transparent);
}
.gj-stage__submit[aria-busy="true"] { pointer-events: none; filter: saturate(.85); }
.gj-stage__submit[aria-busy="true"] > * { visibility: hidden; }
.gj-stage__submit[aria-busy="true"]::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  content: "";
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: gj-stage-spin .7s linear infinite;
}

.gj-stage__link { color: var(--app-context-dark); font-weight: 750; text-decoration: none; }
.gj-stage__link:hover { text-decoration: underline; text-underline-offset: 3px; }
[data-bs-theme="dark"] .gj-stage__link { color: var(--app-context-glow); }

.gj-stage__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.gj-stage__row .form-check-input:checked { background-color: var(--app-context); border-color: var(--app-context); }

.gj-stage__divider { display: flex; align-items: center; gap: .8rem; color: var(--gj-color-muted); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.gj-stage__divider::before,
.gj-stage__divider::after { flex: 1; height: 1px; content: ""; background: var(--gj-color-border); }

/* Option card (for example "Register Your Company") */
.gj-stage__option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.05rem;
  color: var(--gj-color-text);
  text-decoration: none;
  background:
    linear-gradient(var(--gj-color-surface), var(--gj-color-surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--app-context) 30%, var(--gj-color-border)), var(--gj-color-border) 60%) border-box;
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(16 24 40 / .05), 0 6px 18px -10px rgb(16 24 40 / .12);
  transition: transform .18s ease, box-shadow .2s ease;
}
.gj-stage__option:hover { color: var(--gj-color-text); box-shadow: 0 2px 4px rgb(16 24 40 / .06), 0 16px 32px -14px rgb(16 24 40 / .22); transform: translateY(-2px); }
.gj-stage__option:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-context) 45%, transparent); outline-offset: 2px; }
.gj-stage__option-icon {
  display: grid;
  width: 2.9rem;
  height: 2.9rem;
  place-items: center;
  color: #fff;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--app-context), var(--app-context-dark));
  border-radius: 14px;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--app-context) 60%, transparent);
}
[data-bs-theme="dark"] .gj-stage__option-icon { color: var(--stage-ink-on-glow); background: linear-gradient(135deg, var(--app-context-glow), var(--app-context-accent2)); }
.gj-stage__option strong { display: block; font-weight: 800; }
.gj-stage__option small { display: block; color: var(--gj-color-muted); font-size: .84rem; }
.gj-stage__option > .bi-arrow-right { color: var(--gj-color-muted); transition: transform .2s ease, color .2s ease; }
.gj-stage__option:hover > .bi-arrow-right { color: var(--app-context); transform: translateX(4px); }

/* Joining summary */
.gj-stage__joining {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: color-mix(in srgb, var(--app-context) 8%, var(--gj-color-surface));
  border: 1px solid color-mix(in srgb, var(--app-context) 28%, var(--gj-color-border));
  border-radius: 14px;
}
.gj-stage__joining > i { display: grid; flex: 0 0 auto; width: 2.4rem; height: 2.4rem; place-items: center; color: var(--app-context-dark); background: color-mix(in srgb, var(--app-context) 16%, transparent); border-radius: 12px; }
[data-bs-theme="dark"] .gj-stage__joining > i { color: var(--app-context-glow); }
.gj-stage__joining div { display: grid; flex: 1 1 auto; min-width: 0; }
.gj-stage__joining small { color: var(--gj-color-muted); font-size: .76rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.gj-stage__joining strong { overflow-wrap: anywhere; }
.gj-stage__joining a { flex: 0 0 auto; font-size: .84rem; }

/* Success moment */
.gj-stage__success { display: grid; justify-items: center; gap: .7rem; padding: 1.4rem .5rem; text-align: center; }
.gj-stage__check { width: 88px; height: 88px; }
.gj-stage__check circle { fill: color-mix(in srgb, var(--app-context) 12%, transparent); stroke: var(--app-context); stroke-width: 3; stroke-dasharray: 252; stroke-dashoffset: 252; animation: gj-stage-draw .8s var(--stage-ease) .15s forwards; }
.gj-stage__check path { fill: none; stroke: var(--app-context); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: gj-stage-draw .5s var(--stage-ease) .8s forwards; }
[data-bs-theme="dark"] .gj-stage__check circle,
[data-bs-theme="dark"] .gj-stage__check path { stroke: var(--app-context-glow); }
.gj-stage__success h2 { margin: 0; font-size: 1.4rem; font-weight: 850; }
.gj-stage__success p { max-width: 34rem; margin: 0; color: var(--gj-color-muted); }
.gj-stage__success p strong { color: var(--gj-color-text); overflow-wrap: anywhere; }
.gj-stage__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.gj-stage__actions .gj-stage__submit { width: auto; padding: 0 1.4rem; }

.gj-stage__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: auto; padding-top: .4rem; color: var(--gj-color-muted); font-size: .9rem; }
/* Privacy, SMS terms and terms of service links under the footer line (legal/_legal_links.html). */
.gj-stage__legal { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .55rem; font-size: .84rem; }
.gj-stage__legal .gj-stage__link { font-weight: 650; }
.gj-stage__fine { margin: 0; color: var(--gj-color-muted); font-size: .8rem; text-align: center; }

/* Live password requirements (partials/_password_rules.html) */
.gj-pw-rules { display: grid; gap: .55rem; padding: .85rem .95rem; background: color-mix(in srgb, var(--gj-color-surface-muted) 80%, transparent); border: 1px solid var(--gj-color-border); border-radius: 14px; }
.gj-pw-rules__meter { height: 6px; overflow: hidden; background: color-mix(in srgb, var(--gj-color-border) 80%, transparent); border-radius: 999px; }
.gj-pw-rules__meter span { display: block; width: 100%; height: 100%; background: var(--meter-color, #d92d20); border-radius: inherit; transform: scaleX(var(--meter, 0)); transform-origin: left; transition: transform .35s var(--stage-ease), background-color .35s ease; }
.gj-pw-rules__title { display: flex; justify-content: space-between; gap: .5rem; margin: 0; font-size: .8rem; font-weight: 800; }
.gj-pw-rules__title span { color: var(--gj-color-muted); font-weight: 700; }
.gj-pw-rules__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .9rem; margin: 0; padding: 0; list-style: none; }
.gj-pw-rules__list li { display: flex; align-items: center; gap: .45rem; color: var(--gj-color-muted); font-size: .8rem; transition: color .2s ease; }
.gj-pw-rules__list li i { font-size: .85rem; transition: transform .25s var(--stage-spring); }
.gj-pw-rules__list li.is-met { color: var(--gj-color-text); }
.gj-pw-rules__list li.is-met i { color: #079455; transform: scale(1.15); }
[data-bs-theme="dark"] .gj-pw-rules__list li.is-met i { color: #47cd89; }
.gj-pw-rules__note { margin: 0; color: var(--gj-color-muted); font-size: .76rem; }
@media (max-width: 575.98px) { .gj-pw-rules__list { grid-template-columns: 1fr; } }

/* Register-page sections inside the stage stay calm */
.gj-stage .gj-register__section { background: color-mix(in srgb, var(--gj-color-surface-muted) 70%, transparent); border-radius: 16px; }
.gj-stage .gj-register__step { background: linear-gradient(135deg, var(--app-context), var(--app-context-dark)); color: #fff; }
[data-bs-theme="dark"] .gj-stage .gj-register__step { background: linear-gradient(135deg, var(--app-context-glow), var(--app-context-accent2)); color: var(--stage-ink-on-glow); }

/* Single-card pages (forgot/set password, verify) float on the same stage */
.gj-auth .gj-auth-card { box-shadow: var(--stage-elev-3); animation: gj-stage-enter .7s var(--stage-ease) both; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .gj-stage__shell,
  .gj-stage__shell--wide { grid-template-columns: 1fr; }
  .gj-stage__aside { min-height: 0; gap: 1rem; }
  .gj-stage__pitch { margin-top: .5rem; }
  .gj-stage__pitch h2 { max-width: none; font-size: clamp(1.6rem, 6vw, 2.1rem); }
  .gj-stage__main { max-height: none; overflow: visible; }
}
@media (max-width: 575.98px) {
  .gj-stage { padding: .75rem; }
  /* Phones: the brand panel becomes a slim aurora band so the form starts above the fold.
     The top bar already shows the logo, so the panel keeps only the pitch and a one-line live strip. */
  .gj-stage__aside { gap: .75rem; padding: 1rem 1.1rem 1.1rem; }
  .gj-stage__brand,
  .gj-stage__pitch p { display: none; }
  .gj-stage__pitch { gap: .5rem; margin-top: 0; }
  .gj-stage__kicker { padding: .24rem .6rem; font-size: .64rem; }
  .gj-stage__pitch h2 { font-size: 1.35rem; line-height: 1.15; }
  .gj-stage__live { grid-template-columns: 1fr; gap: 0; padding: .4rem .55rem; border-radius: 14px; }
  .gj-stage__feed { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .65rem; }
  .gj-stage__live-chip { font-size: .62rem; }
  .gj-stage__ticker { height: 1.8rem; }
  .gj-stage__ticker li { font-size: .8rem; }
  .gj-stage__ticker i { width: 1.55rem; height: 1.55rem; border-radius: 8px; font-size: .8rem; }
  .gj-stage__radar { display: none; }
  .gj-stage__perks { display: none; }
  .gj-stage__steps li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .gj-stage__joining { flex-wrap: wrap; }
  .gj-stage__joining a { flex-basis: 100%; padding-left: 3.25rem; }
}

@media (max-width: 374.98px) {
  /* Narrowest phones: keep the pulsing dot, give the ticker line the room. */
  .gj-stage__live-chip { gap: 0; font-size: 0; }
}

/* ---------- Page transitions between auth pages ----------
   Browsers with cross-document View Transitions keep the brand panel in place and slide the
   form side; others get .is-leaving from gj-auth.js before navigating. */
@view-transition { navigation: auto; }
.gj-stage__aside { view-transition-name: gj-stage-aside; }
.gj-stage__main { view-transition-name: gj-stage-main; }
::view-transition-group(gj-stage-aside) { animation-duration: .45s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(gj-stage-main) { animation: gj-stage-leave .25s ease-in both; }
::view-transition-new(gj-stage-main) { animation: gj-stage-arrive .45s cubic-bezier(.22, 1, .36, 1) .08s both; }
.gj-stage.is-leaving .gj-stage__main { animation: gj-stage-leave .25s ease-in both; }
.gj-stage.is-leaving .gj-stage__aside .gj-stage__pitch { opacity: .6; transition: opacity .25s ease; }

/* Sign-in launch curtain: continues on the next page via html.gj-arrival (gj-ui.css). */
.gj-launch {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  color: var(--theme-chrome-ink);
  background:
    radial-gradient(50% 60% at 50% 40%, color-mix(in srgb, var(--app-context-glow) 22%, transparent), transparent 70%),
    linear-gradient(160deg, var(--app-context-deep), var(--app-context-deeper));
  animation: gj-launch-in .35s ease-out both;
}
.gj-launch__logo { position: relative; display: grid; width: 84px; height: 84px; place-items: center; background: #fff; border-radius: 24px; box-shadow: 0 20px 50px -18px color-mix(in srgb, var(--app-context-glow) 70%, transparent); }
.gj-launch__logo img { width: 58px; height: 58px; object-fit: contain; }
.gj-launch__logo::after { position: absolute; inset: -10px; content: ""; border: 2px solid color-mix(in srgb, var(--app-context-glow) 70%, transparent); border-radius: 30px; animation: gj-stage-halo 1.4s ease-out infinite; }
.gj-launch strong { font-size: 1.1rem; font-weight: 800; }
.gj-launch span { color: var(--theme-chrome-muted); font-size: .9rem; }

/* ---------- Launch intro (partials/_auth_intro.html) ----------
   Shown only while html.gj-intro-active (fresh load or reload, motion allowed). The radar
   sweeps, each capability lights up in turn with a blip, then gj-auth.js flies the logo into the
   navbar (.is-leaving) and adds gj-intro-done, which releases the paused page entrance below. */
.gj-intro { display: none; }
html.gj-intro-active:not(.gj-intro-done) { overflow: hidden; }
html.gj-intro-active:not(.gj-intro-done) :is(.gj-stage__shell, .gj-stage__reveal, .gj-auth-card) { animation-play-state: paused; }
html.gj-intro-active:not(.gj-intro-landed) .gj-authbar__logo { opacity: 0; }

html.gj-intro-active:not(.gj-intro-landed) .gj-intro {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.6rem;
  padding: 1.5rem 1rem;
  color: var(--theme-chrome-ink);
  cursor: pointer;
}
.gj-intro::before,
.gj-intro::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  transition: opacity .55s ease;
}
.gj-intro::before {
  background:
    radial-gradient(45% 55% at 50% 40%, color-mix(in srgb, var(--app-context-glow) 20%, transparent), transparent 70%),
    radial-gradient(60% 50% at 85% 100%, color-mix(in srgb, var(--app-context-accent2) 14%, transparent), transparent 70%),
    linear-gradient(160deg, var(--app-context-deep), var(--app-context-deeper));
}
.gj-intro::after {
  background: radial-gradient(circle, var(--theme-chrome-glass-strong) 1px, transparent 1.6px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 45%, #000, transparent);
  mask-image: radial-gradient(60% 60% at 50% 45%, #000, transparent);
}

.gj-intro__stage {
  display: grid;
  grid-template-columns: minmax(0, 270px) auto minmax(0, 270px);
  align-items: center;
  gap: 2.2rem;
}
.gj-intro__features { display: grid; gap: 1.1rem; margin: 0; padding: 0; list-style: none; transition: opacity .35s ease; }
.gj-intro__feature {
  --from: -18px;
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .9rem;
  background: var(--theme-chrome-glass);
  border: 1px solid var(--theme-chrome-line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  animation: gj-intro-feature .6s var(--stage-ease) forwards;
  animation-delay: calc(.8s + var(--i) * .42s);
}
.gj-intro__features--end .gj-intro__feature { --from: 18px; }
/* Lit edge: fades in just after the card arrives, like a contact on the radar. */
.gj-intro__feature::after {
  position: absolute;
  inset: -1px;
  content: "";
  border: 1px solid color-mix(in srgb, var(--app-context-glow) 70%, transparent);
  border-radius: inherit;
  box-shadow: 0 0 24px -6px color-mix(in srgb, var(--app-context-glow) 70%, transparent);
  opacity: 0;
  pointer-events: none;
  animation: gj-intro-lit .5s ease forwards;
  animation-delay: calc(.95s + var(--i) * .42s);
}
.gj-intro__icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--app-context-deeper);
  background: linear-gradient(135deg, var(--app-context-glow), var(--app-context-accent2));
  border-radius: 12px;
  font-size: 1.05rem;
}
.gj-intro__feature strong { display: block; font-size: .9rem; font-weight: 800; line-height: 1.2; }
.gj-intro__feature small { display: block; margin-top: .1rem; color: var(--theme-chrome-muted); font-size: .72rem; line-height: 1.3; }
.gj-intro__tick {
  margin-left: auto;
  color: var(--theme-online);
  font-size: 1.15rem;
  opacity: 0;
  animation: gj-intro-tick .45s var(--stage-spring) forwards;
  animation-delay: calc(1.15s + var(--i) * .42s);
}

.gj-intro__radar {
  position: relative;
  display: grid;
  width: 240px;
  aspect-ratio: 1;
  place-items: center;
}
.gj-intro__scope {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, transparent 0 33%, color-mix(in srgb, var(--app-context-glow) 30%, transparent) 33.5% 34.5%, transparent 35% 66%, color-mix(in srgb, var(--app-context-glow) 30%, transparent) 66.5% 67.5%, transparent 68% 98.5%, color-mix(in srgb, var(--app-context-glow) 40%, transparent) 99% 100%),
    linear-gradient(90deg, transparent calc(50% - .5px), color-mix(in srgb, var(--app-context-glow) 16%, transparent) 0 calc(50% + .5px), transparent 0),
    linear-gradient(0deg, transparent calc(50% - .5px), color-mix(in srgb, var(--app-context-glow) 16%, transparent) 0 calc(50% + .5px), transparent 0);
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--app-context-glow) 14%, transparent);
  transition: opacity .4s ease;
  animation: gj-intro-dial .8s var(--stage-ease) both;
}
.gj-intro__sweep {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 0 72%, color-mix(in srgb, var(--app-context-glow) 8%, transparent) 74%, color-mix(in srgb, var(--app-context-glow) 50%, transparent) 99.4%, var(--app-context-glow) 100%);
  animation: gj-stage-spin 2.6s linear infinite;
}
/* Blips sit toward the card they announce: Tracking, Reporting, Site Management, Access Authorization. */
.gj-intro__blip {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--app-context-accent2);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--app-context-accent2);
  opacity: 0;
  animation: gj-intro-blip .5s var(--stage-spring) forwards;
  animation-delay: calc(.8s + var(--i) * .42s);
}
.gj-intro__blip::after {
  position: absolute;
  inset: -5px;
  content: "";
  border: 1.5px solid var(--app-context-accent2);
  border-radius: 50%;
  opacity: 0;
  animation: gj-stage-halo 1.6s ease-out infinite;
  animation-delay: inherit;
}
.gj-intro__blip:nth-of-type(2) { top: 30%; left: 26%; }
.gj-intro__blip:nth-of-type(3) { top: 27%; left: 73%; }
.gj-intro__blip:nth-of-type(4) { top: 73%; left: 29%; }
.gj-intro__blip:nth-of-type(5) { top: 70%; left: 72%; }
.gj-intro__logo { position: relative; z-index: 1; width: 92px; height: 92px; }

.gj-intro__footer { display: grid; justify-items: center; gap: .85rem; transition: opacity .35s ease; }
.gj-intro__brand {
  display: grid;
  justify-items: center;
  gap: .2rem;
  text-align: center;
  opacity: 0;
  animation: gj-stage-rise .6s var(--stage-ease) .45s forwards;
}
.gj-intro__brand strong { font-size: 1.6rem; font-weight: 850; letter-spacing: -.01em; }
.gj-intro__brand small { color: var(--theme-chrome-muted); font-size: .7rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.gj-intro__progress {
  width: min(260px, 70vw);
  height: 4px;
  overflow: hidden;
  background: var(--theme-chrome-glass-strong);
  border-radius: 999px;
}
.gj-intro__progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--app-context-glow), var(--app-context-accent2));
  transform: scaleX(0);
  transform-origin: left;
  animation: gj-stage-fill 3.1s cubic-bezier(.4, 0, .2, 1) .2s forwards;
}
.gj-intro__status { color: var(--theme-chrome-muted); font-size: .78rem; letter-spacing: .03em; }

/* Exit: everything but the logo fades while the logo flies to the navbar (gj-auth.js). */
.gj-intro.is-leaving { pointer-events: none; }
.gj-intro.is-leaving::before,
.gj-intro.is-leaving::after,
.gj-intro.is-leaving .gj-intro__features,
.gj-intro.is-leaving .gj-intro__scope,
.gj-intro.is-leaving .gj-intro__footer { opacity: 0; }

@media (max-width: 767.98px) {
  html.gj-intro-active:not(.gj-intro-landed) .gj-intro { gap: 1.2rem; }
  .gj-intro__stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "radar radar" "start end";
    gap: 1.1rem .7rem;
    width: min(100%, 420px);
  }
  .gj-intro__radar { grid-area: radar; justify-self: center; width: 180px; }
  .gj-intro__features { gap: .7rem; }
  .gj-intro__features--start { grid-area: start; }
  .gj-intro__features--end { grid-area: end; }
  .gj-intro__feature { gap: .55rem; padding: .6rem .65rem; border-radius: 14px; }
  .gj-intro__feature small { display: none; }
  .gj-intro__feature strong { font-size: .78rem; }
  .gj-intro__icon { flex-basis: 32px; width: 32px; height: 32px; border-radius: 10px; font-size: .9rem; }
  .gj-intro__tick { font-size: 1rem; }
  .gj-intro__logo { width: 72px; height: 72px; }
  .gj-intro__brand strong { font-size: 1.35rem; }
}

@keyframes gj-intro-feature { from { opacity: 0; transform: translateX(var(--from)); } to { opacity: 1; transform: none; } }
@keyframes gj-intro-lit { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: .55; } }
@keyframes gj-intro-tick { from { opacity: 0; transform: scale(.3) rotate(-30deg); } to { opacity: 1; transform: none; } }
@keyframes gj-intro-blip { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
/* Clip-path reveal rather than opacity, so the exit can still fade the dial. */
@keyframes gj-intro-dial { from { clip-path: circle(0 at 50% 50%); transform: rotate(-40deg); } to { clip-path: circle(50% at 50% 50%); transform: none; } }

/* ---------- Motion ---------- */
@keyframes gj-stage-enter { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes gj-stage-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes gj-stage-drift-a { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes gj-stage-drift-b { to { transform: translate(-12vmax, -8vmax) scale(.92); } }
@keyframes gj-stage-drift-c { to { transform: translate(-16vmax, 6vmax) scale(1.2); } }
@keyframes gj-stage-kenburns { to { transform: scale(1.12) translate(-2%, -2%); } }
@keyframes gj-stage-beam { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(260%); } }
@keyframes gj-stage-spin { to { transform: rotate(360deg); } }
@keyframes gj-stage-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--app-context-glow) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes gj-stage-halo { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@keyframes gj-stage-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes gj-stage-draw { to { stroke-dashoffset: 0; } }
@keyframes gj-stage-leave { to { opacity: 0; transform: translateX(-18px); } }
@keyframes gj-stage-arrive { from { opacity: 0; transform: translateX(22px); } }
@keyframes gj-launch-in { from { opacity: 0; } }
@keyframes gj-authbar-in { from { opacity: 0; transform: translateY(-14px); } }

@media (prefers-reduced-motion: reduce) {
  .gj-stage-backdrop__orb,
  .gj-stage__photo,
  .gj-stage__beam::before,
  .gj-stage__radar-sweep,
  .gj-stage__radar-pin,
  .gj-stage__live-dot::after,
  .gj-stage__shell,
  .gj-stage__reveal,
  .gj-stage__steps li::before,
  .gj-auth .gj-auth-card,
  .gj-stage.is-leaving .gj-stage__main,
  .gj-launch,
  .gj-launch__logo::after,
  .gj-authbar,
  .gj-authbar__beam::before { animation: none !important; }
  .gj-authbar__indicator,
  .gj-authbar__logo,
  .gj-authbar__theme i { transition: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
  .gj-stage__check circle,
  .gj-stage__check path { animation: none; stroke-dashoffset: 0; }
  .gj-stage__ticker li,
  .gj-pw-rules__meter span,
  .gj-pw-rules__list li i,
  .gj-stage__submit,
  .gj-stage__submit::after,
  .gj-stage__option { transition: none; }
}

/* ---------------------------------------------------------------------------
   Single sign-on (login button, the email/code step and the refused page).
   Persona accents come from --app-context*; states keep semantic colors.
   --------------------------------------------------------------------------- */
.gj-stage__sso {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  min-height: 52px;
  padding: 0 1.2rem;
  color: var(--gj-color-text);
  font-weight: 800;
  text-decoration: none;
  background: color-mix(in srgb, var(--gj-color-surface) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-context) 38%, var(--gj-color-border));
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(16 24 40 / .05);
  backdrop-filter: blur(8px);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
.gj-stage__sso i { color: var(--app-context); font-size: 1.1rem; }
.gj-stage__sso:hover { color: var(--gj-color-text); border-color: var(--app-context); box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--app-context) 70%, transparent); transform: translateY(-1px); }
.gj-stage__sso:active { transform: scale(.985); }
.gj-stage__sso:focus-visible { outline: 3px solid color-mix(in srgb, var(--app-context) 50%, transparent); outline-offset: 3px; }
.gj-stage__sso--inline { width: auto; }
[data-bs-theme="dark"] .gj-stage__sso { background: color-mix(in srgb, var(--gj-color-surface) 70%, transparent); border-color: color-mix(in srgb, var(--app-context-glow) 45%, var(--gj-color-border)); }
[data-bs-theme="dark"] .gj-stage__sso i { color: var(--app-context-glow); }
[data-bs-theme="dark"] .gj-stage__sso:hover { border-color: var(--app-context-glow); }

.gj-stage__hint--static { align-items: flex-start; color: var(--gj-color-muted); font-weight: 500; line-height: 1.4; }
[data-bs-theme="dark"] .gj-stage__hint--static { color: var(--gj-color-muted); }

.gj-stage__sso-points { display: grid; gap: .55rem; margin: 0; padding: .9rem 1rem; list-style: none; background: color-mix(in srgb, var(--gj-color-surface-muted) 75%, transparent); border: 1px solid var(--gj-color-border); border-radius: 14px; }
.gj-stage__sso-points li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: start; color: var(--gj-color-muted); font-size: .86rem; }
.gj-stage__sso-points i { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; color: var(--app-context); background: color-mix(in srgb, var(--app-context) 12%, transparent); border-radius: 9px; }
[data-bs-theme="dark"] .gj-stage__sso-points i { color: var(--app-context-glow); background: color-mix(in srgb, var(--app-context-glow) 14%, transparent); }

.gj-stage__refused { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1.1rem 1.15rem; background: color-mix(in srgb, var(--theme-danger) 8%, var(--gj-color-surface)); border: 1px solid color-mix(in srgb, var(--theme-danger) 35%, var(--gj-color-border)); border-radius: 16px; }
.gj-stage__refused p { margin: 0; color: var(--gj-color-text); font-weight: 600; line-height: 1.5; }
.gj-stage__refused-icon { display: grid; width: 3.1rem; height: 3.1rem; place-items: center; color: #fff; font-size: 1.4rem; background: linear-gradient(135deg, #d92d20, #b42318); border-radius: 15px; box-shadow: 0 12px 24px -14px rgb(217 45 32 / .8); }
[data-bs-theme="dark"] .gj-stage__refused { background: color-mix(in srgb, #f97066 10%, var(--gj-color-surface)); border-color: color-mix(in srgb, #f97066 40%, var(--gj-color-border)); }
[data-bs-theme="dark"] .gj-stage__refused-icon { color: #2a0a07; background: linear-gradient(135deg, #fda29b, #f97066); }

@media (prefers-reduced-motion: reduce) {
  .gj-stage__sso { transition: none; }
}
