/**
 * FM-DS-001C-2 — Auth Welcome green–grey brand composition
 * Layered forest / graphite canvas + official transparent FM mark.
 */

:root {
  --fm-c2-deep: #102E24;
  --fm-c2-green: #1E4A38;
  --fm-c2-sage: #8FA59A;
  --fm-c2-graphite: #4B514E;
  --fm-c2-soft: #DDE2DE;
  --fm-c2-cream: #F5F1E8;
  --fm-c2-card: rgba(248, 247, 242, 0.96);
  --fm-c2-border: rgba(52, 93, 71, 0.28);
  --fm-c2-btn: #214F3B;
  --fm-c2-btn-hover: #183D2E;
  --fm-c2-btn-active: #102E24;
  --fm-c2-ink: #2a322f;
  --fm-c2-muted: #5a665f;
  --fm-c2-word-f: #4B514E;
  --fm-c2-word-m: #1E4A38;
}

body.fm-ds-001c-auth,
body.fm-ds-001d-auth,
body.fm-ds-001c2-auth {
  --fm-auth-primary: var(--fm-c2-btn);
}

/* Layered green–grey canvas (FMA chat-inspired depth) */
body.fma-applicant-auth-only.fm-ds-001c-auth #auth-session-overlay,
body.fm-ds-001c-auth #auth-session-overlay.fm-ds-001c-overlay,
body.fm-ds-001d-auth #auth-session-overlay.fm-ds-001c-overlay,
body.fm-ds-001c2-auth #auth-session-overlay.fm-ds-001c-overlay {
  background-color: var(--fm-c2-deep) !important;
  background-image:
    radial-gradient(ellipse 95% 70% at 50% 42%, rgba(245, 241, 232, 0.92) 0%, rgba(221, 226, 222, 0.55) 34%, rgba(143, 165, 154, 0.28) 52%, transparent 72%),
    radial-gradient(ellipse 80% 55% at 0% 0%, rgba(30, 74, 56, 0.85) 0%, transparent 55%),
    radial-gradient(ellipse 75% 50% at 100% 100%, rgba(75, 81, 78, 0.75) 0%, transparent 55%),
    linear-gradient(165deg, var(--fm-c2-deep) 0%, var(--fm-c2-green) 38%, #3a4741 68%, var(--fm-c2-graphite) 100%) !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 24px;
}

#fm-ds-001c-root {
  width: min(620px, 100%);
  color: var(--fm-c2-ink);
}

.fm-auth-card {
  position: relative;
  background: var(--fm-c2-card);
  border: 1px solid var(--fm-c2-border);
  border-radius: 22px;
  padding: 32px 34px 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 24px 70px rgba(18, 40, 31, 0.18);
  overflow: hidden;
}
.fm-auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--fm-c2-sage) 18%, var(--fm-c2-green) 50%, var(--fm-c2-graphite) 82%, transparent 100%);
}

/* Official transparent FM mark — no box */
.fm-auth-brand {
  gap: 10px;
  margin-bottom: 14px;
}
.fm-auth-mark {
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-auth-mark img {
  width: auto;
  max-height: none;
  height: clamp(112px, 16vw, 140px);
  max-width: min(180px, 48vw);
  object-fit: contain;
  display: block;
  background: transparent !important;
}
.fm-auth-mark-fallback {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--fm-c2-green);
  letter-spacing: -0.02em;
}

.fm-auth-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 0;
  line-height: 1.1;
}
.fm-auth-name .wm-f { color: var(--fm-c2-word-f); }
.fm-auth-name .wm-m { color: var(--fm-c2-word-m); }

.fm-auth-tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: var(--fm-c2-muted);
  margin: 2px 0 0;
}

.fm-auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  color: var(--fm-c2-ink);
  margin: 10px 0 8px;
}
.fm-auth-purpose {
  color: var(--fm-c2-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 auto 20px;
  max-width: 34em;
}

/* Welcome: no onboarding progress */
.fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-step-meta,
.fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-step-bar {
  display: none !important;
}

.fm-auth-btn-primary {
  background: var(--fm-c2-btn);
  border-color: var(--fm-c2-btn);
  color: #f8f7f2;
  border-radius: 12px;
}
.fm-auth-btn-primary:hover { background: var(--fm-c2-btn-hover); border-color: var(--fm-c2-btn-hover); }
.fm-auth-btn-primary:active { background: var(--fm-c2-btn-active); border-color: var(--fm-c2-btn-active); }
.fm-auth-btn-primary:focus-visible {
  outline: 2px solid #f5f1e8;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(33, 79, 59, 0.45);
}

.fm-auth-btn-secondary {
  background: rgba(245, 241, 232, 0.92);
  color: var(--fm-c2-green);
  border: 1.5px solid var(--fm-c2-green);
  border-radius: 12px;
}
.fm-auth-btn-secondary:hover {
  background: rgba(143, 165, 154, 0.22);
}
.fm-auth-btn-secondary:focus-visible {
  outline: 2px solid var(--fm-c2-green);
  outline-offset: 2px;
}

.fm-auth-btn-tertiary,
.fm-auth-links a,
.fm-auth-links button.fm-auth-link {
  color: var(--fm-c2-green);
}

.fm-auth-field label { color: #3a4640; }
.fm-auth-field input,
.fm-auth-field select,
.fm-auth-field textarea {
  border-color: rgba(52, 93, 71, 0.28);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
}
.fm-auth-field input:focus,
.fm-auth-field select:focus,
.fm-auth-field textarea:focus {
  border-color: var(--fm-c2-green);
  outline: 2px solid rgba(30, 74, 56, 0.28);
}

.fm-auth-legal-footer {
  color: var(--fm-c2-muted);
  margin-top: 18px;
}
.fm-auth-legal-footer a,
.fm-auth-legal-footer button {
  color: #5f7268;
  font-weight: 550;
}
.fm-auth-legal-footer a:hover,
.fm-auth-legal-footer button:hover {
  color: var(--fm-c2-green);
}

.fm-auth-step-meta { color: var(--fm-c2-muted); }
.fm-auth-step-bar { background: rgba(75, 81, 78, 0.14); }
.fm-auth-step-bar > i { background: var(--fm-c2-green); }

/* Applicant wizard shares canvas family */
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #main {
  background-color: var(--fm-c2-deep) !important;
  background-image:
    radial-gradient(ellipse 90% 65% at 50% 30%, rgba(245, 241, 232, 0.88) 0%, rgba(221, 226, 222, 0.45) 40%, transparent 70%),
    linear-gradient(165deg, var(--fm-c2-deep), var(--fm-c2-green) 45%, #3a4741 100%) !important;
}
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: rgba(248, 247, 242, 0.94) !important;
  border-bottom-color: var(--fm-c2-border) !important;
}
#fm-ds-001c-wizard .fm-wiz-card {
  background: var(--fm-c2-card);
  border: 1px solid var(--fm-c2-border);
  box-shadow: 0 24px 70px rgba(18, 40, 31, 0.16);
}
#fm-ds-001c-wizard .fm-wiz-card::before {
  background: linear-gradient(90deg, transparent, var(--fm-c2-sage) 25%, var(--fm-c2-green) 50%, var(--fm-c2-graphite) 75%, transparent);
}
#fm-ds-001c-wizard .fm-wiz-title,
#fm-ds-001c-wizard .fm-auth-name { color: var(--fm-c2-ink); }
#fm-ds-001c-wizard .fm-wiz-purpose { color: var(--fm-c2-muted); }
#fm-ds-001c-wizard .fm-wiz-progress { color: rgba(245, 241, 232, 0.82); }
#fm-ds-001c-wizard .fm-wiz-bar { background: rgba(245, 241, 232, 0.22); }
#fm-ds-001c-wizard .fm-wiz-bar > i { background: var(--fm-c2-cream); }
#fm-ds-001c-wizard .fm-auth-btn-primary {
  background: var(--fm-c2-btn);
  border-color: var(--fm-c2-btn);
  color: #f8f7f2;
}
#fm-ds-001c-wizard .fm-auth-btn-secondary {
  background: rgba(245, 241, 232, 0.92);
  color: var(--fm-c2-green);
  border-color: var(--fm-c2-green);
}
#fm-ds-001c-wizard .fm-auth-legal-footer { color: rgba(245, 241, 232, 0.78); }
#fm-ds-001c-wizard .fm-auth-legal-footer a,
#fm-ds-001c-wizard .fm-auth-legal-footer button { color: rgba(245, 241, 232, 0.88); }

@media (max-width: 834px) {
  body.fm-ds-001c-auth #auth-session-overlay.fm-ds-001c-overlay {
    padding: 20px 14px;
  }
  #fm-ds-001c-root { width: min(560px, 100%); }
}

@media (max-width: 640px) {
  .fm-auth-card {
    padding: 24px 18px 20px;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(18, 40, 31, 0.14);
  }
  .fm-auth-mark img {
    height: clamp(88px, 24vw, 108px);
  }
  .fm-auth-name { font-size: 1.4rem; }
  .fm-auth-title { font-size: 1.35rem; margin-top: 8px; }
  .fm-auth-purpose { margin-bottom: 16px; }
  .fm-auth-actions .fm-auth-btn { width: 100%; }
}

html[dir="rtl"] .fm-auth-name { direction: ltr; unicode-bidi: isolate; }

@media (prefers-reduced-motion: reduce) {
  .fm-auth-btn-primary,
  .fm-auth-btn-secondary { transition: none; }
}
