/**
 * FM-DS-001C — Authentication & guided signup
 * Light, calm auth shell — no dark-green operational chrome.
 */

/* Auth-only: hide operational shell completely */
body.fm-ds-001c-auth #sidebar,
body.fm-ds-001c-auth #sb-resize,
body.fm-ds-001c-auth #cal-dock,
body.fma-applicant-auth-only.fm-ds-001c-auth #sidebar,
body.fma-applicant-auth-only.fm-ds-001c-auth #main,
body.fma-applicant-auth-only.fm-ds-001c-auth #sb-resize,
body.fma-applicant-auth-only.fm-ds-001c-auth #cal-dock {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.fma-applicant-auth-only.fm-ds-001c-auth #auth-session-overlay,
body.fm-ds-001c-auth #auth-session-overlay.fm-ds-001c-overlay {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #f7f8f7 !important;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(250, 248, 243, .9), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(238, 244, 240, .8), transparent 50%) !important;
  z-index: 200;
  padding: 24px;
}

body.fma-applicant-auth-only.fm-ds-001c-auth .auth-panel,
#auth-session-overlay.fm-ds-001c-overlay .auth-panel {
  display: none !important; /* replaced by #fm-ds-001c-root */
}

#fm-ds-001c-root {
  width: min(440px, 100%);
  margin: 0 auto;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  color: #152019;
}
#fm-ds-001c-root.fm-ds-001c-wide { width: min(640px, 100%); }

.fm-auth-card {
  background: #fff;
  border: 1px solid rgba(21, 32, 25, .08);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 8px 32px rgba(15, 35, 24, .06);
}
.fm-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  gap: 6px;
}
.fm-auth-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, #faf8f3, #eef4f0);
  border: 1px solid rgba(45, 106, 79, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  color: #2d6a4f;
}
.fm-auth-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #152019;
  margin: 0;
}
.fm-auth-tagline {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  font-style: italic;
}
.fm-auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #152019;
  text-align: center;
}
.fm-auth-purpose {
  font-size: 14px;
  line-height: 1.5;
  color: #5c6b62;
  margin: 0 0 24px;
  text-align: center;
}
.fm-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fm-auth-btn {
  min-height: 44px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 0 16px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.fm-auth-btn-primary {
  background: #2d6a4f;
  color: #fff;
}
.fm-auth-btn-primary:hover { background: #245a42; }
.fm-auth-btn-secondary {
  background: #fff;
  color: #152019;
  border-color: rgba(21, 32, 25, .14);
}
.fm-auth-btn-tertiary {
  background: transparent;
  border: 0;
  color: #2d6a4f;
  text-decoration: underline;
  min-height: auto;
  padding: 8px 0;
  font-weight: 600;
}
.fm-auth-btn:focus-visible {
  outline: 2px solid #2d6a4f;
  outline-offset: 2px;
}
.fm-auth-btn:disabled { opacity: .55; cursor: not-allowed; }

.fm-auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fm-auth-field label { font-size: 13px; font-weight: 650; color: #31453b; }
.fm-auth-field .req { color: #b4232a; margin-inline-start: 2px; }
.fm-auth-field input,
.fm-auth-field select,
.fm-auth-field textarea {
  min-height: 44px;
  border: 1px solid rgba(21, 32, 25, .14);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: #152019;
}
.fm-auth-field textarea { min-height: 88px; padding: 10px 12px; resize: vertical; }
.fm-auth-field input:focus,
.fm-auth-field select:focus,
.fm-auth-field textarea:focus {
  outline: 2px solid rgba(45, 106, 79, .35);
  border-color: #2d6a4f;
}
.fm-auth-field input.fm-invalid { border-color: #b4232a; }
.fm-auth-err { font-size: 12px; color: #b4232a; min-height: 16px; }
.fm-auth-hint { font-size: 12px; color: #6b7280; margin: 0 0 12px; }
.fm-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
}
.fm-auth-links a, .fm-auth-links button.fm-auth-link {
  background: none; border: 0; color: #2d6a4f; cursor: pointer;
  font: inherit; font-weight: 600; padding: 0; text-decoration: underline;
}
.fm-auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 12px 0 16px; color: #31453b; }
.fm-auth-check input { margin-top: 3px; width: 18px; height: 18px; }

.fm-auth-demo-badge {
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff8e8;
  border: 1px solid rgba(201, 184, 130, .55);
  color: #6a5414;
}

/* Applicant lightweight shell (post-account, pre-activation) */
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #sidebar,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #sb-resize,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #cal-dock {
  display: none !important;
}
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #main {
  margin-inline-start: 0 !important;
  width: 100% !important;
  background: #f7f8f7;
}
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #topbar,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) .topbar {
  background: #fff !important;
  border-bottom: 1px solid rgba(21, 32, 25, .08);
  box-shadow: none !important;
}
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #fma-applicant-shell-header,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #fma-applicant-status-block,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) [data-testid="fma-applicant-title"],
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) .fma-applicant-tagline,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) .tb-mode,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) .tb-role-badge,
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #tb-role-badge {
  display: none !important;
}
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #tb-title::after {
  content: none;
}
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #page-verification > *:not(#fm-ds-001c-wizard):not(.fm-ds-001c-keep) {
  display: none !important;
}

#fm-ds-001c-wizard {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
.fm-wiz-progress {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 8px;
}
.fm-wiz-bar {
  height: 4px;
  background: #e5ebe7;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}
.fm-wiz-bar > i {
  display: block;
  height: 100%;
  background: #2d6a4f;
  border-radius: 999px;
  transition: width .2s ease;
}
.fm-wiz-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
  margin: 0 0 6px;
  color: #152019;
}
.fm-wiz-purpose { font-size: 14px; color: #5c6b62; margin: 0 0 20px; line-height: 1.45; }
.fm-wiz-card {
  background: #fff;
  border: 1px solid rgba(21, 32, 25, .08);
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: 0 4px 20px rgba(15, 35, 24, .04);
}
.fm-wiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 20px;
  position: static;
  bottom: auto;
  padding: 12px 0;
  background: transparent;
}
.fm-wiz-actions .fm-auth-btn-primary { min-width: 160px; }
.fm-wiz-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .fm-wiz-grid-2 { grid-template-columns: 1fr; }
  .fm-auth-card { padding: 24px 18px; }
}
.fm-wiz-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f0;
  font-size: 14px;
}
.fm-wiz-chip {
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f7faf8;
}
.fm-wiz-chip.ok { background: #e5f4e9; border-color: #a7f3d0; color: #1c7a3c; }
.fm-wiz-chip.warn { background: #fff8e8; border-color: #fde68a; color: #9a6b10; }
.fm-auth-upload {
  border: 1.5px dashed rgba(45, 106, 79, .28);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  background: #faf8f3;
  margin-bottom: 12px;
}
.fm-auth-upload input[type="file"] { max-width: 100%; }
.fm-auth-trust { font-size: 12px; color: #5c6b62; line-height: 1.45; margin: 8px 0 0; }

html[dir="rtl"] #fm-ds-001c-root,
html[dir="rtl"] #fm-ds-001c-wizard { direction: rtl; }
html[dir="rtl"] .fm-wiz-actions { flex-direction: row-reverse; }

@media (prefers-reduced-motion: reduce) {
  .fm-wiz-bar > i { transition: none; }
}
