Files
accounted/components/onboarding/journey/journey.css
T
Jakob Wennberg 213d611e54 feat(onboarding): journey PR D — wizard removal, /companies/new mode='add', searchable BankID picker (#1150)
* feat(onboarding): journey PR D — wizard removal, /companies/new mode='add', searchable BankID picker

Closes the onboarding migration (plan PR D). The journey is now the only
onboarding; the flag conditional is gone.

- /companies/new: server page rendering OnboardingJourney mode='add'
  (quiet escape link back to the app). Improvement over the old page: the
  add-company path now persists the TIC lookup snapshot too.
- Delete WelcomeOnboarding + Step1-4 + the three dead variants
  (Step2SectorSelection, Step3ExtensionSuggestions, Step4PreliminaryTax).
  onboarding-illustrations stays (backdrop uses it).
- BankIdCompanyPicker restyled to the journey's searchable list (founder
  decision: list at ANY count): filter with single-match Enter, roster
  rows with name/form/roll/orgnr, member companies under their own
  section opening directly. Contract unchanged: picks still route to
  /onboarding?org_number= and this page still makes zero TIC calls.
- i18n: prune 108 wizard-only onboarding keys and the whole companies_new
  namespace (no consumers left); add journey_cancel_add + three picker
  keys. sv and en in lockstep.

Verified: full vitest suite 9339 passed, eslint 0 errors, guards pass,
production build compiles with /onboarding, /companies/new and
/select-company routes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(onboarding): address PR review — drop unused hasExistingCompanies plumbing, prune stale select_company keys

Restores error_no_access/error_switch_failed (used via ternary inside
t(), which the pruner's regex missed); full pruned-key set re-verified
as bare strings against the whole codebase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 16:03:18 +02:00

272 lines
16 KiB
CSS

/* Journey onboarding styles, ported from the founder-approved concept
(artifact c82c9358). Namespaced under .jny; uses the app's tokens
(--font-display, --ease-out, --ease-spring, color tokens).
Motion here deliberately deviates from the dashboard motion rules:
the concept was signed off with springs, ink and the particle orb. */
/* ── app-shell composition: the page never scrolls ───────────────── */
.jny {
height: 100vh;
height: 100dvh;
min-height: 540px;
overflow: hidden;
display: flex;
flex-direction: column;
text-align: center;
}
/* The real flow escapes the onboarding layout's max-w-lg wrapper and sits
over the shared OnboardingBackdrop (which stays untouched, per plan). */
.jny.jny-fixed {
position: fixed;
inset: 0;
z-index: 10;
min-height: 0;
}
/* mode='add': quiet escape back to the app, top left */
.jny-escape { position: absolute; top: 18px; left: 22px; z-index: 11; text-decoration: none; }
.jny-center {
flex: 1;
min-height: 0;
width: 100%;
max-width: 640px;
margin: 0 auto;
padding: 1vh 24px 0;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
/* optical centering: mirrors the top block below the question and
collapses first when a tall step needs the room */
.jny-balance { flex: 0 20 180px; min-height: 0; }
.jny-backrow { flex: none; margin: 8px 0 12px; min-height: 20px; }
/* ── journey band ────────────────────────────────────────────────── */
.jny-journey { flex: none; position: relative; width: min(680px, 94vw); margin: 6px auto 0; height: 112px; }
.jny-pt { position: absolute; top: 23px; transform: translateX(-50%); text-align: center; width: 150px; }
.jny-dot { display: block; width: 9px; height: 9px; margin: 0 auto; border-radius: 99px; border: 1px solid hsl(var(--border)); background: hsl(var(--background)); transition: background-color 300ms var(--ease-out), border-color 300ms var(--ease-out); }
.jny-pt.is-done .jny-dot { background: hsl(var(--success)); border-color: hsl(var(--success)); animation: jnyDotPop 460ms var(--ease-spring); }
.jny-pt.is-active .jny-dot { opacity: 0; }
.jny-lbl { display: block; margin-top: 28px; font-size: 10.5px; color: hsl(var(--muted-foreground)); letter-spacing: 0.05em; text-transform: uppercase; transition: color 300ms var(--ease-out); }
.jny-pt.is-done .jny-lbl, .jny-pt.is-active .jny-lbl { color: hsl(var(--foreground)); }
.jny-pt.is-done { cursor: pointer; }
.jny-pt.is-done:hover .jny-lbl { text-decoration: underline dotted; text-underline-offset: 3px; }
.jny-pt:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 4px; border-radius: 8px; }
.jny-ans { display: block; margin-top: 3px; font-size: 11.5px; color: hsl(var(--muted-foreground)); line-height: 1.45; }
.jny-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
@keyframes jnyDotPop { 0% { transform: scale(1); } 45% { transform: scale(1.8); } 100% { transform: scale(1); } }
@media (max-width: 640px) { .jny-lbl, .jny-ans { display: none; } }
/* ── fact line (lookup results ink in under the band) ────────────── */
.jny-facts { flex: none; margin: 18px 0 0; min-height: 48px; max-width: 540px; transition: opacity 500ms var(--ease-out); }
.jny-facts.is-gone { opacity: 0; pointer-events: none; min-height: 0; height: 0; margin: 0; overflow: hidden; }
.jny-factname { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.01em; min-height: 26px; }
.jny-factmeta { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-top: 5px; line-height: 1.7; }
.jny-factmeta .jny-f { opacity: 0; transition: opacity 600ms var(--ease-out); }
.jny-factmeta .jny-f.is-on { opacity: 1; }
.jny-factmeta .jny-f.is-warn { color: hsl(var(--destructive)); }
/* ── ink typography ──────────────────────────────────────────────── */
.jny-ink { display: inline-block; animation: jnyInkDry 620ms var(--ease-out) both; }
@keyframes jnyInkDry {
from { opacity: 0; filter: blur(7px); transform: translateY(5px); }
55% { opacity: 1; }
to { opacity: 1; filter: blur(0); transform: none; }
}
/* ── question area ───────────────────────────────────────────────── */
.jny-qarea {
flex: 1;
min-height: 0;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
padding: 10px 0;
}
.jny-qstep { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; animation: jnyQIn 380ms var(--ease-out); }
@keyframes jnyQIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.jny-qtitle {
font-family: var(--font-display);
font-weight: 400;
font-size: clamp(24px, 3.4vw, 32px);
line-height: 1.25;
letter-spacing: -0.01em;
margin: 0 0 8px;
text-wrap: balance;
}
.jny-qsub { font-size: 13px; color: hsl(var(--muted-foreground)); margin: 0 0 26px; }
.jny-attn { font-size: 12.5px; color: hsl(var(--warning)); margin: -14px 0 20px; }
.jny-qhelp {
display: inline-flex; align-items: center; justify-content: center;
width: 17px; height: 17px; border-radius: 99px;
border: 1px solid hsl(var(--border));
color: hsl(var(--muted-foreground));
font-size: 11px; line-height: 1;
margin-left: 7px; vertical-align: -3px;
background: none; cursor: pointer;
transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.jny-qhelp:hover, .jny-qhelp.is-on { color: hsl(var(--foreground)); border-color: hsl(var(--foreground) / 0.35); background: hsl(var(--secondary) / 0.5); }
.jny-qinfo { font-size: 12.5px; color: hsl(var(--muted-foreground)); max-width: 52ch; margin: -14px auto 26px; line-height: 1.65; animation: jnyQIn 300ms var(--ease-out); }
/* ── inputs ──────────────────────────────────────────────────────── */
.jny-biginput { position: relative; border-bottom: 1px solid hsl(var(--border)); padding: 8px 0 12px; max-width: 360px; margin: 0 auto; transition: border-color 200ms var(--ease-out); }
.jny-biginput:focus-within { border-color: hsl(var(--foreground) / 0.55); }
.jny-biginput input {
width: 100%; border: 0; outline: 0; background: none;
font: inherit; color: inherit;
font-size: 26px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
text-align: center;
}
.jny-biginput input::placeholder { color: hsl(var(--muted-foreground) / 0.45); }
.jny-biginput.is-err { animation: jnyShake 340ms var(--ease-out); }
@keyframes jnyShake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.jny-enterhint { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 10px; }
.jny-enterhint b { border: 1px solid hsl(var(--border)); border-radius: 5px; padding: 1px 6px; font-weight: 400; }
.jny-addr { max-width: 380px; margin: 26px auto 0; }
.jny-addr .jny-biginput { max-width: none; margin: 0; }
.jny-addr input { font-size: 19px; letter-spacing: 0.01em; text-align: center; }
.jny-addr-row { display: flex; gap: 26px; margin-top: 4px; }
.jny-addr-zip { flex: 0 0 130px; }
.jny-addr-city { flex: 1; }
/* ── chips ───────────────────────────────────────────────────────── */
.jny-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 520px; margin: 0 auto; }
.jny-pick {
border: 1px solid hsl(var(--border));
border-radius: 99px;
padding: 10px 18px;
font-size: 13.5px;
font-family: inherit;
color: inherit;
background: hsl(var(--background));
cursor: pointer;
transition: background-color 150ms var(--ease-out), transform 180ms var(--ease-out);
}
.jny-pick:hover { background: hsl(var(--secondary) / 0.6); transform: translateY(-1px); }
.jny-pick:active { transform: translateY(0) scale(0.96); }
.jny-pick.is-sel { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.jny-pick .jny-rec { font-size: 10.5px; color: hsl(var(--muted-foreground)); display: block; }
.jny-pick.is-sel .jny-rec { color: hsl(var(--primary-foreground) / 0.7); }
.jny-qactions { display: flex; gap: 18px; align-items: center; justify-content: center; margin-top: 30px; }
.jny-btn {
display: inline-flex; align-items: center; gap: 7px;
border-radius: 99px; padding: 8px 22px; border: 0;
font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
transition: background-color 150ms var(--ease-out);
}
.jny-btn:hover { background: hsl(var(--primary) / 0.85); }
.jny-btn-quiet { border: 0; background: none; cursor: pointer; font-family: inherit; color: hsl(var(--muted-foreground)); font-size: 12.5px; }
.jny-btn-quiet:hover { color: hsl(var(--foreground)); }
/* ── fiscal-year band ────────────────────────────────────────────── */
.jny-yband { max-width: 500px; margin: 4px auto 0; }
.jny-yb-grid { position: relative; padding: 4px 0 0; }
.jny-yb-cells { position: relative; display: grid; z-index: 1; }
.jny-yb-cells span { font-size: 10px; color: hsl(var(--muted-foreground) / 0.65); line-height: 28px; font-variant-numeric: tabular-nums; transition: color 350ms var(--ease-out); }
.jny-yb-cells span.is-in { color: hsl(var(--foreground)); font-weight: 500; }
.jny-yb-span {
position: absolute; top: 5px; height: 26px; z-index: 0; opacity: 0;
border-radius: 99px;
background: hsl(var(--secondary) / 0.8);
border: 1px solid hsl(var(--border));
transition: left 480ms var(--ease-spring), width 480ms var(--ease-spring), opacity 250ms var(--ease-out);
}
.jny-yb-span.is-on { opacity: 1; }
.jny-yb-years { display: grid; margin-top: 3px; }
.jny-yb-years span { font-size: 10px; color: hsl(var(--muted-foreground) / 0.55); text-align: left; padding-left: 3px; }
.jny-yb-label { font-family: var(--font-display); font-size: 17px; margin-top: 14px; min-height: 25px; }
.jny-yb-note { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 5px; min-height: 18px; }
.jny-mchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 460px; margin: 18px auto 0; }
.jny-mchip {
border: 1px solid hsl(var(--border)); border-radius: 99px;
padding: 5px 12px; font-size: 12px;
font-family: inherit; color: inherit; cursor: pointer;
background: hsl(var(--background));
transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.jny-mchip:hover { background: hsl(var(--secondary) / 0.6); transform: translateY(-1px); }
.jny-mchip:active { transform: translateY(0) scale(0.96); }
.jny-mchip.is-sel { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.jny-dp-days { max-width: 420px; gap: 6px; }
.jny-dp-days .jny-mchip { min-width: 32px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.jny-dp-label { font-family: var(--font-display); font-size: 17px; margin-top: 16px; min-height: 25px; }
/* ── company picker rows (BankID roster) ─────────────────────────── */
.jny-rowlist {
max-width: 470px; margin: 18px auto 0; text-align: left;
max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
-webkit-mask-image: linear-gradient(to bottom, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
mask-image: linear-gradient(to bottom, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
}
.jny-rowsec { font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin: 22px 14px 4px; }
.jny-rowpick { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; width: 100%; padding: 11px 14px; border: 0; border-radius: 12px; text-align: left; font-family: inherit; color: inherit; background: none; cursor: pointer; transition: background-color 150ms var(--ease-out); }
.jny-rowpick:hover { background: hsl(var(--secondary) / 0.55); }
.jny-rowpick:active { transform: scale(0.99); }
.jny-rowpick .jny-rleft { display: flex; flex-direction: column; min-width: 0; }
.jny-rowpick .jny-rname { font-size: 14px; }
.jny-rowpick .jny-rmeta { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.jny-rowpick .jny-rorg { font-size: 11.5px; color: hsl(var(--muted-foreground) / 0.75); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jny-rowpick.is-existing .jny-rname { color: hsl(var(--muted-foreground)); }
.jny-rownote { font-size: 12px; color: hsl(var(--muted-foreground)); padding: 14px; }
.jny-filter { max-width: 340px; }
.jny-filter input { font-size: 17px; letter-spacing: 0.01em; }
/* ── done scene: profile card + notes ────────────────────────────── */
.jny-card {
margin: 22px auto 0; max-width: 380px; text-align: left;
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
border-radius: 14px;
padding: 16px 20px;
box-shadow: 0 1px 2px hsl(0 0% 0% / 0.05), 0 16px 40px -24px hsl(0 0% 0% / 0.25);
}
.jny-card-eyebrow { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.jny-card-name { font-family: var(--font-display); font-size: 17px; margin-top: 2px; }
.jny-card dl { margin: 12px 0 0; }
.jny-card-row {
display: flex; justify-content: space-between; gap: 18px;
padding: 7px 0; border-top: 1px dashed hsl(var(--border) / 0.8);
font-size: 12.5px;
opacity: 0; transform: translateY(4px);
transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.jny-card-row.is-on { opacity: 1; transform: none; }
.jny-card-row dt { color: hsl(var(--muted-foreground)); margin: 0; }
.jny-card-row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.jny-notes { margin: 20px auto 0; max-width: 430px; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 2; }
.jny-notes div { opacity: 0; transform: translateY(4px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.jny-notes div.is-on { opacity: 1; transform: none; }
/* ── dawn: progress as atmosphere (composes with OnboardingBackdrop) ─ */
.jny-dawn {
position: fixed; left: 0; right: 0; bottom: 0; height: 55vh;
pointer-events: none; z-index: 0;
background: radial-gradient(120% 95% at 50% 100%, hsl(36 60% 62% / 0.26), transparent 66%);
opacity: var(--jny-dawn, 0);
transition: opacity 1100ms var(--ease-out);
}
.dark .jny-dawn { background: radial-gradient(120% 95% at 50% 100%, hsl(30 45% 42% / 0.26), transparent 66%); }
/* ── compression for short windows: shrink, never scroll ─────────── */
@media (max-height: 780px) {
.jny-facts { margin-top: 10px; min-height: 36px; }
.jny-qtitle { font-size: clamp(20px, 3vw, 26px); }
.jny-qsub { margin-bottom: 16px; }
.jny-qactions { margin-top: 20px; }
.jny-card { margin-top: 14px; padding: 12px 18px; }
.jny-card-row { padding: 5px 0; }
.jny-notes { margin-top: 12px; line-height: 1.8; }
.jny-rowlist { max-height: 36vh; margin-top: 12px; }
.jny-mchips { margin-top: 12px; }
.jny-balance { flex-basis: 110px; }
}
@media (prefers-reduced-motion: reduce) {
.jny *, .jny *::before, .jny *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}