/**
 * FM-DS-001D — Auth Experience Elevation
 * Official FikiriaMaisha identity over the DS-001C auth shell.
 *
 * Canvas: soft cream/sage #F6F9F5
 * Card: warm ivory #FCFCFA + forest accent line
 * Primary: forest green #1F4D36 (never bright green)
 */

:root {
  --fm-d-canvas: #F6F9F5;
  --fm-d-card: #FCFCFA;
  --fm-d-forest: #1F4D36;
  --fm-d-forest-hover: #183c2a;
  --fm-d-ink: #1a2a22;
  --fm-d-muted: #5d6b63;
  --fm-d-line: rgba(31, 77, 54, 0.14);
  --fm-d-word-f: #2a3d34;
  --fm-d-word-m: #1F4D36;
  --fm-d-cream: #f3f6f0;
}

body.fm-ds-001c-auth,
body.fm-ds-001d-auth {
  --fm-auth-primary: var(--fm-d-forest);
}

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 {
  background: var(--fm-d-canvas) !important;
  background-image:
    radial-gradient(ellipse 90% 55% at 8% -5%, rgba(255, 255, 252, .85), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 105%, rgba(31, 77, 54, .05), transparent 50%) !important;
  flex-direction: column;
  padding: 28px 20px 20px;
}

#fm-ds-001c-root {
  width: min(460px, 100%);
  color: var(--fm-d-ink);
}

.fm-auth-card {
  position: relative;
  background: var(--fm-d-card);
  border: 1px solid var(--fm-d-line);
  border-radius: 22px;
  padding: 36px 30px 30px;
  box-shadow:
    0 1px 2px rgba(26, 42, 34, .04),
    0 18px 48px rgba(26, 42, 34, .07);
  overflow: hidden;
}
.fm-auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--fm-d-forest) 20%, var(--fm-d-forest) 80%, transparent 100%);
}

.fm-auth-brand {
  gap: 8px;
  margin-bottom: 22px;
}
.fm-auth-mark {
  width: 64px;
  height: 64px;
  border-radius: 0;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-auth-mark img {
  width: 56px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  display: block;
}
.fm-auth-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.15;
}
.fm-auth-name .wm-f { color: var(--fm-d-word-f); }
.fm-auth-name .wm-m { color: var(--fm-d-word-m); }
.fm-auth-tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12.5px;
  color: var(--fm-d-muted);
  font-style: italic;
  letter-spacing: 0.01em;
}

.fm-auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  color: var(--fm-d-ink);
  margin: 0 0 10px;
}
.fm-auth-purpose {
  color: var(--fm-d-muted);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 34em;
  margin: 0 auto 26px;
}

.fm-auth-btn-primary {
  background: var(--fm-d-forest);
  color: #fff;
  border-color: var(--fm-d-forest);
  border-radius: 12px;
  letter-spacing: 0.01em;
}
.fm-auth-btn-primary:hover { background: var(--fm-d-forest-hover); }
.fm-auth-btn-secondary {
  background: #fff;
  color: var(--fm-d-forest);
  border: 1.5px solid var(--fm-d-forest);
  border-radius: 12px;
}
.fm-auth-btn-secondary:hover {
  background: var(--fm-d-cream);
}
.fm-auth-btn-tertiary,
.fm-auth-links a,
.fm-auth-links button.fm-auth-link {
  color: var(--fm-d-forest);
}

.fm-auth-field label { color: #31453b; }
.fm-auth-field input,
.fm-auth-field select,
.fm-auth-field textarea {
  border-color: rgba(31, 77, 54, .16);
  border-radius: 12px;
  background: #fff;
}
.fm-auth-field input:focus,
.fm-auth-field select:focus,
.fm-auth-field textarea:focus {
  outline-color: rgba(31, 77, 54, .35);
  border-color: var(--fm-d-forest);
}

.fm-auth-step-meta {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fm-d-muted);
  margin-bottom: 14px;
}
.fm-auth-step-bar {
  height: 3px;
  background: rgba(31, 77, 54, .1);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 20px;
  max-width: 220px;
}
.fm-auth-step-bar > i {
  display: block;
  height: 100%;
  background: var(--fm-d-forest);
  border-radius: 999px;
}

.fm-auth-legal-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 11.5px;
  color: var(--fm-d-muted);
  line-height: 1.55;
}
.fm-auth-legal-footer .fm-auth-legal-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.fm-auth-legal-footer a,
.fm-auth-legal-footer button {
  background: none;
  border: 0;
  color: var(--fm-d-forest);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.fm-auth-legal-footer a:hover,
.fm-auth-legal-footer button:hover { text-decoration: underline; }
.fm-auth-legal-sep { opacity: .45; }

/* Applicant wizard elevation */
body.fma-applicant-shell.fm-ds-001c-applicant:not(.fma-crm-ready) #main {
  background: var(--fm-d-canvas) !important;
}
#fm-ds-001c-wizard {
  max-width: 640px;
}
#fm-ds-001c-wizard .fm-wiz-card {
  position: relative;
  background: var(--fm-d-card);
  border: 1px solid var(--fm-d-line);
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(26, 42, 34, .06);
  overflow: hidden;
}
#fm-ds-001c-wizard .fm-wiz-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--fm-d-forest) 25%, var(--fm-d-forest) 75%, transparent);
}
#fm-ds-001c-wizard .fm-wiz-title {
  color: var(--fm-d-ink);
}
#fm-ds-001c-wizard .fm-wiz-purpose { color: var(--fm-d-muted); }
#fm-ds-001c-wizard .fm-wiz-bar > i { background: var(--fm-d-forest); }
#fm-ds-001c-wizard .fm-auth-btn-primary { background: var(--fm-d-forest); }
#fm-ds-001c-wizard .fm-auth-btn-secondary {
  color: var(--fm-d-forest);
  border-color: var(--fm-d-forest);
}

.fm-auth-demo-badge {
  background: #f7f3e7;
  border-color: rgba(160, 140, 80, .45);
  color: #6a5414;
}

@media (max-width: 640px) {
  .fm-auth-card { padding: 28px 20px 24px; border-radius: 18px; }
  .fm-auth-title { font-size: 1.35rem; }
  .fm-auth-name { font-size: 1.35rem; }
}

html[dir="rtl"] .fm-auth-legal-links { flex-direction: row-reverse; }
html[dir="rtl"] .fm-auth-name { direction: ltr; unicode-bidi: isolate; }

@media (prefers-reduced-motion: reduce) {
  .fm-auth-step-bar > i,
  #fm-ds-001c-wizard .fm-wiz-bar > i { transition: none; }
}
