/* ---------- pages without the app frame: setup assistant, sign-in ---------- */
.auth-page { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: clamp(28px, 8vh, 84px) 0 32px; }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--divider); border-radius: 24px; box-shadow: var(--shadow); padding: 40px 32px 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-card.wide { max-width: 780px; }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 6px; }
.auth-head h1 { margin: 8px 0 0; font-size: 26px; line-height: 1.2; font-weight: 680; letter-spacing: -.02em; color: rgb(var(--fg)); text-wrap: balance; }
.auth-head .lead { margin: 0; font-size: 15px; line-height: 1.5; text-wrap: balance; }
.hero { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgb(var(--primary) / .18); color: var(--accent-text); }
.hero svg { width: 30px; height: 30px; stroke-width: 1.6; }
.hero.mark, .hero.done { background: rgb(var(--primary)); color: #00261d; box-shadow: 0 8px 20px rgb(var(--primary) / .35); }
.hero.mark svg { width: 36px; height: 36px; fill: #00261d; stroke: none; }
.hero.mark .brand-lock { fill: none; stroke: rgb(var(--primary)); stroke-width: 1.6; }
.hero.done svg { stroke-width: 2.2; }
.auth-card .field { margin: 0; }
.auth-card .field input, .auth-card .field select { height: 48px; border-radius: 12px; padding: 0 14px; font-size: 15px; }
.auth-page.solo { padding-top: clamp(40px, 15vh, 160px); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-actions { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.auth-foot { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.auth-foot svg { width: 14px; height: 14px; }
.auth-since { text-align: center; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--divider); padding-top: 16px; margin-top: 4px; }
.code-input { letter-spacing: .08em; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
/* numbered steps above the card */
.stepper { list-style: none; display: flex; margin: 0; padding: 0; width: 100%; max-width: 460px; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); position: relative; text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 13px; right: calc(50% + 20px); width: calc(100% - 40px); height: 2px; border-radius: 2px; background: var(--border); }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: rgb(var(--primary-dark)); }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.step-dot svg { width: 15px; height: 15px; stroke-width: 2.2; }
.stepper li.current { color: rgb(var(--fg)); font-weight: 600; }
.stepper li.current .step-dot { background: rgb(var(--fg)); color: var(--page); box-shadow: none; }
.stepper li.done .step-dot { background: rgb(var(--primary)); color: #00261d; box-shadow: none; }

/* a row that offers one thing to set up (second way in, a device waiting for approval) */
.options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--divider); border-radius: 16px; padding: 14px; }
.option > .btn { height: 36px; padding: 0 14px; font-size: 13.5px; }
.option b { display: block; color: rgb(var(--fg)); font-size: 14.5px; overflow-wrap: break-word; hyphens: auto; }
.option small { display: block; color: var(--muted); font-size: 13px; }
.option .grow { flex: 1; min-width: 0; }
.option-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--inset); color: var(--muted); }
.option.done { background: rgb(var(--primary) / .1); border-color: rgb(var(--primary-dark) / .35); }
.option.done .option-ico { background: rgb(var(--primary)); color: #00261d; }
.option.done .option-ico svg { stroke-width: 2.2; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 6px; }
.waiting .spinner { width: 18px; height: 18px; border-width: 2.5px; }
.auth-card .cmd { margin: 0; padding: 14px 16px 10px; border-radius: 14px; flex-direction: column; align-items: stretch; gap: 10px; }
.auth-card .cmd .btn { align-self: flex-end; height: 34px; padding: 0 14px; font-size: 13.5px; }
.auth-card .cmd code { flex: none; white-space: normal; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* codes to read and compare */
.code-box { display: flex; justify-content: center; background: var(--inset); border-radius: 16px; padding: 20px 16px; margin-bottom: 20px; }
.code-box .code { font-size: 28px; background: none; border: 0; padding: 0; }
.recovery-box { display: flex; flex-direction: column; align-items: center; gap: 14px; background: var(--inset); border-radius: 16px; padding: 22px 16px 16px; }
code.recovery { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 0; font: 600 17px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: rgb(var(--fg)); }
@media (max-width: 560px) {
  .form-grid .field.half { grid-column: 1 / -1; }
  .auth-page { gap: 18px; padding-top: 24px; }
  .auth-card { padding: 28px 20px 24px; border-radius: 20px; }
  .auth-head h1 { font-size: 23px; }
  .stepper li:not(.current) span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .option { flex-wrap: wrap; }
  .option > .btn { flex: 1 1 100%; justify-content: center; }
  .modal-card { padding: 22px 20px; }
  code.recovery { font-size: 15px; grid-template-columns: repeat(2, auto); }
}
/* first paint and entrances. The card rises a short way and fades in; tall cards (the assistant)
   move less and slower than the compact sign-in card. Only a card that changed gets .enter. */
.boot { display: none; }
body.booting .boot { position: fixed; inset: 0; display: grid; place-items: center; }
body.booting .boot .hero { opacity: 0; animation: fade-in .4s ease-out .7s forwards; }
body.booting .sidebar, body.booting .main, body.booting .topbar, body.booting .scrim { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in { from { opacity: 0; transform: translateY(var(--travel)); } to { opacity: 1; transform: none; } }
.auth-card { --travel: 10px; --enter: 520ms; }
.auth-card.wide { --travel: 8px; --enter: 560ms; }
.auth-card.compact { --travel: 16px; --enter: 420ms; }
.auth-card.enter { animation: card-in var(--enter) cubic-bezier(.22, .61, .36, 1) both; }
.enter-fade { animation: fade-in 400ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .auth-card.enter, .enter-fade, body.booting .boot .hero { animation: none; }
  .pulse, .dot.running, .part.running .pdot { animation: none; }
  .tiles .tile, .sidebar { transition: none; }
}
