/**
 * FM-POLISH-005D — Welcome Brand Color & Breathing Room
 * Official split wordmark, calmer spacing, solid paper card.
 * No clipped corners. No transparency. No logo filters.
 */

:root {
  --fm-p5d-fikiria: #555A57;
  --fm-p5d-maisha: #2E6B42;
  --fm-p5d-tagline: #6F786F;
  --fm-p5d-paper: #F2ECDD;
  --fm-p5d-paper-deep: #EBE4D3;
  --fm-p5d-btn-top: #315F47;
  --fm-p5d-btn-bot: #244B39;
  --fm-p5d-cream-text: #FFFDF7;
}

/* Restore architectural paper — undo 005C mask cuts (beat compound 005C selectors) */
body.fm-polish-005d-auth.fm-polish-005c-auth .fm-auth-card,
body.fm-polish-005d-auth.fm-polish-005a-auth .fm-auth-card,
body.fm-polish-005d-auth.fm-polish-005-auth .fm-auth-card,
body.fm-polish-005d-auth .fm-auth-card {
  --fm-p5c-cut: 0px;
  border-radius: 22px !important;
  border: 1px solid rgba(53, 83, 67, 0.12) !important;
  border-color: rgba(53, 83, 67, 0.12) !important;
  background-color: #F2ECDD !important;
  background-image:
    linear-gradient(180deg, rgba(255, 253, 248, 0.35) 0%, transparent 28%),
    linear-gradient(180deg, #F2ECDD 0%, #EBE4D3 100%) !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  -webkit-mask-size: auto !important;
  mask-size: auto !important;
  -webkit-mask-position: 0 0 !important;
  mask-position: 0 0 !important;
  -webkit-mask-repeat: repeat !important;
  mask-repeat: repeat !important;
  filter: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(14, 35, 27, 0.04),
    0 12px 32px rgba(14, 35, 27, 0.10),
    0 28px 64px rgba(12, 30, 24, 0.12) !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
}

body.fm-polish-005d-auth .fm-auth-card::before {
  left: 18px !important;
  right: 18px !important;
  height: 1px !important;
  opacity: 0.5;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(127, 146, 136, 0.4) 20%,
    rgba(46, 107, 66, 0.45) 50%,
    rgba(85, 90, 87, 0.35) 80%,
    transparent
  ) !important;
}

/* Narrower root — preserve breathing room around card */
body.fm-polish-005d-auth #fm-ds-001c-root.fm-polish-005-root,
body.fm-polish-005d-auth #fm-ds-001c-root.fm-ds-002-root {
  width: clamp(470px, 40vw, 540px) !important;
  max-width: min(68vw, 540px) !important;
}

body.fm-polish-005d-auth #auth-session-overlay.fm-ds-001c-overlay {
  padding-top: clamp(32px, 7vh, 72px) !important;
  padding-bottom: clamp(24px, 5vh, 56px) !important;
  padding-left: clamp(32px, 4vw, 72px) !important;
  padding-right: clamp(32px, 4vw, 72px) !important;
}

/* Logo — true colors, no filters; space not scale */
body.fm-polish-005d-auth .fm-auth-mark,
body.fm-polish-005d-auth .fm-auth-mark img {
  filter: none !important;
  opacity: 1 !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
  background: transparent !important;
}
body.fm-polish-005d-auth .fm-auth-mark img {
  height: clamp(104px, 11vh, 118px) !important;
}

/* Official split wordmark */
body.fm-polish-005d-auth .fm-auth-name {
  font-size: clamp(34px, 2.6vw, 40px) !important;
  letter-spacing: -0.02em;
}
body.fm-polish-005d-auth .fm-auth-name .wm-f {
  color: var(--fm-p5d-fikiria) !important;
}
body.fm-polish-005d-auth .fm-auth-name .wm-m {
  color: var(--fm-p5d-maisha) !important;
}

body.fm-polish-005d-auth .fm-auth-tagline {
  color: var(--fm-p5d-tagline) !important;
  font-size: 14.5px !important;
  line-height: 1.5 !important;
  font-style: italic;
}

/* Welcome brand group breathing room */
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] {
  padding:
    clamp(32px, 4.2vh, 42px)
    clamp(28px, 3vw, 40px)
    clamp(22px, 3vh, 30px) !important;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-brand {
  padding-top: 0;
  gap: 0;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-mark {
  padding: 0 0 0 !important;
  margin: 0 0 clamp(20px, 2.4vh, 26px) !important;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-name {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-tagline {
  margin-top: clamp(10px, 1.4vh, 14px) !important;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-title {
  margin-top: clamp(38px, 4.8vh, 48px) !important;
  font-size: clamp(30px, 2.4vw, 36px) !important;
  font-weight: 700;
  color: #24302B;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-purpose {
  margin-top: clamp(18px, 2.2vh, 22px) !important;
  max-width: min(500px, 100%);
  font-size: clamp(17px, 1.2vw, 19px) !important;
  line-height: 1.55 !important;
  color: #5C6861;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-actions {
  margin-top: clamp(36px, 4.4vh, 46px) !important;
  gap: 12px !important;
}
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-legal-footer {
  margin-top: clamp(28px, 3.4vh, 36px) !important;
  font-size: 14.5px;
  color: #6F786F;
}

/* Buttons — clear but not dominating */
body.fm-polish-005d-auth .fm-auth-btn {
  min-height: 58px !important;
  padding: 14px 18px !important;
  border-radius: 17px !important;
  font-size: clamp(17px, 1.15vw, 19px) !important;
}
body.fm-polish-005d-auth .fm-auth-btn-primary {
  background: linear-gradient(180deg, var(--fm-p5d-btn-top) 0%, var(--fm-p5d-btn-bot) 100%) !important;
  border: 1px solid rgba(16, 46, 36, 0.55) !important;
  color: var(--fm-p5d-cream-text) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 16px rgba(22, 60, 44, 0.14) !important;
}
body.fm-polish-005d-auth .fm-auth-btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #36684e 0%, #1f4232 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(22, 60, 44, 0.18) !important;
}
body.fm-polish-005d-auth .fm-auth-btn-secondary {
  background: var(--fm-p5d-paper) !important;
  border: 1.5px solid var(--fm-p5d-maisha) !important;
  color: var(--fm-p5d-maisha) !important;
  min-height: 56px !important;
}
body.fm-polish-005d-auth .fm-auth-btn-secondary:hover {
  background: #EDF3EE !important;
}

body.fm-polish-005d-auth .fm-auth-btn:focus-visible {
  outline: 2px solid var(--fm-p5d-maisha);
  outline-offset: 3px;
}

/* Form cards — same solid paper, slightly tighter */
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-signin"] .fm-auth-mark img,
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-create"] .fm-auth-mark img,
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-forgot"] .fm-auth-mark img,
body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-reset"] .fm-auth-mark img {
  height: clamp(88px, 10vh, 104px) !important;
  filter: none !important;
}

/* Height-aware calm compression */
@media (max-height: 900px) {
  body.fm-polish-005d-auth .fm-auth-mark img {
    height: clamp(98px, 11vh, 110px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-mark {
    margin-bottom: clamp(16px, 2vh, 22px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-title {
    margin-top: clamp(32px, 4vh, 42px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-actions {
    margin-top: clamp(30px, 3.6vh, 40px) !important;
  }
  body.fm-polish-005d-auth #auth-session-overlay.fm-ds-001c-overlay {
    padding-top: clamp(24px, 4.5vh, 40px) !important;
    padding-bottom: clamp(20px, 3.5vh, 32px) !important;
  }
}

@media (max-height: 780px) {
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] {
    padding:
      clamp(22px, 3vh, 30px)
      clamp(22px, 2.6vw, 34px)
      clamp(16px, 2.2vh, 24px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-mark img {
    height: clamp(90px, 10.5vh, 104px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-title {
    margin-top: clamp(26px, 3.2vh, 36px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-actions {
    margin-top: clamp(26px, 3vh, 34px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-btn {
    min-height: 54px !important;
  }
}

@media (max-width: 900px) {
  body.fm-polish-005d-auth #fm-ds-001c-root.fm-polish-005-root {
    width: calc(100% - 64px) !important;
  }
  body.fm-polish-005d-auth .fm-auth-mark img {
    height: clamp(90px, 12vh, 104px) !important;
  }
  body.fm-polish-005d-auth #auth-session-overlay.fm-ds-001c-overlay {
    padding-left: 28px !important;
    padding-right: 28px !important;
  }
}

@media (max-width: 640px) {
  body.fm-polish-005d-auth #fm-ds-001c-root.fm-polish-005-root {
    width: calc(100% - 32px) !important;
  }
  body.fm-polish-005d-auth #auth-session-overlay.fm-ds-001c-overlay {
    padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)) !important;
  }
  body.fm-polish-005d-auth .fm-auth-mark img {
    height: clamp(78px, 14vh, 92px) !important;
  }
  body.fm-polish-005d-auth.fm-polish-005c-auth .fm-auth-card,
  body.fm-polish-005d-auth .fm-auth-card {
    border-radius: 18px !important;
  }
  body.fm-polish-005d-auth .fm-auth-btn {
    min-height: 54px !important;
    border-radius: 16px !important;
  }
  body.fm-polish-005d-auth .fm-auth-btn-secondary {
    min-height: 52px !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-mark {
    margin-bottom: 18px !important;
  }
  body.fm-polish-005d-auth .fm-auth-card[data-testid="fm-ds-001c-welcome"] .fm-auth-title {
    margin-top: 32px !important;
    font-size: 1.65rem !important;
  }
}
