/* Onboarding — ported from Pawn Marketplace v3.0.1 (2026-10-06), translated to v3.1 conventions. */

/* What is v3.0.1's and what is v3.1's here.
   Kept from v3.0.1 (Kelly: "features and animation smoothness"): the welcome pitch, the checklist
   panel and bubble, and their motion, with v3.0.1's exact timings and curves (its Onboarding.css):
     · pitch scrim fade      0.25s ease-out
     · pitch entrance        0.42s cubic-bezier(0.22, 1, 0.36, 1), from opacity 0 + translateY(24px)
                             scale(0.96), ABOVE 600px only (≤600px the pitch is v3.1's bottom sheet
                             and keeps app.css's fc-sheet-up 0.28s)
     · benefit stagger       0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity + translateX(-8px), delays
                             0.16s / 0.22s
     · checklist panel       0.36s cubic-bezier(0.22, 1, 0.36, 1), from opacity 0 + translateY(16px)
                             scale(0.96)
     · minimized bubble      0.32s cubic-bezier(0.22, 1, 0.36, 1), scale(0.6) → 1 + fade
     · step accordion        grid rows 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); chevron 0.2s ease
   Everything else speaks v3.1: the pitch is a MudDialog with v3.1's dialog chrome (app.css: 16px
   desktop radius, ≤600px bottom sheet, 16px insets, z 2100, the app-only Momento caps, reduced-motion
   guard); .fc-iconbtn, .fc-sheet-handle, .mudbutton-ui and .fc-modal-cancel.fc-btn-outlined keep
   their own looks, press and focus groups; tokens only; Momento 8px spacing. The one named exception
   is the checklist's 84px right offset while Go to Top shows (Kelly, 2026-10-06).
   Dropped from v3.0.1: the custom z-10000 overlay with its navy blur scrim, the 32px card radius and
   literal shadows, z-index 9000, the progress-bar fill and the bubble's progress arc (neither can
   ever show with one step), the step-row hover tint, the done/skipped step looks (the checklist
   hides the moment its one step resolves) and the 12/20/4px spacings. The undefined --fw-medium /
   --fw-regular map to --fw-normal (what they rendered as); the buttons take v3.1 button types. */

/* ══ Welcome pitch: Components/Onboarding/ValuePitchModal.razor ═══════════════════════════════════
   1:1 with v3.0.1's pitch (Kelly, 2026-10-06: "look 1:1 as the v3.0.1 version", with her v3.0.1
   screenshots; values measured live from v3.0.1). v3.0.1's Onboarding.css pitch rules, ported verbatim
   onto v3.1's MudDialog (opened by OnboardingHost with { MaxWidth.Small, FullWidth, NoHeader,
   CloseOnEscapeKey }), so the dialog keeps fcDialogA11y's name, focus move and inert background, and
   Esc / an outside click / ✕ keep closing it. Sizes are v3.0.1's (Kelly, 2026-10-07: restored after
   the size table read as a different card): 32px card corners, 36px ✕, 44px benefit circles, 48px Get
   Started, 44px Skip Tutorial, 26px title (the heading-lg token). Spacing is v3.1's (Kelly, same day:
   "IT SHOULD BE 16PX"): 16px padding on every edge, 16px under the eyebrow, 8px between the other
   texts and between the buttons, and no divider line above the buttons.
   Still v3.0.1's: the literal #003776 gradient stop and the shadow. */
@keyframes fc-onb-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fc-onb-modal-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fc-onb-benefit-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* Backdrop: v3.0.1's navy scrim with a 4px blur, fading in over 0.25s. */
.mud-dialog-container:has(.mud-dialog.fc-onb-pitch) .mud-overlay-scrim {
  background-color: rgba(10, 31, 69, 0.85) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fc-onb-overlay-in 0.25s ease-out both;
}
/* Centred card at every width (v3.0.1's overlay centres it with 16px around), so app.css's ≤600px
   bottom-sheet docking is undone for this dialog only. */
.mud-dialog-container:has(.mud-dialog.fc-onb-pitch) {
  align-items: center !important;
  justify-content: center;
  padding: 16px;
}
.mud-dialog.fc-onb-pitch {
  position: relative;
  width: 100%;
  max-width: 560px !important;
  max-height: min(92vh, 720px);
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface-default);
  border-radius: calc(var(--radius-lg) * 2) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  animation: fc-onb-modal-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
/* app.css's ≤600px "bottom safe-area bump" (16px + the device inset under every phone sheet) is for
   sheets pinned to the bottom edge; on this centred card it only left a blank band under Skip Tutorial
   (16px web, 16px + the home-indicator inset in the app). The card ends 16px below Skip. */
@media (max-width: 600px) {
  .mud-dialog.fc-onb-pitch { padding-bottom: 0 !important; }
}
.fc-onb-pitch .mud-dialog-content {
  margin: 0;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow: hidden;
}

/* 8px from the corner: the 36px button centres its glyph about 16px from the edges, in line with the
   16px padding, and its bottom (44px) stays above the title, which starts at 49px. At 16px the ✕
   reached 52px and covered the end of the title's first line on phones. */
.fc-onb-pitch-close-wrap { position: absolute; top: var(--space-1); right: var(--space-1); z-index: 10; }
.fc-onb-pitch-close {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 20px;
}
.fc-onb-pitch-close:focus-visible { outline-color: var(--color-surface-default) !important; }

.fc-onb-pitch-head {
  flex-shrink: 0;
  text-align: center;
  padding: var(--space-2);
  background: linear-gradient(135deg, var(--color-brand-primary) 0%, #003776 100%);
  color: #fff;
}
.fc-onb-pitch-eyebrow {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-xbold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.fc-onb-pitch-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-heading-lg-size);
  font-weight: var(--fw-xbold);
  line-height: 1.15;
  color: #fff;
}

.fc-onb-pitch-benefits {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: var(--space-2);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
/* Resting opacity 1 with a backwards-filled entrance: identical to v3.0.1's "opacity 0 + both" while
   animating, and simply visible when reduced motion turns the animation off. */
.fc-onb-benefit {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: fc-onb-benefit-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.fc-onb-benefit-1 { animation-delay: 0.16s; }
.fc-onb-benefit-2 { animation-delay: 0.22s; }
.fc-onb-benefit-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-brand-primary) 8%, transparent);
  color: var(--color-brand-primary);
  font-size: 20px;
}
.fc-onb-benefit-text { display: flex; flex-direction: column; gap: var(--space-1); }
.fc-onb-benefit-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-xbold);
  color: var(--color-text-primary);
  line-height: 1.3;
}
.fc-onb-benefit-body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.fc-onb-pitch-ctas {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  /* No top padding: with the divider gone, the benefits' own 16px bottom padding is the gap above
     Get Started, so every edge of the card reads 16px. */
  padding: 0 var(--space-2) var(--space-2);
}
.fc-onb-pitch-start {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-brand-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: var(--fw-xbold);
  font-size: var(--text-body-md-size);
  cursor: pointer;
}
.fc-onb-pitch-skip {
  width: 100%;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-weight: var(--fw-normal);
  font-size: var(--text-label-md-size);
  cursor: pointer;
}


/* ══ Checklist panel + minimized bubble: Components/Onboarding/OnboardingChecklist.razor ══════════
   Non-modal and fixed, so it sits in the dock below and stays open on outside clicks. z 50 = the Go
   to Top layer, under every v3.1 sheet (1300), the sign-in sheet (2000), dialogs (2100) and toasts
   (10000); fcDialogA11y makes it inert while a modal is open. */

@keyframes fc-onb-panel-in  { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fc-onb-bubble-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

/* The dock is the fixed element, so the bubble inside it can carry a [data-tooltip] (Tooltip.css
   sets position: relative on anything with one).
   Placement: bottom-right, in Go to Top's slot with bottoms aligned (app.css .fc-gototop-fab: right
   24px; bottom 88px on the web, 16px above the tab bar in the app). */
.fc-onb-dock {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* App: 16px above the tab bar (Kelly, 2026-10-07). The bar is its 8px top padding + the 64px row of
   tabs + its bottom padding token (Home.css .mud-tabs-tabbar-content, #mobile_tabs
   .mud-tabs-tabbar-wrapper), so this tracks the bar on iOS (home indicator) and Android (0). The old
   56px was v3.0.2's bar height and left no gap: the panel sat on the bar. Same spot as the app's Go
   to Top (app.css). */
.page.has-bottomnav .fc-onb-dock {
  bottom: calc(var(--space-1) + 64px + var(--fc-tabbar-pad-bottom) + var(--space-2));
}
/* While Go to Top shows (MudScrollToTop adds .visible to .fc-gototop-fab), slide LEFT of it with a
   16px visible gap: right edge 84px from the screen edge = 24 + 44 (the FAB) + 16 — Kelly's named
   exception to the 8px scale (2026-10-06). It slides back when Go to Top hides. A transform, so the
   slide runs on the compositor. Web: every route; app: the Information Center (its only FAB).
   Tablets and desktop only; phones use the rule below. */
html:has(.fc-gototop-fab.visible) .fc-onb-dock {
  transform: translateX(calc(-1 * (44px + var(--space-2))));
}
/* Phones (web and app): Go to Top goes BELOW the onboarding panel or bubble instead of beside it
   (Kelly, 2026-10-07), so the panel keeps its full width (it used to narrow by 60px to fit beside
   Go to Top). The dock rises on the same 0.3s curve until it is 16px above Go to Top. */
@media (max-width: 767px) {
  /* Go to Top shares the dock's bottom (88px on the web, 16px above the tab bar in the app), so the
     dock rises by its 44px + 16px. */
  html:has(.fc-gototop-fab.visible) .fc-onb-dock {
    transform: translateY(calc(-1 * (44px + var(--space-2))));
  }
}

/* ── Panel, bubble and steps: v3.0.1's checklist widget (Kelly, 2026-10-06: "build the Onboarding section out now.
   Just bring it in"), in v3.1's dock above. Sizes and spacing on v3.1's rules (Kelly, 2026-10-07, her approved
   table): 16px panel corners, 40px head buttons, 24px badges, 56px step buttons, 8px progress bar, 16px insets and
   8/16px gaps. The undefined v3.0.1 --fw-medium / --fw-regular rendered as 400, so they are written as --fw-normal. ── */
.fc-onb-bubble {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-brand-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  animation: fc-onb-bubble-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.fc-onb-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.fc-onb-bubble-count { position: relative; z-index: 1; font-family: var(--font-heading); font-weight: var(--fw-xbold); font-size: var(--text-label-md-size); color: #fff; }

.fc-onb-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: calc(100vw - 40px);
  max-width: 360px;
  background: var(--color-surface-default);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  animation: fc-onb-panel-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fc-onb-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-1);
  padding: var(--space-2);
  background: linear-gradient(135deg, var(--color-brand-primary) 0%, #003776 100%);
  color: #fff;
}
.fc-onb-panel-headtext { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.fc-onb-panel-title { margin: 0; font-family: var(--font-heading); font-size: var(--text-body-md-size); font-weight: var(--fw-xbold); color: #fff; line-height: 1.2; }
.fc-onb-panel-progress { margin: 0; font-family: var(--font-body); font-size: var(--text-label-md-size); color: rgba(255, 255, 255, 0.7); line-height: 1.4; }
.fc-onb-panel-actions { display: flex; align-items: center; gap: var(--space-1); flex-shrink: 0; }
.fc-onb-panel-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.fc-onb-panel-btn:focus-visible { outline-color: var(--color-surface-default) !important; }
.fc-onb-progressbar { height: var(--space-1); width: 100%; background: var(--color-border); }
.fc-onb-progressbar-fill { height: 100%; background: var(--color-brand-accent); transition: width 0.4s; }
.fc-onb-steps { display: flex; flex-direction: column; padding: 8px 0; max-height: 60vh; overflow-y: auto; list-style: none; margin: 0; }
.fc-onb-step { display: flex; flex-direction: column; }
.fc-onb-step-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-2);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
@media (hover: hover) { .fc-onb-step-row:hover { background: rgba(0, 0, 0, 0.03); } }
.fc-onb-step-row:focus-visible { outline-offset: -2px !important; }
.fc-onb-badge { flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-family: var(--font-heading); font-size: var(--text-label-md-size); font-weight: var(--fw-xbold); }
.fc-onb-badge--done { background: var(--color-success); color: #fff; font-size: 16px; }
.fc-onb-badge--skipped { background: rgba(106, 106, 106, 0.15); color: var(--color-text-muted); font-size: 14px; }
.fc-onb-badge--pending { border: 1px solid var(--color-brand-primary); color: var(--color-brand-primary); }
.fc-onb-step-title { flex: 1; font-family: var(--font-heading); font-size: var(--text-label-md-size); font-weight: var(--fw-normal); color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-onb-step-title--done { font-weight: var(--fw-normal); color: var(--color-text-muted); text-decoration: line-through; }
.fc-onb-step-chev { flex-shrink: 0; font-size: 16px; color: var(--color-text-muted); transition: transform 0.2s; }
.fc-onb-step-chev--open { transform: rotate(90deg); }
.fc-onb-step-acc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.fc-onb-step-acc--open { grid-template-rows: 1fr; }
.fc-onb-step-acc-inner { min-height: 0; overflow: hidden; }
.fc-onb-step-body { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-2) var(--space-2); }
.fc-onb-step-tooltip { margin: 0; font-family: var(--font-body); font-size: var(--text-label-md-size); color: var(--color-text-muted); line-height: 1.5; }
.fc-onb-step-actions { display: flex; align-items: center; gap: 8px; }
.fc-onb-step-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 56px;
  padding: 0 16px;
  border-radius: var(--radius-lg);
  background: var(--color-brand-accent);
  color: #fff;
  border: none;
  font-family: var(--font-heading);
  font-weight: var(--fw-normal);
  font-size: var(--text-label-md-size);
  cursor: pointer;
}
.fc-onb-step-skip {
  height: 56px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  font-family: var(--font-heading);
  font-size: var(--text-label-md-size);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .mud-dialog-container:has(.mud-dialog.fc-onb-pitch) .mud-overlay-scrim,
  .fc-onb-benefit,
  .fc-onb-panel,
  .fc-onb-bubble { animation: none; }
  .mud-dialog.fc-onb-pitch { animation: none !important; }

  .fc-onb-dock,
  .fc-onb-panel,
  .fc-onb-step-acc,
  .fc-onb-step-chev { transition: none; }
}
