/* AccountLinking — ported from Pawn Marketplace v3.0.1 (2026-10-06), translated to v3.1 conventions. */

/* ── Sign-in gate: Components/AuthGate.razor + Pages/SignInRequired.razor ─────────────────────────
   Reused as they are, not restyled here: .fc-item-bar / .fc-item-back (sticky back bar,
   ItemDetails.css), .profile_heading_cls (page heading, Inter Bold 28/32, ProfileMenu.css),
   .fc-item-empty (centred empty-state column, gap 16, padding 48/16, ItemDetails.css) and
   .mudbutton-ui (Primary 56px, app.css). Only what those don't give lives below. Momento 8px scale. */

/* AuthGate: v3.1's FCLoader while the session resolves. */
.fc-authgate-loading {
  display: flex;
  justify-content: center;
  padding: var(--space-6) var(--space-2);
}

/* Page: Profile's gradient and height, minus the native header and tab bar (as Stores does). */
.fc-signin-page {
  --fc-signin-tabclear: 0px;
  min-height: calc(100dvh - var(--fc-appbar-h, 0px) - var(--native-header-h, 0px) - var(--fc-signin-tabclear));
  background: linear-gradient(to bottom, var(--color-surface-info-bg) 0%, var(--color-surface-subtle) 100%);
}
.page.has-bottomnav .fc-signin-page {
  --fc-signin-tabclear: calc(56px + var(--fc-tabbar-pad-bottom));
}

/* Desktop: the back bar offsets by the header only (no Set Location bar on this page), with the
   100px fallback so nothing animates on a direct load (CampaignsItemPage.css precedent). */
@media (min-width: 1025px) {
  .fc-signin-page { --fc-header-h: var(--fc-appbar-h, 100px); }
  html.fc-header-hidden .fc-signin-page { --fc-header-h: 0px; }
}

/* iOS: paint the gradient once on a viewport-fixed layer, not on every scroll frame (Profile). */
@supports (-webkit-touch-callout: none) {
  .fc-signin-page {
    background: none;
    position: relative;
    z-index: 0;
  }
  .fc-signin-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, var(--color-surface-info-bg) 0%, var(--color-surface-subtle) 100%);
  }
}

/* Page insets 16 / 16 / 48, sides 32 from 834px (Profile's Momento grid margin). */
.fc-signin-inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-2) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 834px) {
  .fc-signin-inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.fc-signin-title { margin: 0; }

/* The gate block, centred in its own 60vh box (v3.0.1 layout). */
.fc-signin-gate {
  min-height: 60vh;
  justify-content: center;
}
.fc-signin-gate-icon {
  font-size: 40px;
  color: var(--color-brand-primary);
}
.fc-signin-gate-msg {
  margin: 0;
  max-width: 360px;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-primary);
}
/* Primary CTA at content width (v3.1 gate rule), not .mudbutton-ui's full width. */
.fc-signin-gate .mudbutton-ui { width: auto; }

/* ── Linked-account gate: Components/LinkedAccountGate.razor ──────────────────────────────────────
   Same block as the sign-in gate above: .fc-item-empty (column, gap 16, padding 48/16) centred in a
   60vh box, 40px brand-blue icon, 16/24 message, Primary 56px CTA at content width. While the stored
   links load it shows .fc-authgate-loading (above). */
.fc-linkgate {
  min-height: 60vh;
  justify-content: center;
}
.fc-linkgate-icon {
  font-size: 40px;
  color: var(--color-brand-primary);
}
.fc-linkgate-msg {
  margin: 0;
  max-width: 360px;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-primary);
}
.fc-linkgate .mudbutton-ui { width: auto; }

/* ══ Link sheets: Components/Modals/LinkAccountModal.razor, NameMismatchModal.razor,
      NameMismatchErrorModal.razor ══════════════════════════════════════════════════════════════════
   Reused as they are, not restyled here: v3.1's dialog chrome and motion (app.css: 16px insets,
   16px desktop radius, ≤600px bottom sheet with fc-sheet-up, fc-modal-pop-in, reduced-motion guard),
   .mud-dialog.fc-link 680px (app.css), .fc-sheet-handle, .fc-iconbtn (40×40, 18px glyph), the
   .fc-step / .fc-step-enter-* step slides (app.css), .mud-drawer-sub-label, .fc-name-row (Login.css),
   .fc-native-select (ProfileMenu.css), .fc-modal-actions / .fc-modal-cancel / .mudbutton-ui, and the
   Item Detail buttons .fc-ipol-understand / .fc-ipol-cancel / .fc-addr-closebtn (ItemDetails.css) with
   their press and focus groups (PressFeedback.css, Accessibility.css). Only what those don't give is
   below. Momento 8px scale; every value is a token or a multiple of 8. */

/* Shared layout. The header stays put and only the body scrolls (Momento modal layout): the dialog is
   a non-scrolling column and .fc-linksheet-body is the scroller. In the app the body caps at 500px
   inside app.css's min(800px, 100dvh − safe-top) dialog cap; on the web the dialog's own max-height
   (MudBlazor) is the cap. MudBlazor's 8px content margin is dropped so the handle hugs the top at 8px
   (Item Detail address-options precedent). */
.mud-dialog.fc-linksheet { overflow: hidden; }
.mud-dialog.fc-linkerr { max-width: 480px; }
.fc-linksheet .mud-dialog-content {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.fc-linksheet-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-height: 0;
}
.fc-linksheet-sheet > .fc-sheet-handle { margin-bottom: 0; }
.fc-linksheet-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: hidden;     /* the ±40px step slide never shows a horizontal scrollbar */
  overflow-y: auto;
  overscroll-behavior: contain;
}
html:has(.page.has-bottomnav) .mud-dialog.fc-linksheet .mud-dialog-content { max-height: none; }
html:has(.page.has-bottomnav) .fc-linksheet-body { max-height: 500px; }

/* Header: v3.1 Profile modal header type (Inter Bold 20/24), a 20px icon in a 24px frame, 8px gaps.
   The 40px ✕ / back buttons overhang the 24px title line by 8px above and below instead of making the
   row taller (Profile modal precedent, ProfileMenu.css). */
.fc-linksheet-head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}
.fc-linksheet-head--stacked { align-items: flex-start; }
.fc-linksheet-head > .fc-iconbtn {
  flex-shrink: 0;
  margin: calc(-1 * var(--space-1)) 0;
}
.fc-linksheet-headtext {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fc-linksheet-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-heading);
  font-size: var(--text-heading-sm-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-heading-sm-lh);
  color: var(--color-text-primary);
}
.fc-linksheet-headicon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-text-primary);
}
.fc-linksheet-sub {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}

/* Fields: label 8px above (.mud-drawer-sub-label); steps space fields 16px apart (.fc-step gap). */
.fc-linksheet-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Text fields = v3.1's Profile modal fields (Momento Input Large, ProfileMenu.css), scoped to the link
   sheet: 16px padding, 16/24 #121212 text, 1px #000 resting border, 1px #000 + 2px brand-blue inset
   ring on focus. The 2px #D32F2F error border is v3.1's app-wide rule (Accessibility.css).
   [mirror] = a COPY of the ProfileMenu.css rule with the same selector tail, re-scoped from
   `.custom-bottom-drawer.fc-web-modal` to `.mud-dialog.fc-link`. Spec §3 asks for widened selectors,
   not copies; that is OPEN for the orchestrator, because ProfileMenu.css is outside this change set
   (parallel chats edit it) and a widening shows only after its ?v= bump. To dedupe: add
   `.mud-dialog.fc-link …` to those ProfileMenu.css selectors, then delete every [mirror] rule here.
   Untagged rules are link-sheet only and stay. Until then, keep the copies in step with Profile. */
/* [mirror] "Profile modal text fields" */
.mud-dialog.fc-link .mud-input.mud-input-outlined > input.mud-input-root-outlined {
  font-family: Helvetica, Arial, sans-serif;
  padding: var(--space-2) !important;
  line-height: var(--text-body-md-lh) !important;
  color: #121212 !important;
}
/* [mirror] "Rounded outlined inputs" */
.mud-dialog.fc-link .mud-input.mud-input-outlined .mud-input-outlined-border {
  border-radius: var(--radius-lg);
}
/* [mirror] "Resting/hover" */
.mud-dialog.fc-link .mud-input.mud-input-outlined .mud-input-outlined-border.mud-input-outlined-border {
  border-color: #000000 !important;
  border-width: 1px !important;
}
/* [mirror] "Focus" */
.mud-dialog.fc-link .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border.mud-input-outlined-border {
  border-color: #000000 !important;
  border-width: 1px !important;
  box-shadow: inset 0 0 0 2px var(--color-brand-primary) !important;
}

/* Error message = v3.1's Profile error look: 14/18 #D32F2F, 8px under the field, no indent, with a
   triangle in a 24px frame (20px glyph) 8px before the text. MudBlazor draws the text itself (ErrorText,
   wired to the input through ErrorId / aria-describedby); the glyph is added here, SCOPED to the link
   sheet. Never make this helper-text glyph unscoped: Accessibility.css loads later and would put it on
   every Profile / Sign In error. MudBlazor renders an empty error line when a field is invalid with no
   text; only a line that carries text gets the 8px. */
/* [mirror] "Error messages (row #34)", both helper-container rules */
.mud-dialog.fc-link .mud-input-control-helper-container {
  margin-top: 0 !important;
  padding: 0 !important;
}
.mud-dialog.fc-link .mud-input-control-helper-container:has(.mud-input-helper-text .me-auto:not(:empty)) {
  margin-top: var(--space-1) !important;
}
/* [mirror] "Error messages (row #34)" helper text, except `margin: 0`, which is link-sheet only (keep it
   when deduping) */
.mud-dialog.fc-link .mud-input-helper-text {
  margin: 0 !important;
  color: #D32F2F !important;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size) !important;
  font-weight: var(--fw-normal);
  line-height: var(--text-label-md-lh) !important;
  letter-spacing: 0.2px;
}
.mud-dialog.fc-link .mud-input-helper-text.mud-input-error .me-auto:not(:empty) {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.mud-dialog.fc-link .mud-input-helper-text.mud-input-error .me-auto:not(:empty)::before {
  content: "\f071";   /* fa-triangle-exclamation (solid) */
  font-family: "Font Awesome 6 Pro", "Font Awesome 7 Free", "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Components/FieldError.razor: the same look for the hand-rolled select's message. */
.fc-field-error {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  color: #D32F2F;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  letter-spacing: 0.2px;
}
.fc-field-error > i {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 20px;
  --fa-display: inline-flex;   /* the FA kit's late `display: var(--fa-display, inline-block)` */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ID Type select: v3.1's .fc-native-select as the Profile modal draws it on focus (1px #000 + 2px blue
   inside it; the select's own ring off), scoped to the link sheet. When invalid, the select's own
   2px #D32F2F (Accessibility.css) is the only border: no blue band inside the red, as text fields. */
/* [mirror] the two "Focus = v3.0.2's blue ring" .fc-native-select rules */
.mud-dialog.fc-link .fc-native-select.fc-focus-field:focus-within {
  box-shadow: inset 0 0 0 1px #000000, inset 0 0 0 3px var(--color-brand-primary);
}
.mud-dialog.fc-link .fc-native-select select:focus-visible {
  box-shadow: none;
  outline: none;
}
/* Link-sheet only: the invalid select drops the wrapper's rings. */
.mud-dialog.fc-link .fc-native-select.fc-focus-field:has(> select[aria-invalid="true"]) {
  box-shadow: none;
}

/* Link By Code: Secondary (outlined) at Momento's 48px size; hover, press and focus come from the
   .fc-btn-outlined marker (PressFeedback.css). */
.fc-link-bycode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  height: 48px;
  padding: 0 var(--space-2);
  background: var(--color-surface-default);
  border: 1.5px solid var(--color-brand-primary);
  border-radius: var(--radius-lg);
  color: var(--color-brand-primary);
  font-family: var(--font-heading);
  font-size: var(--text-action-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh);
  cursor: pointer;
}

/* Link By Code step: info banner (v3.0.1 / v2.1: brand blue at 8%, icon circle at 18%). */
.fc-linkcode-banner {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-brand-primary) 8%, transparent);
}
.fc-linkcode-banner-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-brand-primary) 18%, transparent);
  color: var(--color-brand-primary);
  font-size: 16px;
}
.fc-linkcode-banner-text {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-primary);
}

/* Footer: the content's 16px bottom inset is the gap above the buttons (no extra margin). On phones a
   PAIRED row (submit + Cancel, half-width each) drops its labels to 14px on one line, like the Profile
   modals' rows (ProfileMenu.css); a lone full-width submit (the code step's Verify Code) keeps the
   Momento 16/24 label of .mudbutton-ui. */
.fc-linksheet .fc-modal-actions { margin-top: 0; }
@media (max-width: 600px) {
  .fc-linksheet .fc-modal-actions:has(> .fc-modal-cancel) .fc-modal-submit {
    font-size: var(--text-label-md-size);
    white-space: nowrap;
  }
}

/* "Is this you?": compare card on surface-subtle, rows 16px, hairline between; 20px native checkbox in a
   24px frame so it lines up with the first text line (no nudges); text gaps 0. */
.fc-namematch-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.fc-namematch-compare {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.fc-namematch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
}
.fc-namematch-row + .fc-namematch-row { border-top: 1px solid var(--color-border); }
.fc-namematch-key,
.fc-namematch-val {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
}
.fc-namematch-key {
  font-weight: var(--fw-normal);
  color: var(--color-text-muted);
}
.fc-namematch-val {
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  text-align: right;
  overflow-wrap: anywhere;
}
.fc-namematch-val--linked { color: var(--color-brand-primary); }
.fc-namematch-opt {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  margin: 0;
  cursor: pointer;
}
.fc-namematch-cbframe {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fc-namematch-cb {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-brand-primary);
  cursor: pointer;
}
.fc-namematch-opt-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fc-namematch-opt-title {
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}
.fc-namematch-opt-sub {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}
.fc-namematch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  width: 100%;
}

/* "Linked Account Error": red circle-info (v3.1's destructive #D32F2F), 16/24 secondary body text. */
.fc-linksheet-headicon.fc-linkerr-icon { color: #D32F2F; }
.fc-linkerr-body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-secondary);
}

/* Reduced motion: v3.1's app.css turns off the dialog entrances but not the step slides. */
@media (prefers-reduced-motion: reduce) {
  .fc-linksheet .fc-step-enter-right,
  .fc-linksheet .fc-step-enter-left { animation: none; }
}
