/**
 * FM-AUTH-007B — Review & submission experience repair
 * Floating FM atmosphere; no white action panels; calm submitted states.
 */

body.fm-auth-007b-auth {
  --fm-007b-ink: #F4F0E6;
  --fm-007b-muted: #C5CEC7;
  --fm-007b-soft: #9AA89F;
  --fm-007b-chip-ok-bg: rgba(79, 154, 102, 0.18);
  --fm-007b-chip-ok-fg: #B7E0C2;
  --fm-007b-chip-warn-bg: rgba(201, 162, 39, 0.18);
  --fm-007b-chip-warn-fg: #F0D78C;
}

/* Atmosphere on applicant verification page */
body.fm-auth-007b-auth.fm-ds-001c-applicant:not(.fma-crm-ready) #main,
body.fm-auth-007b-auth.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #main {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(245, 241, 232, 0.14) 0%, transparent 58%),
    linear-gradient(165deg, #0C221A 0%, #163528 32%, #2A4038 62%, #3A4540 100%) !important;
  min-height: 100vh;
}

body.fm-auth-007b-auth.fm-ds-001c-applicant:not(.fma-crm-ready) #page-verification {
  background: transparent !important;
  padding: 0 !important;
}

/* Remove competing Agent Verification chrome */
body.fm-auth-007b-auth #topbar,
body.fm-auth-007b-auth .topbar,
body.fm-auth-007b-auth #tb-title,
body.fm-auth-007b-auth .tb-mode,
body.fm-auth-007b-auth #lang-bar,
body.fm-auth-007b-auth .lang-bar,
body.fm-auth-007b-auth [data-testid="lang-switcher"],
body.fm-auth-007b-auth .lang-switch {
  display: none !important;
}

body.fm-auth-007b-auth #fm-ds-001c-wizard {
  max-width: min(520px, 92vw);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(40px, env(safe-area-inset-bottom));
  background: transparent !important;
}

body.fm-auth-007b-auth .fm-wiz-shell {
  width: 100%;
  max-width: min(520px, 100%);
  margin: 0 auto;
  padding: 8px 0 32px;
  text-align: center;
}

/* Kill white cards / sticky action panels */
body.fm-auth-007b-auth .fm-wiz-card,
body.fm-auth-007b-auth #fm-ds-001c-wizard .fm-wiz-card {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 28px !important;
  overflow: visible !important;
  max-height: none !important;
}

body.fm-auth-007b-auth .fm-wiz-card::before,
body.fm-auth-007b-auth .fm-wiz-card::after {
  display: none !important;
  content: none !important;
}

body.fm-auth-007b-auth .fm-wiz-actions,
body.fm-auth-007b-auth #fm-ds-001c-wizard .fm-wiz-actions {
  position: static !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin-top: 28px !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

body.fm-auth-007b-auth .fm-wiz-actions-review {
  margin-top: 28px !important;
}

body.fm-auth-007b-auth .fm-wiz-actions .fm-auth-btn-primary {
  width: 100%;
  min-width: 0;
  order: 1;
}

body.fm-auth-007b-auth .fm-wiz-actions .fm-auth-btn-secondary,
body.fm-auth-007b-auth .fm-wiz-actions [data-wiz="back"] {
  order: 2;
  width: 100%;
  background: transparent !important;
  border: 1px solid rgba(244, 240, 230, 0.35) !important;
  color: var(--fm-007b-ink) !important;
}

body.fm-auth-007b-auth .fm-wiz-actions .fm-auth-btn-tertiary,
body.fm-auth-007b-auth .fm-wiz-actions [data-wiz="draft"] {
  order: 3;
  width: auto;
  align-self: center;
  background: transparent !important;
  border: 0 !important;
  color: var(--fm-007b-muted) !important;
  text-decoration: underline;
  min-height: 40px;
  box-shadow: none !important;
}

body.fm-auth-007b-auth .fm-wiz-title {
  color: var(--fm-007b-ink) !important;
  margin: 32px 0 12px !important;
}

body.fm-auth-007b-auth .fm-wiz-purpose {
  color: var(--fm-007b-muted) !important;
  margin: 0 0 20px !important;
}

body.fm-auth-007b-auth .fm-wiz-progress {
  color: rgba(245, 241, 232, 0.82) !important;
  margin-top: 24px !important;
}

body.fm-auth-007b-auth .fm-wiz-bar {
  background: rgba(245, 241, 232, 0.22) !important;
}

body.fm-auth-007b-auth .fm-wiz-bar > i {
  background: #F4F0E6 !important;
}

/* Review section rows */
body.fm-auth-007b-auth .fm-wiz-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: start;
  width: 100%;
}

body.fm-auth-007b-auth .fm-wiz-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(245, 241, 232, 0.12);
  color: var(--fm-007b-muted);
  font-size: 14px;
}

body.fm-auth-007b-auth .fm-wiz-summary-row:last-child {
  border-bottom: 0;
}

body.fm-auth-007b-auth .fm-wiz-summary-name {
  color: var(--fm-007b-ink);
  font-weight: 650;
  flex: 1 1 auto;
  min-width: 120px;
}

body.fm-auth-007b-auth .fm-wiz-summary-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

body.fm-auth-007b-auth .fm-wiz-summary-missing {
  width: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--fm-007b-chip-warn-fg);
  line-height: 1.4;
}

body.fm-auth-007b-auth .fm-wiz-chip {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid transparent;
}

body.fm-auth-007b-auth .fm-wiz-chip.ok {
  background: var(--fm-007b-chip-ok-bg);
  color: var(--fm-007b-chip-ok-fg);
  border-color: rgba(183, 224, 194, 0.35);
}

body.fm-auth-007b-auth .fm-wiz-chip.warn {
  background: var(--fm-007b-chip-warn-bg);
  color: var(--fm-007b-chip-warn-fg);
  border-color: rgba(240, 215, 140, 0.35);
}

body.fm-auth-007b-auth .fm-wiz-summary-row .fm-auth-link {
  color: var(--fm-007b-ink);
  text-decoration: underline;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

/* Confirmation */
body.fm-auth-007b-auth .fm-wiz-confirm {
  margin-top: 32px;
  text-align: start;
  width: 100%;
}

body.fm-auth-007b-auth .fm-wiz-confirm .fm-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--fm-007b-ink);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
}

body.fm-auth-007b-auth .fm-wiz-confirm input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: #2d6a4f;
}

body.fm-auth-007b-auth .fm-wiz-confirm-err {
  margin-top: 8px;
  color: #f2b8b5;
  font-size: 13px;
  min-height: 1.2em;
}

/* Submitted / status pages */
body.fm-auth-007b-auth [data-testid="fm-ds-001c-submitted"] .fm-wiz-title,
body.fm-auth-007b-auth [data-testid="fm-ds-001c-info-requested"] .fm-wiz-title,
body.fm-auth-007b-auth [data-testid="fm-ds-001c-activation"] .fm-wiz-title,
body.fm-auth-007b-auth [data-testid="fm-ds-001c-view-submission"] .fm-wiz-title,
body.fm-auth-007b-auth [data-testid="fm-ds-001c-update-contact"] .fm-wiz-title {
  margin-top: 36px !important;
}

body.fm-auth-007b-auth .fm-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 32px auto 0;
}

body.fm-auth-007b-auth .fm-auth-actions .fm-auth-btn-tertiary,
body.fm-auth-007b-auth .fm-auth-actions [data-sub="support"],
body.fm-auth-007b-auth .fm-auth-actions [data-sub="signout"],
body.fm-auth-007b-auth .fm-auth-actions [data-act="support"],
body.fm-auth-007b-auth .fm-auth-actions [data-act="signout"],
body.fm-auth-007b-auth .fm-auth-actions [data-info="support"],
body.fm-auth-007b-auth .fm-auth-actions [data-view="support"] {
  color: var(--fm-007b-ink) !important;
  background: transparent !important;
  border: 0 !important;
  text-decoration: underline;
  opacity: 0.92;
}

body.fm-auth-007b-auth .fm-submitted-status {
  margin: 22px 0 18px;
  font-size: 14px;
  color: var(--fm-007b-muted);
}

body.fm-auth-007b-auth .fm-submitted-status strong {
  color: var(--fm-007b-ink);
}

body.fm-auth-007b-auth .fm-auth-hint {
  color: var(--fm-007b-soft) !important;
}

body.fm-auth-007b-auth .fm-auth-field label {
  color: var(--fm-007b-ink);
}

body.fm-auth-007b-auth .fm-submit-fail {
  margin-top: 20px;
  text-align: start;
  color: var(--fm-007b-ink);
}

@media (max-width: 640px) {
  body.fm-auth-007b-auth .fm-wiz-summary-row {
    flex-direction: column;
    align-items: flex-start;
  }
  body.fm-auth-007b-auth .fm-wiz-summary-meta {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-height: 820px) {
  body.fm-auth-007b-auth .fm-auth-mark img {
    height: 52px !important;
  }
  body.fm-auth-007b-auth .fm-auth-name {
    font-size: 1.35rem !important;
  }
  body.fm-auth-007b-auth .fm-wiz-progress {
    margin-top: 16px !important;
  }
  body.fm-auth-007b-auth .fm-wiz-title {
    margin-top: 20px !important;
    font-size: 1.35rem !important;
  }
  body.fm-auth-007b-auth .fm-wiz-purpose {
    margin-bottom: 12px !important;
  }
  body.fm-auth-007b-auth .fm-wiz-card {
    margin-top: 16px !important;
  }
  body.fm-auth-007b-auth .fm-wiz-summary-row {
    padding: 10px 0;
  }
  body.fm-auth-007b-auth .fm-wiz-confirm {
    margin-top: 22px;
  }
  body.fm-auth-007b-auth .fm-wiz-actions-review {
    margin-top: 20px !important;
    gap: 10px;
  }
  body.fm-auth-007b-auth .fm-wiz-shell {
    padding-bottom: 24px;
  }
}

html[dir="rtl"] body.fm-auth-007b-auth .fm-wiz-summary-row {
  text-align: start;
}

html[dir="rtl"] body.fm-auth-007b-auth .fm-wiz-confirm .fm-auth-check {
  text-align: start;
}

@media (prefers-reduced-motion: reduce) {
  body.fm-auth-007b-auth * {
    scroll-behavior: auto !important;
  }
}
