/* ================================================================
   Login.css — SignIn full-flow drawers.
   Visual parity with Pawn Marketplace v3.0.1; tokens only (no global edits).

   SCOPING: the SignIn + CommonDrawer <MudDrawer>s carry an extra marker class
   `fc-signin-sheet`. All overrides of the SHARED classes (.custom-bottom-drawer,
   .mudbutton-*, .rounded-textfield, .mud-input-*) are scoped under it so the
   centered-modal + 16px-red-button look applies to SignIn ONLY and never ripples
   to Profile / loan drawers, which keep the global app.css treatment.
   ================================================================ */

/* ── Centered modal sheet (v3.0.1 is a vertically-centered modal, not bottom-anchored).
   Higher specificity than app.css `.custom-bottom-drawer` / `.drawer-open`, and loaded
   after app.css, so it wins for SignIn without editing the global. ── */
.custom-bottom-drawer.fc-signin-sheet {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  /* NOTE: the resting transform is set on the 4-class `.drawer-open.mud-drawer--open` rule below
     WITHOUT !important — an author !important here would override (block) the entrance keyframe
     animation per the CSS cascade, which is exactly why the slide-up never played. */
  width: 100% !important;   /* v3 behaves as width:100% + max-width:760 (full-width until >760px, then capped/centered) */
  max-width: 760px !important;
  height: auto !important;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: var(--color-drawer-bg);
  border-radius: var(--radius-xl) !important;   /* all corners rounded (floating modal) */
  /* Sit above MudBlazor's drawer overlay/scrim. The `transform` above creates a stacking
     context that let this app's overlay (z-index = appbar+1) paint over the drawer, dimming
     it and stealing clicks. A high z-index puts the modal above the scrim again.
     Now the shared modal band (tokens.css) instead of a bare 2000 — at 2000 this sheet TIED
     .fc-megamenu-backdrop and LOST to .fc-megamenu-panel (2001), so opening Sign In from the
     mega menu left the menu painted on top of it. This rule keeps its own !important because
     `.custom-bottom-drawer.fc-signin-sheet` (0,2,0) outranks Modal.css's `.custom-bottom-drawer`
     (0,1,0), so the generic rule there cannot reach it. */
  /* FCApp: the literal 2000, not var(--fc-z-modal) — this fork's tokens.css has no z-index
     scale, so the var would compute to `auto` and drop the sheet behind the scrim. There is no
     mega menu in this fork either, so 2000 is unambiguous. */
  z-index: 2000 !important;
  pointer-events: auto !important;
  margin: 0 !important;
  padding: var(--space-2) !important;            /* modal insets 16px app-wide */
  box-sizing: border-box;
  animation: fc-signin-modal-in 0.34s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}
/* Mobile: dock to bottom as a sheet */
@media (max-width: 600px) {
  .custom-bottom-drawer.fc-signin-sheet {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    /* resting translateY(0) set on the 4-class rule below (no !important, so the slide-up keyframe plays) */
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    animation: fc-signin-slide-up 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
  }
}

/* Resting transform WITHOUT !important — 4 classes tie MudBlazor's
   `.mud-drawer.mud-drawer-temporary.mud-drawer-pos-bottom.mud-drawer--open` and win by load order
   (Login.css is after MudBlazor.min.css). Being non-important, the entrance keyframes above can
   still drive `transform`, so the drawer visibly slides up. */
.custom-bottom-drawer.fc-signin-sheet.drawer-open.mud-drawer--open { transform: translate(-50%, -50%); }
@media (max-width: 600px) {
  .custom-bottom-drawer.fc-signin-sheet.drawer-open.mud-drawer--open { transform: translateY(0); }
}
/* Desktop centered modal: slide UP from near the bottom of the screen into the centered position —
   a clear, bottom-sheet-style bottom→up entrance (backwards fill-mode holds the start frame so it
   doesn't flash at the end state). */
@keyframes fc-signin-modal-in {
  from { opacity: 0; transform: translate(-50%, 45vh); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes fc-signin-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── Drawer header / title ── */
.mud-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  min-height: unset !important;
  margin-bottom: var(--space-2);
}
/* Title — scoped to the SignIn flow ONLY (was leaking globally to profile-edit drawers, forcing
   their 20px titles up to 24px). !important so it wins over MudText Typo.h6 typography (v3 = xbold Inter). */
.fc-signin-sheet .mud-drawer-header-label {
  color: var(--color-text-primary) !important;
  font-family: var(--font-heading) !important;
  font-size: var(--text-heading-md-size) !important;
  font-weight: var(--fw-xbold) !important;   /* v3 sign-in title is extra-bold (800) */
  line-height: var(--text-heading-md-lh) !important;
  letter-spacing: -0.12px;
  text-align: start;
}

/* ── Form + sub-labels ── */
.mud-drawer-form {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  align-self: stretch;
}
/* Force the 16px inter-row gap (v3 parity). Something in the app's cascade collapses the form gap to
   0 on FCApp, so spacing was leaking to ad-hoc inline margins; this restores clean gap-based spacing
   so rows without their own margins (Create Password checklist, OTP Code block) aren't tight. */
.fc-signin-sheet .mud-drawer-form { gap: var(--space-2) !important; }
.mud-drawer-sub-label {
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-label-md-lh);
  text-align: start;
  display: block;
  margin-bottom: var(--space-1);   /* label → input gap */
}

/* ── Inputs (v3: 1.5px grey resting border, body font, light placeholder) ── */
.fc-signin-sheet .rounded-textfield .mud-input-outlined-border {
  border-radius: var(--radius-lg) !important;
  border: 1.5px solid var(--color-border) !important;
  border-width: 1.5px !important;
  border-color: var(--color-border) !important;
}
.fc-signin-sheet .mud-input-slot {
  font-family: var(--font-body) !important;
  color: var(--color-text-primary) !important;
}
.fc-signin-sheet .mud-input-slot::placeholder {
  color: var(--color-text-disabled) !important;
  opacity: 1;
}
/* Focus ring — v3.0.1's single treatment: a 2px inset brand-blue ring on focus.
   Doubled trailing class bumps specificity so it outranks the resting-border rule.
   Scoped to the sign-in flow (all drawers carry .fc-signin-sheet). */
.fc-signin-sheet .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border.mud-input-outlined-border {
  box-shadow: inset 0 0 0 2px var(--color-brand-primary) !important;
}

/* Error state: handled app-wide in Accessibility.css (one rounded red border for every field,
   Kelly 2026-08-20 "ALL errored input fields should be the same"). The sign-in-only copy that
   briefly lived here was removed the same day so there is a single source. */

/* Layout helpers */
.fc-name-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); width: 100%; }
.fc-back-row { display: flex; justify-content: flex-start; width: 100%; }

/* ── Links ── */
.forgot-password-label,
.create-account-hyperlabel {
  color: var(--color-info);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh);
  text-decoration-line: underline;
  cursor: pointer;
}
.already-have-account-hyperlabel {
  color: var(--color-info);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.create-account-hyperlabel-disbaled { pointer-events: none; user-select: none; color: var(--color-text-disabled); }

/* ── Error text ── */
.sign-in-error-block { display: flex; justify-content: flex-start; align-items: center; padding: 0; }
.sign-in-error-text {
  color: var(--color-error);
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  font-weight: var(--fw-normal);
  line-height: var(--text-xs-lh);
  letter-spacing: 0.2px;
}

.right-text-align { width: 100%; display: flex; justify-content: center; align-items: center; }
.mud-divider-light { opacity: 1; }

/* ── Terms text (v3: 14px, muted) ── */
.terms_text_cls {
  text-align: center;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  color: var(--color-text-muted);
  line-height: var(--text-action-md-lh);
  margin-top: var(--space-1);
}
.terms_text_cls .terms-link {
  color: var(--color-info);
  font-weight: var(--fw-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ── Links row (forgot / create) ── */
.signin-links-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }

/* ── Primary CTA (v3: 16px rounded-rect, always red, heading font, full width) ── */
.fc-signin-sheet .mudbutton-ui,
.fc-signin-sheet .mudbutton-grey {
  display: flex; width: 100%; height: 56px; min-height: 56px;
  padding: var(--space-2) var(--space-2);
  justify-content: center; align-items: center; gap: var(--space-1);
  border-radius: var(--radius-lg) !important;
  color: var(--color-surface-default);
  text-align: center; font-family: var(--font-heading);
  font-size: var(--text-action-md-size); font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh); letter-spacing: 0.2px;
  text-transform: none; border: none;
}
.fc-signin-sheet .mudbutton-ui { background: var(--color-brand-accent) !important; color: var(--color-surface-default) !important; }
/* Hover = brighten (v3 .btn-primary), press = darken+shrink. Force background so MudButton's
   dark hover overlay can't darken it; !important on filter so it always brightens.
   Hover only: keyboard focus is the Primary focus look in Accessibility.css (20% darker, v3.0.2's,
   Kelly 2026-09-30). v3.0.2 also brightened this one Primary on focus, which made it the odd one
   out; Kelly's 09-30 pick was "Primary: darken only", so that part was not brought back. */
.fc-signin-sheet .mudbutton-ui:hover {
  background-color: var(--color-brand-accent) !important;
  filter: brightness(1.2) !important;
}
.fc-signin-sheet .mudbutton-ui:active {
  background-color: var(--color-brand-accent) !important;
  filter: brightness(0.8) !important;
  transform: scale(0.99);
}
.fc-signin-sheet .mudbutton-grey { background: var(--color-text-disabled) !important; color: var(--color-surface-default) !important; }

/* Tighten inner insets to match v3 (16px drawer padding, no extra header/content padding).
   The .drawer-open + width/max-width use 3-class specificity to beat ProfileMenuDrawer.css's
   `.custom-bottom-drawer.drawer-open { width: 718px !important }` (loaded after this file). */
.custom-bottom-drawer.fc-signin-sheet,
.custom-bottom-drawer.fc-signin-sheet.drawer-open {
  padding: var(--space-2) !important;
  width: 100% !important;   /* v3 behaves as width:100% + max-width:760 (full-width until >760px, then capped/centered) */
  min-width: 320px !important;
  max-width: 760px !important;
}
/* Mobile: full-width sheet. Placed AFTER the desktop 92% rule above and at equal (0,3,0) specificity
   so it wins on ≤600px (otherwise the desktop 92% + left:0 leaves ~8% empty on the right). */
@media (max-width: 600px) {
  .custom-bottom-drawer.fc-signin-sheet.drawer-open {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    /* 16px modal inset + the system nav-bar / home-indicator inset (Kelly, 2026-08-19: modal
       bottom padding is 16px on mobile, above the device chrome). Only here: at <=600px this
       sheet docks to bottom:0, whereas the >600px rule keeps a flat 16px because the sheet is
       vertically centered there with no chrome beneath it. Has to live on THIS (0,3,0)
       !important rule rather than the two-class rule above, which would otherwise win. */
    padding: var(--space-2) var(--space-2) calc(var(--space-2) + var(--fc-bottom-inset)) !important;
  }
}
.fc-signin-sheet .mud-drawer-content { padding: 0 !important; }
.fc-signin-sheet .mud-drawer-header {
  padding: 0 !important;
  min-height: 0 !important;
  margin-bottom: var(--space-2) !important;   /* title → content gap = 16px (v3) */
}

/* Footer above the CTA. The full-bleed negative margin stays (v3 footer margin = 8px -16px 0 -16px,
   gap 0 to the drawer edge) and the padding restores the button's 16px inset so it aligns with the
   fields — but the `border-top: 1px solid var(--color-border)` is GONE (Kelly, 2026-08-20: "The
   Momento Design System does not have that for any of the modals"). It was carried over from
   v3.0.1's `.sign-in-footer`, and this one rule drew the line on all three sheets — Sign In,
   Forgot Password and Create an Account all carry .fc-signin-sheet. */
.fc-signin-sheet .fc-drawer-footer {
  margin: var(--space-1) calc(-1 * var(--space-2)) 0 !important;
  padding: var(--space-2) var(--space-2) 0 !important;
}

.fc-email-wrap { position: relative; width: 100%; }

/* ── iOS fix: keep the Sign In button / footer from being covered by the tab bar ──
   The sheet already sits at z-index 2000, but on iOS that doesn't help: the sheet's
   stacking context is trapped inside .page while the fixed bottom tab bar
   (.custom-tabs-p / .mud-tabs-toolbar, z-index 1000) is a LATER sibling of .page, so
   the WebView paints the tab bar ON TOP of the sheet and it covered the footer. Hide
   the tab bar while any sign-in-flow sheet is open (all carry .fc-signin-sheet:
   sign-in, create-profile, CommonDrawer/email-verify). Same fix already used for
   #sort-filter-drawer and #store-location-drawer. Android is unaffected either way.
   FCApp-only: NOT present in v3.0.2. Do not drop it when syncing. */
html:has(.fc-signin-sheet.drawer-open) .custom-tabs-p,
html:has(.fc-signin-sheet.drawer-open) .mud-tabs-toolbar {
    display: none !important;
}

/* ── KEPT FROM MAIN ──────────────────────────────────────────────
   Rules 3.2 does not have. Appended after its stylesheet so they still win on equal
   specificity, exactly as they did before the import. */
/* ── KEPT FROM MAIN ──────────────────────────────────────────────
   Rules the reference project does not have. Appended after its stylesheet so they
   still win on equal specificity, exactly as they did before the import. */
/* Hover = brighten (v3 .btn-primary), press = darken+shrink. Force background so MudButton's
   dark hover overlay can't darken it; !important on filter so it always brightens. */
.fc-signin-sheet .mudbutton-ui:hover,
.fc-signin-sheet .mudbutton-ui:focus-visible {
  background-color: var(--color-brand-accent) !important;
  filter: brightness(1.2) !important;
}
