/**
 * FM-POLISH-006 — Floating Authentication Experience
 * No cream card. Content lives in the FM atmosphere.
 */

:root {
  --fm-p6-form-w: clamp(480px, 42vw, 520px);
  --fm-p6-ink: #F4F0E6;
  --fm-p6-muted: #C5CEC7;
  --fm-p6-soft: #9AA89F;
  --fm-p6-field: rgba(242, 236, 221, 0.94);
  --fm-p6-field-border: rgba(242, 236, 221, 0.28);
  --fm-p6-fikiria: #C5CBC7;
  --fm-p6-maisha: #4F9A66;
  --fm-p6-tag: #A8B5AD;
}

/* —— Atmosphere: deeper bloom, vignette, fog —— */
body.fm-polish-006-auth #auth-session-overlay.fm-ds-001c-overlay,
body.fma-applicant-auth-only.fm-polish-006-auth #auth-session-overlay {
  background-color: #0C221A !important;
  background-image:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(245, 241, 232, 0.16) 0%, transparent 58%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(30, 74, 56, 0.45) 0%, transparent 55%),
    linear-gradient(165deg, #0C221A 0%, #163528 32%, #2A4038 62%, #3A4540 100%),
    linear-gradient(28deg, rgba(69, 75, 72, 0.5) 0%, transparent 48%) !important;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.fm-polish-006-auth #auth-session-overlay.fm-ds-001c-overlay::before {
  background:
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 40%, rgba(8, 20, 16, 0.55) 100%),
    linear-gradient(180deg, rgba(8, 20, 16, 0.35) 0%, transparent 28%),
    linear-gradient(0deg, rgba(8, 20, 16, 0.4) 0%, transparent 26%) !important;
  opacity: 1;
}

body.fm-polish-006-auth #auth-session-overlay.fm-ds-001c-overlay::after {
  width: min(720px, 92vw) !important;
  height: min(560px, 70vh) !important;
  top: 44% !important;
  background: radial-gradient(
    ellipse at center,
    rgba(245, 241, 232, 0.22) 0%,
    rgba(127, 160, 140, 0.12) 38%,
    transparent 70%
  ) !important;
  filter: blur(40px) !important;
  opacity: 1 !important;
}

/* Soft atmospheric fog layer via root */
body.fm-polish-006-auth #fm-ds-001c-root.fm-polish-005-root::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 40% 30% at 20% 30%, rgba(131, 151, 141, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 35% 28% at 80% 70%, rgba(46, 107, 66, 0.1) 0%, transparent 70%);
}

body.fm-polish-006-auth #fm-ds-001c-root.fm-polish-005-root,
body.fm-polish-006-auth #fm-ds-001c-root.fm-ds-002-root {
  width: var(--fm-p6-form-w) !important;
  max-width: min(92vw, 520px) !important;
}

/* —— Kill the cream card completely —— */
body.fm-polish-006-auth .fm-auth-card,
body.fm-polish-006-auth .fm-auth-card.fm-auth-shell,
body.fm-polish-006-auth .fm-auth-card.fm-auth-float,
body.fm-polish-006-auth.fm-polish-005d-auth .fm-auth-card,
body.fm-polish-006-auth.fm-polish-005c-auth .fm-auth-card,
body.fm-polish-006-auth.fm-polish-005a-auth .fm-auth-card,
body.fm-polish-006-auth.fm-polish-005-auth .fm-auth-card {
  background: transparent !important;
  background-image: none !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
  padding: 0 !important;
  overflow: visible !important;
  max-height: none !important;
  width: 100%;
}

body.fm-polish-006-auth .fm-auth-card::before,
body.fm-polish-006-auth .fm-auth-card::after {
  display: none !important;
  content: none !important;
}

/* Centered content column */
body.fm-polish-006-auth .fm-auth-float,
body.fm-polish-006-auth .fm-auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

body.fm-polish-006-auth .fm-auth-brand,
body.fm-polish-006-auth .fm-auth-brand-compact {
  width: 100%;
  margin: 0;
}

body.fm-polish-006-auth .fm-auth-mark {
  margin: 0 0 24px !important;
}
body.fm-polish-006-auth .fm-auth-mark img,
body.fm-polish-006-auth .fm-auth-brand-compact .fm-auth-mark img,
body.fm-polish-006-auth .fm-auth-card[data-testid] .fm-auth-mark img,
body.fm-polish-006-auth.fm-polish-005d-auth .fm-auth-card[data-testid] .fm-auth-mark img,
body.fm-polish-006-auth.fm-polish-005f-auth .fm-auth-card[data-testid] .fm-auth-mark img {
  height: clamp(72px, 9vh, 88px) !important;
  max-height: 88px !important;
  filter: none !important;
}

body.fm-polish-006-auth .fm-auth-name {
  margin: 0 !important;
  font-size: clamp(30px, 2.4vw, 36px) !important;
}
body.fm-polish-006-auth .fm-auth-name .wm-f {
  color: var(--fm-p6-fikiria) !important;
}
body.fm-polish-006-auth .fm-auth-name .wm-m {
  color: var(--fm-p6-maisha) !important;
}

body.fm-polish-006-auth .fm-auth-tagline {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  color: var(--fm-p6-tag) !important;
  font-size: 15px !important;
}

/* Title / instruction */
body.fm-polish-006-auth .fm-auth-title,
body.fm-polish-006-auth .fm-wiz-title {
  margin-top: 40px !important;
  margin-bottom: 0 !important;
  color: var(--fm-p6-ink) !important;
  font-size: clamp(28px, 2.2vw, 34px) !important;
  text-align: center;
}

body.fm-polish-006-auth .fm-auth-purpose,
body.fm-polish-006-auth .fm-wiz-purpose {
  margin-top: 12px !important;
  margin-bottom: 0 !important;
  color: var(--fm-p6-muted) !important;
  font-size: 16px !important;
  max-width: none !important;
  white-space: normal;
}

body.fm-polish-006-auth .fm-auth-step-meta,
body.fm-polish-006-auth .fm-wiz-progress {
  margin-top: 40px !important;
  margin-bottom: 0 !important;
  color: var(--fm-p6-soft) !important;
  font-size: 12.5px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* When progress precedes the title, tighten title spacing */
body.fm-polish-006-auth .fm-auth-step-meta ~ .fm-auth-title,
body.fm-polish-006-auth .fm-wiz-bar + .fm-wiz-title {
  margin-top: 16px !important;
}

body.fm-polish-006-auth .fm-auth-step-bar,
body.fm-polish-006-auth .fm-wiz-bar {
  width: 100%;
  max-width: var(--fm-p6-form-w);
  height: 3px !important;
  margin: 10px 0 0 !important;
  background: rgba(245, 241, 232, 0.12) !important;
  border-radius: 999px;
  overflow: hidden;
}
body.fm-polish-006-auth .fm-auth-step-bar i,
body.fm-polish-006-auth .fm-wiz-bar i {
  background: linear-gradient(90deg, #2E6B42, #4F9A66) !important;
}

/* Form column */
body.fm-polish-006-auth .fm-auth-panel,
body.fm-polish-006-auth .fm-auth-card form,
body.fm-polish-006-auth .fm-auth-actions {
  width: 100%;
  max-width: var(--fm-p6-form-w);
}

body.fm-polish-006-auth .fm-auth-card form,
body.fm-polish-006-auth .fm-auth-actions {
  margin-top: 36px !important;
}

body.fm-polish-006-auth .fm-auth-field {
  text-align: start;
  margin-bottom: 14px !important;
}
body.fm-polish-006-auth .fm-auth-field label {
  color: var(--fm-p6-muted) !important;
  margin-bottom: 8px !important;
  font-size: 13.5px;
}
body.fm-polish-006-auth .fm-auth-field input,
body.fm-polish-006-auth .fm-auth-field select,
body.fm-polish-006-auth .fm-auth-field textarea {
  background: var(--fm-p6-field) !important;
  border: 1px solid var(--fm-p6-field-border) !important;
  color: #24302B !important;
  min-height: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  width: 100%;
  box-shadow: 0 8px 24px rgba(8, 20, 16, 0.18) !important;
}
body.fm-polish-006-auth .fm-auth-field textarea {
  height: auto !important;
  min-height: 80px !important;
}
body.fm-polish-006-auth .fm-auth-field input:focus,
body.fm-polish-006-auth .fm-auth-field select:focus,
body.fm-polish-006-auth .fm-auth-field textarea:focus {
  outline: 2px solid rgba(79, 154, 102, 0.65);
  outline-offset: 2px;
}

body.fm-polish-006-auth .fm-auth-check {
  color: var(--fm-p6-muted) !important;
  text-align: start;
}
body.fm-polish-006-auth .fm-auth-inline-row {
  color: var(--fm-p6-muted);
  margin: 4px 0 20px;
}
body.fm-polish-006-auth .fm-auth-link {
  color: #D4E0D8 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
body.fm-polish-006-auth .fm-auth-link:hover {
  color: #FFFDF7 !important;
}
body.fm-polish-006-auth .fm-auth-nav-line,
body.fm-polish-006-auth .fm-auth-back-link,
body.fm-polish-006-auth .fm-auth-hint {
  color: var(--fm-p6-muted) !important;
}
body.fm-polish-006-auth .fm-auth-nav-line {
  margin-top: 16px !important;
}
body.fm-polish-006-auth .fm-auth-err {
  color: #F0C4B8 !important;
  text-align: start;
}

/* Buttons — same width as fields */
body.fm-polish-006-auth .fm-auth-btn {
  width: 100% !important;
  max-width: var(--fm-p6-form-w);
  min-height: 50px !important;
  border-radius: 14px !important;
  margin-top: 8px;
}
body.fm-polish-006-auth .fm-auth-btn-primary {
  margin-top: 24px !important;
  background: linear-gradient(180deg, #315F47 0%, #244B39 100%) !important;
  border: 1px solid rgba(16, 46, 36, 0.55) !important;
  color: #FFFDF7 !important;
  box-shadow: 0 10px 28px rgba(8, 30, 22, 0.35) !important;
}
body.fm-polish-006-auth .fm-auth-btn-secondary {
  background: transparent !important;
  border: 1.5px solid rgba(212, 224, 216, 0.55) !important;
  color: #E8F0EA !important;
}
body.fm-polish-006-auth .fm-auth-btn-secondary:hover {
  background: rgba(237, 243, 238, 0.1) !important;
}
body.fm-polish-006-auth .fm-auth-actions {
  gap: 12px !important;
  margin-top: 36px !important;
}
body.fm-polish-006-auth .fm-auth-actions .fm-auth-btn-primary {
  margin-top: 0 !important;
}

/* Footer */
body.fm-polish-006-auth .fm-auth-legal-footer {
  margin-top: 24px !important;
  color: var(--fm-p6-soft) !important;
  font-size: 13.5px;
  width: 100%;
}
body.fm-polish-006-auth .fm-auth-legal-org,
body.fm-polish-006-auth .fm-auth-legal-loc {
  display: none !important;
}
body.fm-polish-006-auth .fm-auth-legal-links button {
  color: var(--fm-p6-soft) !important;
}

/* Watermark quieter */
body.fm-polish-006-auth .fm-polish-005-watermark {
  opacity: 0.03 !important;
}

/* —— Panel motion (form only) —— */
body.fm-polish-006-auth .fm-auth-panel {
  width: 100%;
  will-change: opacity, transform;
}
body.fm-polish-006-auth .fm-auth-panel.is-exit {
  animation: fmP6PanelExit 280ms ease forwards;
}
body.fm-polish-006-auth .fm-auth-panel.is-enter {
  animation: fmP6PanelEnter 320ms ease forwards;
}

@keyframes fmP6PanelExit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(12px); }
}
@keyframes fmP6PanelEnter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.fm-polish-006-auth .fm-auth-panel.is-exit,
  body.fm-polish-006-auth .fm-auth-panel.is-enter {
    animation: none !important;
  }
}

/* Wizard floating shell */
body.fm-polish-006-auth .fm-wiz-shell {
  max-width: var(--fm-p6-form-w);
  margin: 0 auto;
  padding: 24px 8px 40px;
  text-align: center;
}
body.fm-polish-006-auth .fm-wiz-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 36px;
  text-align: start;
  overflow: visible !important;
}
body.fm-polish-006-auth .fm-wiz-summary-row {
  color: var(--fm-p6-muted);
  border-color: rgba(245, 241, 232, 0.12);
}
body.fm-polish-006-auth .fm-wiz-actions {
  margin-top: 24px;
  width: 100%;
}
body.fm-polish-006-auth #page-verification,
body.fm-polish-006-auth #fm-ds-001c-wizard {
  background: transparent !important;
}

/* Desktop: no page scroll for Sign In / Welcome */
@media (min-width: 900px) and (min-height: 700px) {
  body.fm-polish-006-auth #auth-session-overlay.fm-ds-001c-overlay {
    overflow-y: hidden !important;
  }
}

@media (max-height: 820px) {
  body.fm-polish-006-auth .fm-auth-mark {
    margin-bottom: 16px !important;
  }
  body.fm-polish-006-auth .fm-auth-mark img {
    height: 60px !important;
  }
  body.fm-polish-006-auth .fm-auth-name {
    font-size: 28px !important;
  }
  body.fm-polish-006-auth .fm-auth-title {
    margin-top: 24px !important;
    font-size: 1.45rem !important;
  }
  body.fm-polish-006-auth .fm-auth-step-meta,
  body.fm-polish-006-auth .fm-wiz-progress {
    margin-top: 24px !important;
  }
  body.fm-polish-006-auth .fm-auth-card form,
  body.fm-polish-006-auth .fm-auth-actions {
    margin-top: 22px !important;
  }
  body.fm-polish-006-auth .fm-auth-field {
    margin-bottom: 10px !important;
  }
  body.fm-polish-006-auth .fm-auth-field input,
  body.fm-polish-006-auth .fm-auth-field select {
    min-height: 44px !important;
    padding: 10px 14px !important;
  }
  body.fm-polish-006-auth .fm-auth-btn {
    min-height: 46px !important;
  }
  body.fm-polish-006-auth .fm-auth-nav-line {
    margin-top: 12px !important;
  }
  body.fm-polish-006-auth .fm-auth-legal-footer {
    margin-top: 16px !important;
  }
}

@media (max-width: 640px) {
  body.fm-polish-006-auth #fm-ds-001c-root.fm-polish-005-root {
    width: calc(100% - 28px) !important;
    max-width: none !important;
  }
  body.fm-polish-006-auth #auth-session-overlay.fm-ds-001c-overlay {
    overflow-y: auto !important;
  }
}

html[dir="rtl"] body.fm-polish-006-auth .fm-auth-field,
html[dir="rtl"] body.fm-polish-006-auth .fm-auth-check {
  text-align: start;
}
