/**
 * FM-POLISH-006C — Typography rhythm & spacing (legal readers only)
 * Spacing / line-height / readable width only.
 * No color, logo, copy, routing, or control changes.
 */

body.fm-polish-006c-auth {
  --fm-p6c-read-w: 700px;
  --fm-p6c-section-gap: 52px;
}

/* Widen auth root only while a legal reader is open */
body.fm-polish-006c-auth #fm-ds-001c-root:has([data-testid^="fm-ds-001c-legal-"]),
body.fm-polish-006c-auth #fm-ds-001c-root.fm-polish-005-root:has([data-testid^="fm-ds-001c-legal-"]),
body.fm-polish-006c-auth #fm-ds-001c-root.fm-polish-006-root:has([data-testid^="fm-ds-001c-legal-"]) {
  width: min(92vw, var(--fm-p6c-read-w)) !important;
  max-width: min(92vw, var(--fm-p6c-read-w)) !important;
}

/* Scope: Privacy / Terms / Support shells only */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] {
  width: 100%;
  max-width: min(92vw, var(--fm-p6c-read-w));
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-panel {
  width: 100% !important;
  max-width: min(92vw, var(--fm-p6c-read-w)) !important;
}

/* —— Brand stack —— */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-mark {
  margin: 0 0 28px !important;
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-name {
  margin: 0 !important;
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-tagline {
  margin-top: 18px !important;
  margin-bottom: 0 !important;
}

/* —— Title area —— */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-title {
  /* Title area: tagline → title ~52–56px */
  margin-top: 56px !important;
  margin-bottom: 0 !important;
  line-height: 1.25 !important;
  max-width: var(--fm-p6c-read-w);
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-purpose {
  /* Title area: title → intro ~24–26px */
  margin-top: 24px !important;
  margin-bottom: 0 !important;
  max-width: var(--fm-p6c-read-w) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  line-height: 1.75 !important;
}

/* Edition label (Terms / Privacy) */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-purpose + .fm-auth-hint {
  margin-top: 28px !important;
  margin-bottom: 0 !important;
  line-height: 1.4 !important;
}

/* —— Legal body column —— */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-body {
  width: 100%;
  max-width: var(--fm-p6c-read-w);
  margin-top: 64px !important;
  margin-left: auto;
  margin-right: auto;
  max-height: none;
  overflow: visible;
  text-align: start;
  padding-inline-end: 0;
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-section {
  margin: 0 0 var(--fm-p6c-section-gap);
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-section:last-child {
  margin-bottom: 0;
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-section h2 {
  margin: 0 0 18px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  line-height: 1.25 !important;
}

body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-section p {
  margin: 0 !important;
  line-height: 1.75 !important;
}

/* Multi-paragraph sections: breathe between paragraphs without stacking into the next heading */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-section p + p {
  margin-top: 36px !important;
}

/* —— Back as navigation, not content —— */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-back-link {
  margin-top: 72px !important;
  margin-bottom: 0 !important;
}

/* —— Footer separation —— */
body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-footer {
  margin-top: 40px !important;
}

/* —— Support: same title / lead rhythm; topic list breathes —— */
body.fm-polish-006c-auth [data-testid="fm-ds-001c-legal-support"] .fm-auth-support-topics {
  max-width: var(--fm-p6c-read-w);
  margin-top: 64px !important;
  margin-left: auto;
  margin-right: auto;
  gap: 14px;
}

body.fm-polish-006c-auth [data-testid="fm-ds-001c-legal-support"] .fm-auth-support-detail {
  max-width: var(--fm-p6c-read-w);
  margin-left: auto;
  margin-right: auto;
  margin-top: 28px !important;
  line-height: 1.75 !important;
}

body.fm-polish-006c-auth [data-testid="fm-ds-001c-legal-support"] .fm-auth-support-detail p {
  margin: 0 0 18px;
  line-height: 1.75;
}

body.fm-polish-006c-auth [data-testid="fm-ds-001c-legal-support"] .fm-auth-support-detail p:last-child {
  margin-bottom: 0;
}

body.fm-polish-006c-auth [data-testid="fm-ds-001c-legal-support"] .fm-auth-support-mail-secondary {
  margin-top: 36px !important;
  max-width: var(--fm-p6c-read-w);
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4 !important;
}

@media (max-width: 640px) {
  body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-title {
    margin-top: 48px !important;
  }

  body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-legal-body {
    margin-top: 48px !important;
  }

  body.fm-polish-006c-auth [data-testid^="fm-ds-001c-legal-"] .fm-auth-back-link {
    margin-top: 56px !important;
  }
}
