/**
 * FM-POLISH-005F — Compact Auth Walkthrough
 * Shared shell for Sign In / Create Account / recovery.
 * No internal card scrollbars on normal laptops.
 */

body.fm-polish-005f-auth #fm-ds-001c-root.fm-polish-005-root,
body.fm-polish-005f-auth #fm-ds-001c-root.fm-ds-002-root {
  width: clamp(460px, 38vw, 540px) !important;
  max-width: min(72vw, 540px) !important;
}

body.fm-polish-005f-auth #auth-session-overlay.fm-ds-001c-overlay {
  padding-top: clamp(16px, 3.5vh, 40px) !important;
  padding-bottom: clamp(12px, 2.5vh, 28px) !important;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Shared shell — no internal card scrollbar */
body.fm-polish-005f-auth .fm-auth-card.fm-auth-shell,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"],
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-create"],
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-forgot"],
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-reset"] {
  overflow: visible !important;
  max-height: none !important;
  padding: 20px 26px 16px !important;
}

/* Compact brand header (non-Welcome) — beat 005D form-card mark sizes */
body.fm-polish-005f-auth .fm-auth-brand-compact {
  margin-bottom: 0;
}
body.fm-polish-005f-auth .fm-auth-brand-compact .fm-auth-mark,
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-mark,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-mark,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-mark,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-forgot"] .fm-auth-mark,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-reset"] .fm-auth-mark {
  margin: 0 0 8px !important;
  padding: 0 !important;
}
body.fm-polish-005f-auth .fm-auth-brand-compact .fm-auth-mark img,
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-mark img,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-mark img,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-mark img,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-forgot"] .fm-auth-mark img,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-reset"] .fm-auth-mark img,
body.fm-polish-005f-auth.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-mark img,
body.fm-polish-005f-auth.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-mark img {
  height: clamp(64px, 7.5vh, 74px) !important;
  max-height: 74px !important;
  filter: none !important;
}
body.fm-polish-005f-auth .fm-auth-brand-compact .fm-auth-name,
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-name {
  font-size: clamp(26px, 2vw, 32px) !important;
  margin: 0 !important;
}
body.fm-polish-005f-auth .fm-auth-brand-compact .fm-auth-tagline,
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-tagline {
  margin-top: 6px !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
}

/* Titles / purpose */
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-title,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-title,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-forgot"] .fm-auth-title,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-reset"] .fm-auth-title {
  margin-top: 18px !important;
  margin-bottom: 0 !important;
  font-size: clamp(24px, 1.9vw, 28px) !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-purpose,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-purpose,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-forgot"] .fm-auth-purpose,
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-reset"] .fm-auth-purpose {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  font-size: 14.5px !important;
  line-height: 1.35 !important;
  white-space: normal;
  max-width: none;
}

/* Hide trust + company footer on active form cards */
body.fm-polish-005f-auth .fm-polish-005-trust,
body.fm-polish-005f-auth [data-testid="fm-polish-005-signin-trust"] {
  display: none !important;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-legal-org,
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-legal-loc,
body.fm-polish-005f-auth .fm-wiz-shell .fm-auth-legal-org,
body.fm-polish-005f-auth .fm-wiz-shell .fm-auth-legal-loc {
  display: none !important;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-legal-footer,
body.fm-polish-005f-auth .fm-wiz-shell .fm-auth-legal-footer {
  margin-top: 20px !important;
  font-size: 13.5px;
  color: #6F786F;
}

/* Compact form density */
body.fm-polish-005f-auth .fm-auth-shell form,
body.fm-polish-005f-auth .fm-auth-shell .fm-polish-005-enter-4 {
  margin-top: 18px;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field {
  margin-bottom: 12px !important;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field label {
  margin-bottom: 8px !important;
  font-size: 13.5px;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field input,
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field select,
body.fm-polish-005f-auth .fm-wiz-shell .fm-auth-field input,
body.fm-polish-005f-auth .fm-wiz-shell .fm-auth-field select {
  min-height: 46px !important;
  height: 46px !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  border-radius: 12px !important;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field textarea,
body.fm-polish-005f-auth .fm-wiz-shell .fm-auth-field textarea {
  min-height: 72px !important;
  height: auto !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  border-radius: 12px !important;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field select[multiple] {
  height: auto !important;
  min-height: 88px !important;
}

body.fm-polish-005f-auth .fm-auth-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}
body.fm-polish-005f-auth .fm-auth-nav-line {
  margin: 16px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: #5C6861;
}
body.fm-polish-005f-auth .fm-auth-back-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

body.fm-polish-005f-auth .fm-auth-shell .fm-auth-btn {
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 16px !important;
  padding: 11px 16px !important;
}
body.fm-polish-005f-auth .fm-auth-shell .fm-auth-btn-primary {
  margin-top: 4px;
}

/* Progress — compact */
body.fm-polish-005f-auth .fm-auth-step-meta,
body.fm-polish-005f-auth .fm-wiz-progress {
  font-size: 12.5px !important;
  letter-spacing: 0.04em;
  margin-bottom: 8px !important;
}
body.fm-polish-005f-auth .fm-auth-step-bar,
body.fm-polish-005f-auth .fm-wiz-bar {
  height: 3px !important;
  margin-bottom: 16px !important;
}

/* Wizard shell density */
body.fm-polish-005f-auth .fm-wiz-shell {
  max-width: 540px;
  margin: 0 auto;
  padding: 20px 8px 28px;
}
body.fm-polish-005f-auth .fm-wiz-shell .fm-wiz-title {
  margin-top: 18px !important;
  font-size: clamp(24px, 2vw, 28px) !important;
}
body.fm-polish-005f-auth .fm-wiz-shell .fm-wiz-purpose {
  margin-top: 8px !important;
  font-size: 15px !important;
}
body.fm-polish-005f-auth .fm-wiz-shell .fm-wiz-card {
  margin-top: 18px;
  overflow: visible !important;
  max-height: none !important;
}
body.fm-polish-005f-auth .fm-wiz-shell .fm-wiz-actions {
  margin-top: 20px;
  gap: 12px;
}
body.fm-polish-005f-auth #fm-ds-001c-wizard {
  overflow: visible;
}

/* Sign In — densest gateway (must fit 1366×768 without page scroll) */
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] {
  padding: 16px 24px 14px !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-title {
  margin-top: 14px !important;
  font-size: 1.45rem !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-purpose {
  margin-top: 6px !important;
  font-size: 14px !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] form {
  margin-top: 14px !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-field {
  margin-bottom: 10px !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-err:empty {
  display: none;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-inline-row {
  margin: 0 0 14px;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-nav-line {
  margin-top: 12px;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-back-link {
  margin-top: 10px;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-legal-footer {
  margin-top: 14px !important;
}
body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-btn {
  min-height: 46px !important;
}
body.fm-polish-005f-auth #auth-session-overlay.fm-ds-001c-overlay:has([data-testid="fm-ds-001c-signin"]) {
  padding-top: 12px !important;
  padding-bottom: 10px !important;
}
body.fm-polish-005f-auth .fm-polish-005-watermark {
  opacity: 0.04 !important;
}

/* Short laptop */
@media (max-height: 820px) {
  body.fm-polish-005f-auth .fm-auth-brand-compact .fm-auth-mark img,
  body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-mark img {
    height: 58px !important;
    max-height: 58px !important;
  }
  body.fm-polish-005f-auth .fm-auth-card.fm-auth-shell {
    padding: 14px 20px 12px !important;
  }
  body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] {
    padding: 12px 20px 10px !important;
  }
  body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-title,
  body.fm-polish-005f-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-title {
    margin-top: 12px !important;
    font-size: 1.35rem !important;
  }
  body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field {
    margin-bottom: 8px !important;
  }
  body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field input,
  body.fm-polish-005f-auth .fm-auth-shell .fm-auth-field select {
    min-height: 42px !important;
    height: 42px !important;
  }
  body.fm-polish-005f-auth .fm-auth-shell .fm-auth-btn {
    min-height: 44px !important;
  }
}

@media (max-width: 640px) {
  body.fm-polish-005f-auth #fm-ds-001c-root.fm-polish-005-root {
    width: calc(100% - 28px) !important;
  }
  body.fm-polish-005f-auth .fm-auth-inline-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.fm-polish-005f-auth .fm-auth-btn-primary:hover {
    transform: none;
  }
}

/* RTL */
html[dir="rtl"] body.fm-polish-005f-auth .fm-auth-inline-row {
  flex-direction: row-reverse;
}
html[dir="rtl"] body.fm-polish-005f-auth .fm-wiz-actions {
  flex-direction: row-reverse;
}
