/*
 * Intixus ecosystem promo — scoped to #ix-ecosystem-popup and body.popup-open
 * Production layout: flat surfaces, no 3D / glow; brand purple on actions only.
 */

body.popup-open {
  overflow: hidden;
}

body.popup-open header,
body.popup-open nav {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ix-eco-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#ix-ecosystem-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  isolation: isolate;
  /* No backdrop blur — cheaper compositing */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  --ix-brand-deep: #5b22b5;
  --ix-brand-600: #6c2bd9;
  --ix-brand-500: #7a39e8;
  --ix-brand-400: #8b5cf6;
  --ix-brand-300: #c4b5fd;
  --ix-close: #dc2626;
  --ix-close-hover: #b91c1c;
  --ix-text: #111827;
  --ix-muted: #4b5563;
  --ix-border: #e5e7eb;
  --ix-surface: #ffffff;
  --ix-surface-subtle: #f9fafb;
}

#ix-ecosystem-popup.ix-eco-hidden {
  display: none !important;
}

#ix-ecosystem-popup[aria-hidden="true"] {
  pointer-events: none;
}

#ix-ecosystem-popup:not(.ix-eco-hidden) .ix-eco-backdrop {
  animation: ix-eco-fade-in 220ms ease forwards;
}

#ix-ecosystem-popup:not(.ix-eco-hidden) .ix-eco-modal {
  animation: ix-eco-enter 240ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ix-eco-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ix-eco-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ix-eco-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 10, 30, 0.45);
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 0;
}

/* Shell: neutral card; purple only in chips and CTAs */
.ix-eco-modal {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(620px, 92vh);
  border-radius: 16px;
  overflow: hidden;
  background: var(--ix-surface);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(91, 34, 181, 0.06);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ix-eco-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(127, 29, 29, 0.45);
  background: var(--ix-close);
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ix-eco-close:hover {
  background: var(--ix-close-hover);
  border-color: rgba(127, 29, 29, 0.65);
  color: #ffffff;
}

.ix-eco-close:active {
  background: #991b1b;
}

.ix-eco-close:focus-visible {
  outline: 2px solid var(--ix-brand-600);
  outline-offset: 2px;
}

.ix-eco-viewport {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ix-eco-track {
  display: flex;
  width: 400%;
  height: 100%;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .ix-eco-track {
    transition: none;
  }

  #ix-ecosystem-popup:not(.ix-eco-hidden) .ix-eco-backdrop,
  #ix-ecosystem-popup:not(.ix-eco-hidden) .ix-eco-modal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.ix-eco-slide {
  width: 25%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.ix-eco-slide-top {
  flex: 1.12;
  min-height: 210px;
  padding: 26px 48px 18px 22px;
  margin: 12px 12px 0;
  border-radius: 12px;
  background: var(--ix-surface-subtle);
  border: 1px solid var(--ix-border);
  position: relative;
  overflow: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ix-eco-slide-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  padding: 0.35em 0.75em;
  border-radius: 6px;
  margin: 0 0 10px;
  position: relative;
  color: #ffffff !important;
  background: var(--ix-brand-600);
  border: none;
  box-shadow: none;
}

.ix-eco-slide-title {
  font-size: clamp(1.25rem, 3.5vw, 1.625rem);
  font-weight: 650;
  color: var(--ix-text);
  margin: 0 0 8px;
  line-height: 1.25;
  max-width: 18em;
  position: relative;
  letter-spacing: -0.02em;
}

.ix-eco-slide-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ix-muted);
  margin: 0 0 14px;
  max-width: 32em;
  position: relative;
}

/* Secondary text link style */
.ix-eco-try {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--ix-brand-600) !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(108, 43, 217, 0.35);
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.ix-eco-try:hover {
  background: rgba(108, 43, 217, 0.06);
  border-color: var(--ix-brand-600);
  color: var(--ix-brand-deep) !important;
}

.ix-eco-try:active {
  background: rgba(108, 43, 217, 0.1);
}

.ix-eco-try:focus-visible {
  outline: 2px solid var(--ix-brand-600);
  outline-offset: 2px;
}

.ix-eco-art {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: min(168px, 40%);
  height: min(128px, 32%);
  opacity: 0.72;
  pointer-events: none;
}

.ix-eco-slide-footer {
  flex: 0 0 auto;
  padding: 18px 18px 48px;
  margin: 10px 12px 8px;
  border-radius: 12px;
  background: var(--ix-surface-subtle);
  border: 1px solid var(--ix-border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  justify-content: space-between;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ix-eco-footer-copy {
  flex: 1;
  min-width: 200px;
}

.ix-eco-footer-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--ix-text);
  margin: 0 0 4px;
  line-height: 1.3;
}

.ix-eco-footer-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ix-muted);
  margin: 0;
}

/* Primary CTA: solid fill, flat */
.ix-eco-cta-main {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 8px;
  background: var(--ix-brand-600);
  color: #ffffff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  max-width: 240px;
  line-height: 1.35;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease;
}

.ix-eco-cta-main:hover {
  background: var(--ix-brand-500);
}

.ix-eco-cta-main:active {
  background: var(--ix-brand-deep);
}

.ix-eco-cta-main:focus-visible {
  outline: 2px solid var(--ix-brand-600);
  outline-offset: 2px;
}

.ix-eco-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ix-brand-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.ix-eco-nav:hover {
  background: rgba(108, 43, 217, 0.1);
  color: var(--ix-brand-deep);
}

.ix-eco-nav:active {
  background: rgba(108, 43, 217, 0.16);
}

.ix-eco-nav:focus-visible {
  outline: 2px solid var(--ix-brand-500);
  outline-offset: 2px;
}

.ix-eco-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ix-eco-prev {
  left: 10px;
}

.ix-eco-next {
  right: 10px;
}

.ix-eco-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 4;
  pointer-events: none;
}

.ix-eco-dot {
  pointer-events: auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--ix-border);
  padding: 0;
  background: #d1d5db;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ix-eco-dot[aria-current="true"] {
  background: var(--ix-brand-600);
  border-color: var(--ix-brand-600);
}

.ix-eco-dot:focus-visible {
  outline: 2px solid var(--ix-brand-500);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  #ix-ecosystem-popup {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .ix-eco-modal {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 14px;
    max-height: min(88vh, 600px);
  }

  .ix-eco-slide {
    flex-direction: column;
    min-height: auto;
  }

  .ix-eco-slide-top {
    text-align: center;
    margin: 8px 0 0;
    padding: 20px 14px 14px;
    min-height: auto;
  }

  .ix-eco-slide-footer {
    text-align: center;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px 46px;
    margin: 8px 0 8px;
  }

  .ix-eco-footer-copy {
    min-width: 0;
    width: 100%;
  }

  .ix-eco-slide-title {
    font-size: 1.125rem;
    max-width: none;
  }

  .ix-eco-slide-desc,
  .ix-eco-footer-desc {
    font-size: 14px;
    max-width: none;
  }

  .ix-eco-footer-title {
    font-size: 0.9375rem;
  }

  .ix-eco-cta-main,
  .ix-eco-try {
    width: 100%;
    max-width: none;
  }

  .ix-eco-art {
    display: none;
  }

  .ix-eco-nav {
    width: 34px;
    height: 34px;
  }

  .ix-eco-prev {
    left: 6px;
  }

  .ix-eco-next {
    right: 6px;
  }

  .ix-eco-close {
    top: 8px;
    right: 8px;
  }
}

/* Override global link/orange theme inside dialog — flat only */
#ix-ecosystem-popup   a.ix-eco-try,
#ix-ecosystem-popup   a.ix-eco-try:link,
#ix-ecosystem-popup   a.ix-eco-try:visited {
  background-color: transparent !important;
  background-image: none !important;
  color: var(--ix-brand-600) !important;
  -webkit-text-fill-color: currentColor;
  border: 1px solid rgba(108, 43, 217, 0.35) !important;
  box-shadow: none !important;
}

#ix-ecosystem-popup   a.ix-eco-try:hover {
  background-color: rgba(108, 43, 217, 0.06) !important;
  background-image: none !important;
  color: var(--ix-brand-deep) !important;
  border-color: var(--ix-brand-600) !important;
}

#ix-ecosystem-popup   a.ix-eco-cta-main,
#ix-ecosystem-popup   a.ix-eco-cta-main:link,
#ix-ecosystem-popup   a.ix-eco-cta-main:visited {
  background-color: var(--ix-brand-600) !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  border-color: transparent !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

#ix-ecosystem-popup   a.ix-eco-cta-main:hover {
  background-color: var(--ix-brand-500) !important;
  background-image: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

#ix-ecosystem-popup   a.ix-eco-cta-main:active {
  background-color: var(--ix-brand-deep) !important;
}

#ix-ecosystem-popup .ix-eco-slide-kicker {
  background: var(--ix-brand-600) !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

#ix-ecosystem-popup .ix-eco-close {
  background: var(--ix-close) !important;
  background-image: none !important;
  border-color: rgba(127, 29, 29, 0.45) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

#ix-ecosystem-popup .ix-eco-close:hover {
  background: var(--ix-close-hover) !important;
  border-color: rgba(127, 29, 29, 0.65) !important;
  color: #ffffff !important;
}

#ix-ecosystem-popup .ix-eco-dot[aria-current="true"] {
  background-color: var(--ix-brand-600) !important;
  background-image: none !important;
  border-color: var(--ix-brand-600) !important;
}
