/* True Dashboard config modal polish — production-base visual standard
   Patch-only CSS for new.afximport.com. Do not use the discarded zero-front as base.
   Scope: Configurações content area only. Do not blur top header or left sidebar. */

.settings-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 39 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: calc(64px + 28px) 28px 28px calc(72px + 28px) !important;
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.10), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(59, 130, 246, 0.12), transparent 36%),
    rgba(2, 6, 23, 0.78) !important;
  -webkit-backdrop-filter: blur(34px) saturate(0.95) brightness(0.58) !important;
  backdrop-filter: blur(34px) saturate(0.95) brightness(0.58) !important;
}

@media (max-width: 767px) {
  .settings-modal-overlay {
    padding: calc(64px + 18px) 18px 18px 18px !important;
  }
}

.settings-modal-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.28)),
    rgba(2, 6, 23, 0.16);
  box-shadow: inset 0 0 120px rgba(2, 6, 23, 0.38);
}

.settings-modal-panel {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    rgba(30, 41, 59, 0.78) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.18) !important;
  backdrop-filter: blur(30px) saturate(1.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 22px 56px rgba(2, 6, 23, 0.44),
    0 0 0 1px rgba(34, 211, 238, 0.055) !important;
}

.settings-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035) 46%, transparent 74%);
  opacity: 0.72;
}

.settings-modal-panel > * {
  position: relative;
  z-index: 1;
}

.settings-picker-card {
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.065) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.12) !important;
  backdrop-filter: blur(18px) saturate(1.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11) !important;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
}

.settings-picker-card:hover,
.settings-picker-card:focus-visible {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.095) !important;
  border-color: rgba(34, 211, 238, 0.24) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 18px rgba(34, 211, 238, 0.10) !important;
  transform: translateY(-1px) !important;
}

.settings-modal-panel button,
.settings-picker-card button {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease !important;
}

.settings-modal-panel button:hover,
.settings-modal-panel button:focus-visible {
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.14), 0 0 16px rgba(34, 211, 238, 0.09) !important;
}

html:not(.dark) .settings-modal-overlay {
  background:
    radial-gradient(circle at 18% 12%, rgba(14, 165, 233, 0.10), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(59, 130, 246, 0.10), transparent 36%),
    rgba(15, 23, 42, 0.26) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.02) brightness(0.88) !important;
  backdrop-filter: blur(26px) saturate(1.02) brightness(0.88) !important;
}

html:not(.dark) .settings-modal-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.72)),
    rgba(255, 255, 255, 0.80) !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
  color: rgb(15, 23, 42) !important;
}

html:not(.dark) .settings-picker-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.80), rgba(248, 250, 252, 0.64)),
    rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}

/* 20260611-1649: removed main::before reinforcement; it could hide content when modal helper remains mounted. Overlay itself handles blur under header/sidebar. */

/* 20260611-1648: keep modal content above blur/dim layers. */
.settings-modal-overlay::before {
  z-index: 0 !important;
}

.settings-modal-panel {
  z-index: 2 !important;
  isolation: isolate !important;
}

.settings-modal-overlay > *:not(.settings-modal-panel) {
  position: relative;
  z-index: 1;
}


/* 20260611-1652: remove visible unblurred seams at viewport/content edges while keeping header/sidebar above overlay. */
.settings-modal-overlay {
  inset: -10px !important;
  padding: calc(64px + 38px) 38px 38px calc(72px + 38px) !important;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.80), rgba(2, 6, 23, 0.84)),
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.08), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(59, 130, 246, 0.10), transparent 36%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(0.90) brightness(0.52) !important;
  backdrop-filter: blur(40px) saturate(0.90) brightness(0.52) !important;
  box-shadow: inset 0 0 0 9999px rgba(2, 6, 23, 0.10) !important;
}

.settings-modal-overlay::before {
  inset: -12px !important;
  background: rgba(2, 6, 23, 0.18) !important;
  box-shadow: inset 0 0 160px rgba(2, 6, 23, 0.46) !important;
}

@media (max-width: 767px) {
  .settings-modal-overlay {
    padding: calc(64px + 28px) 28px 28px 28px !important;
  }
}

/* 20260611-1657: final modal coverage — overlay covers full viewport to avoid unblurred edge seams; app bars are lifted above it. */
body:has(.settings-modal-overlay) aside.fixed.left-0.top-0,
body:has(.settings-modal-overlay) header.sticky.top-0 {
  position: fixed !important;
  z-index: 80 !important;
}

body:has(.settings-modal-overlay) header.sticky.top-0 {
  left: 72px !important;
  right: 0 !important;
  width: auto !important;
}

.settings-modal-overlay {
  inset: 0 !important;
  z-index: 60 !important;
  padding: calc(64px + 28px) 28px 28px calc(72px + 28px) !important;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.91)),
    radial-gradient(circle at 50% 34%, rgba(8, 47, 73, 0.22), transparent 42%),
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.06), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(59, 130, 246, 0.08), transparent 36%) !important;
  -webkit-backdrop-filter: blur(58px) saturate(0.82) brightness(0.36) !important;
  backdrop-filter: blur(58px) saturate(0.82) brightness(0.36) !important;
  box-shadow: inset 0 0 0 9999px rgba(2, 6, 23, 0.18) !important;
}

.settings-modal-overlay::before {
  inset: 0 !important;
  background: rgba(2, 6, 23, 0.26) !important;
  box-shadow: inset 0 0 220px rgba(2, 6, 23, 0.68) !important;
}

@media (max-width: 767px) {
  body:has(.settings-modal-overlay) header.sticky.top-0 {
    left: 0 !important;
  }
  .settings-modal-overlay {
    padding: calc(64px + 20px) 20px 20px 20px !important;
  }
}

/* 20260611-1730: stronger content suppression behind settings modal. Header/sidebar stay above via z-index rules. */
.settings-modal-overlay {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.96)),
    radial-gradient(circle at 50% 38%, rgba(8, 47, 73, 0.18), transparent 40%) !important;
  -webkit-backdrop-filter: blur(82px) saturate(0.62) brightness(0.22) !important;
  backdrop-filter: blur(82px) saturate(0.62) brightness(0.22) !important;
  box-shadow: inset 0 0 0 9999px rgba(2, 6, 23, 0.28) !important;
}
.settings-modal-overlay::before {
  background: rgba(2, 6, 23, 0.38) !important;
  box-shadow: inset 0 0 260px rgba(2, 6, 23, 0.84) !important;
}
.settings-modal-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(30, 41, 59, 0.88) !important;
}

/* 20260611-1736: active modal classes in the current production-base build.
   Blur/dim the content area only; keep top header and left sidebar visually outside the modal blur. */
.glass-modal-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.84), rgba(2, 6, 23, 0.88)),
    radial-gradient(circle at 50% 36%, rgba(8, 47, 73, 0.18), transparent 42%) !important;
  -webkit-backdrop-filter: blur(58px) saturate(0.78) brightness(0.36) !important;
  backdrop-filter: blur(58px) saturate(0.78) brightness(0.36) !important;
  clip-path: polygon(72px 64px, 100% 64px, 100% 100%, 72px 100%) !important;
}

@media (max-width: 767px) {
  .glass-modal-overlay {
    clip-path: polygon(0 64px, 100% 64px, 100% 100%, 0 100%) !important;
  }
}

.glass-integration-modal {
  z-index: 2 !important;
  isolation: isolate !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05)),
    rgba(30, 41, 59, 0.86) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.14) !important;
  backdrop-filter: blur(30px) saturate(1.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 64px rgba(2, 6, 23, 0.48),
    0 0 0 1px rgba(34, 211, 238, 0.06) !important;
}

.integration-choice-card {
  border-radius: 24px !important;
  border-color: rgba(255,255,255,.10) !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.04)),
    rgba(255,255,255,.065) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.10) !important;
  backdrop-filter: blur(18px) saturate(1.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10) !important;
}

.integration-choice-card:hover,
.integration-choice-card:focus-visible {
  border-color: rgba(34,211,238,.26) !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.055)),
    rgba(255,255,255,.09) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 18px rgba(34,211,238,.10) !important;
}

/* 20260611-1742: blur the actual Configurações page content, not just backdrop-filter.
   Header/sidebar stay outside because they are not children of .settings-page and are lifted above overlay. */
body:has(.settings-modal-overlay) .settings-page > :not(.settings-modal-overlay) {
  filter: blur(12px) saturate(0.62) brightness(0.26) !important;
  transform: translateZ(0) !important;
  transition: filter 160ms ease !important;
  pointer-events: none !important;
}

body:has(.settings-modal-overlay) .settings-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 60 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: calc(64px + 24px) 24px 24px calc(72px + 24px) !important;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.84)),
    radial-gradient(circle at 50% 36%, rgba(8, 47, 73, 0.20), transparent 42%) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: inset 0 0 0 9999px rgba(2, 6, 23, 0.24) !important;
}

body:has(.settings-modal-overlay) aside.fixed.left-0.top-0,
body:has(.settings-modal-overlay) header.sticky.top-0 {
  position: fixed !important;
  z-index: 80 !important;
  filter: none !important;
}

body:has(.settings-modal-overlay) header.sticky.top-0 {
  left: 72px !important;
  right: 0 !important;
  width: auto !important;
}

body:has(.settings-modal-overlay) .settings-modal-panel {
  z-index: 90 !important;
  filter: none !important;
  isolation: isolate !important;
}

@media (max-width: 767px) {
  body:has(.settings-modal-overlay) .settings-modal-overlay {
    padding: calc(64px + 20px) 20px 20px 20px !important;
  }
  body:has(.settings-modal-overlay) header.sticky.top-0 {
    left: 0 !important;
  }
}


/* 20260611-1758: requested approach — remove direct blur/filter from selected page content; keep only full modal backdrop blur/dim. Header/sidebar stay above overlay. */
body:has(.settings-modal-overlay) .settings-page > :not(.settings-modal-overlay) {
  filter: none !important;
  transform: none !important;
  transition: none !important;
  pointer-events: auto !important;
}

body:has(.settings-modal-overlay) .settings-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 60 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: calc(64px + 24px) 24px 24px calc(72px + 24px) !important;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.88)),
    radial-gradient(circle at 50% 36%, rgba(8, 47, 73, 0.18), transparent 42%) !important;
  -webkit-backdrop-filter: blur(64px) saturate(0.70) brightness(0.34) !important;
  backdrop-filter: blur(64px) saturate(0.70) brightness(0.34) !important;
  box-shadow: inset 0 0 0 9999px rgba(2, 6, 23, 0.22) !important;
}

body:has(.settings-modal-overlay) .settings-modal-panel {
  z-index: 90 !important;
  filter: none !important;
  isolation: isolate !important;
}


/* 20260611-1806: keep the working blur, remove the darkening layer requested by Fabio. */
body:has(.settings-modal-overlay) .settings-page > :not(.settings-modal-overlay) {
  filter: blur(12px) saturate(1) brightness(1) !important;
  transform: translateZ(0) !important;
  transition: filter 160ms ease !important;
  pointer-events: none !important;
}

body:has(.settings-modal-overlay) .settings-modal-overlay {
  background:
    radial-gradient(circle at 50% 36%, rgba(14, 165, 233, 0.08), transparent 42%),
    rgba(2, 6, 23, 0.04) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

body:has(.settings-modal-overlay) .settings-modal-overlay::before {
  background: transparent !important;
  box-shadow: none !important;
}

body:has(.settings-modal-overlay) aside.fixed.left-0.top-0,
body:has(.settings-modal-overlay) header.sticky.top-0 {
  filter: none !important;
}

body:has(.settings-modal-overlay) .settings-modal-panel,
body:has(.settings-modal-overlay) .glass-integration-modal {
  filter: none !important;
}

/* 20260611-1822: expand the modal darkening/backdrop square beyond its transformed/main container.
   The modal overlay is mounted inside the app content, so a normal fixed/inset:0 can stop at the
   content box. Expanding with viewport-sized dimensions removes the unblurred/dimless borders. */
body:has(.settings-modal-overlay) .settings-modal-overlay {
  position: fixed !important;
  top: -160px !important;
  left: -160px !important;
  right: auto !important;
  bottom: auto !important;
  width: calc(100vw + 320px) !important;
  height: calc(100vh + 320px) !important;
  min-width: calc(100vw + 320px) !important;
  min-height: calc(100vh + 320px) !important;
  padding: calc(160px + 64px + 28px) 28px 28px calc(160px + 72px + 28px) !important;
  z-index: 60 !important;
  overflow: hidden !important;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.68)),
    radial-gradient(circle at 50% 36%, rgba(8, 47, 73, 0.14), transparent 44%) !important;
  -webkit-backdrop-filter: blur(44px) saturate(0.86) !important;
  backdrop-filter: blur(44px) saturate(0.86) !important;
  box-shadow: inset 0 0 0 9999px rgba(2, 6, 23, 0.10) !important;
}

body:has(.settings-modal-overlay) .settings-modal-overlay::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(2, 6, 23, 0.10) !important;
  pointer-events: none !important;
}

body:has(.settings-modal-overlay) .settings-modal-panel {
  position: relative !important;
  z-index: 2 !important;
}


/* 20260611-1827: keep the expanded overlay square for edge coverage, but center the modal in the viewport. */
body:has(.settings-modal-overlay) .settings-modal-overlay {
  top: -160px !important;
  left: -160px !important;
  right: auto !important;
  bottom: auto !important;
  width: calc(100vw + 320px) !important;
  height: calc(100vh + 320px) !important;
  min-width: calc(100vw + 320px) !important;
  min-height: calc(100vh + 320px) !important;
  padding: 160px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

body:has(.settings-modal-overlay) .settings-modal-panel,
body:has(.settings-modal-overlay) .glass-integration-modal {
  position: relative !important;
  z-index: 100 !important;
  margin: 0 auto !important;
}

@media (max-width: 767px) {
  body:has(.settings-modal-overlay) .settings-modal-overlay {
    top: -80px !important;
    left: -80px !important;
    width: calc(100vw + 160px) !important;
    height: calc(100vh + 160px) !important;
    min-width: calc(100vw + 160px) !important;
    min-height: calc(100vh + 160px) !important;
    padding: calc(80px + 16px) 96px 96px 96px !important;
  }
}
