/* Sign-in chooser — page CSS. Tokens and shared classes come from ../assets/base.css.
   Motion rule: only transform and opacity are animated. */

body.login { min-height: 100svh; padding-bottom: 0; background: var(--paper); }

/* No transitions until the first frame has painted (avoids a flash when ?product= preselects). */
html:not(.is-ready) *, html:not(.is-ready) *::before, html:not(.is-ready) *::after { transition: none !important; }

.split { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); min-height: 100svh; }

/* ───────── Brand panel ───────── */
.brand-panel { position: sticky; top: 0; height: 100svh; container-type: inline-size; overflow: clip; background: var(--paper); }

.scene {
  position: absolute; inset: 0; z-index: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: clamp(24px, 3.4vw, 44px) 6cqw;
  overflow: clip;
  opacity: 0; visibility: hidden;
  transition: opacity 760ms var(--ease), visibility 0s linear 760ms;
}
.scene.is-active { opacity: 1; visibility: visible; z-index: 2; transition-delay: 0s; }
/* The outgoing scene stays fully opaque beneath the incoming one, so there is no muddy mid-blend. */
.scene.is-leaving { opacity: 1; visibility: visible; z-index: 1; transition: none; }

.scene-top, .scene-bottom { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 28px; }
.scene-mid { position: relative; display: flex; align-items: center; min-width: 0; }
.scene .word { position: relative; z-index: 1; white-space: nowrap; transition: transform 1100ms var(--ease); transform: translate3d(-2.5%, 0, 0); }
.scene.is-active .word, .scene.is-leaving .word { transform: none; }

.scene--velo .word { font-size: 32cqw; margin-left: -0.5cqw; }
.scene--atlas .word { font-size: 27.5cqw; margin-left: -1cqw; }

/* Middle plane: a floating product fragment (HTML/CSS, not an image). */
.frag { position: absolute; z-index: 2; right: 0; bottom: 27%; width: min(46cqw, 380px); opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity 800ms var(--ease) 180ms, transform 1000ms var(--ease) 180ms; }
.scene.is-active .frag, .scene.is-leaving .frag { opacity: 1; transform: none; }
.scene--velo .frag { bottom: 33%; }
.scene--atlas .frag { bottom: 21%; }
.frag-card { padding: 14px 16px; animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -7px, 0); } }

.frag--velo .frag-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ord { display: grid; gap: 2px; min-width: 0; }
.ord-id { font-size: var(--t-2xs); letter-spacing: .1em; color: var(--ink-muted); }
.ord-lane { font: 500 var(--t-sm)/1.3 var(--font-body); color: var(--ink); }
.ord-lane .arrow { color: var(--ink-muted); padding: 0 2px; }
.ord-chips { display: flex; gap: 6px; flex: none; }
.frag--velo .chip { color: var(--ink); background: var(--inset); }
.frag--velo .chip-ok { color: #245f50; background: var(--accent-soft); }

.frag--atlas .frag-card { padding: 16px 18px; }
.runlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: var(--t-xs); line-height: 1.3; color: var(--night-text); }
.runlog li { display: flex; align-items: center; gap: 10px; }
.runlog .dot { color: var(--glow); opacity: .9; }
.runlog .wait { color: var(--glow); }
.runlog .wait .dot { animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 10px 1px var(--glow); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Atlas glow + quill */
.glow {
  position: absolute; z-index: 0; left: -12cqw; top: calc(50% - 46cqw); width: 92cqw; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(95, 184, 159, .26), rgba(95, 184, 159, .08) 55%, transparent);
  pointer-events: none; animation: breathe 8s ease-in-out infinite alternate; transform-origin: 30% 30%;
}
@keyframes breathe { from { transform: scale(1); opacity: .85; } to { transform: scale(1.08); opacity: 1; } }
.quill { width: clamp(26px, 6.5cqw, 52px); color: var(--glow); }
.scene--atlas .scene-top { align-items: flex-start; min-height: 0; }


/* ───────── Chooser panel ───────── */
.form-panel { position: relative; display: flex; min-width: 0; min-height: 100svh; background: var(--panel); box-shadow: inset 1px 0 0 var(--line); }
.form-inner { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; padding: clamp(16px, 2.4vw, 28px) clamp(20px, 5vw, 64px) clamp(20px, 2.4vw, 28px); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.brands { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.brands .mark-velo { width: 62px; }
.brands .mark-atlasiq { width: 66px; }
.brands .slash { width: 1px; height: 20px; background: currentColor; opacity: .35; transform: rotate(18deg); }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 4px; font-size: var(--t-sm); color: var(--ink-muted); text-decoration: none; border-radius: 8px; }
.back svg { transition: transform 200ms var(--ease); }
.back:hover { color: var(--ink); }
.back:hover svg { transform: translateX(-3px); }

.form-body { flex: 1; width: 100%; max-width: 460px; margin: 0 auto; padding: clamp(20px, 5vh, 56px) 0 28px; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.head h1 { margin: 0 0 8px; font: 800 1.75rem/1.05 var(--font-velo); letter-spacing: -0.02em; text-transform: uppercase; }
.head .sub { margin: 0; max-width: 40ch; font-size: var(--t-md); line-height: 1.5; color: var(--ink-muted); }

.choices { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.choice {
  --c-bg: var(--paper); --c-fg: var(--ink); --c-muted: var(--ink-muted); --c-line: #d6d2c8; --c-ring: var(--accent);
  position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; gap: 6px 16px; align-items: end;
  min-height: 156px; padding: 20px 20px 18px; border-radius: 16px; border: 1px solid var(--c-line); background: var(--c-bg); color: var(--c-fg);
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform 220ms var(--ease);
}
.choice--atlas { --c-bg: var(--night); --c-fg: var(--night-text); --c-muted: var(--night-muted); --c-line: #34312c; --c-ring: var(--glow); }
.choice .mark { grid-column: 1 / -1; align-self: start; justify-self: start; }
.choice .mark-velo { width: 88px; }
.choice .mark-atlasiq { width: 94px; }
.choice-desc { grid-column: 1; grid-row: 2; align-self: center; margin: 0; font-size: var(--t-md); line-height: 1.4; color: var(--c-fg); max-width: 26ch; }
.choice-cta { grid-column: 1; grid-row: 3; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 500 var(--t-sm)/1 var(--font-body); color: var(--c-fg); }
.choice-cta svg { transition: transform 200ms var(--ease); }
.choice-go { grid-column: 2; grid-row: 2 / 4; align-self: end; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; color: var(--c-fg); }
.choice-go svg { transition: transform 200ms var(--ease); }
.choice:hover .choice-go svg, .choice:hover .choice-cta svg { transform: translateX(3px); }

/* Ring is a pseudo-element so only opacity animates. */
.choice::after { content: ""; position: absolute; inset: -4px; border-radius: 20px; border: 2px solid var(--c-ring); opacity: 0; transition: opacity 200ms var(--ease); pointer-events: none; }
.choice:hover { transform: translate3d(0, -2px, 0); }
.choice:hover::after, .choice.is-suggested::after { opacity: 1; }
.choice:focus-visible { outline: none; }
.choice:focus-visible::after { opacity: 1; border-width: 3px; }
.choice-kicker { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; font: 500 var(--t-2xs)/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }

.form-foot { max-width: 460px; width: 100%; margin: 0 auto; font-size: var(--t-xs); line-height: 1.5; }

/* ───────── Mobile / tablet: brand band on top ───────── */
@media (max-width: 899px) {
  .split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .brand-panel { position: relative; height: 22svh; min-height: 150px; }
  .form-panel { min-height: 0; box-shadow: inset 0 1px 0 var(--line); }
  .scene { padding: 16px 20px 12px; }
  .scene--velo .word { font-size: 29cqw; margin-left: -0.5cqw; }
  .scene--atlas .word { font-size: 26cqw; margin-left: -1cqw; }
  .frag, .scene-bottom { display: none; }
  .glow { left: -20cqw; top: calc(50% - 60cqw); width: 120cqw; }
  .quill { width: 22px; }
  .form-body { justify-content: flex-start; padding-top: 16px; gap: 22px; }
  .head h1 { font-size: 1.5rem; }
}
@media (max-width: 899px) and (min-width: 600px) {
  .brand-panel { height: 30svh; }
  .scene--velo .word { font-size: 29cqw; }
  .scene--atlas .word { font-size: 26cqw; }
}
@media (max-width: 380px) { .choice { padding: 16px 16px 14px; min-height: 140px; } }

@media (prefers-reduced-motion: reduce) {
  .frag-card, .glow, .runlog .wait .dot { animation: none !important; }
  .scene .word, .frag { transform: none !important; }
}
