/* Blur the connect page in place when popup opens */

#connect-page {
  transform-origin: center center;
  transition:
    filter 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: filter, transform;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open #connect-page {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

@keyframes connection-modal-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.connection-success-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0b0b0c;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.connection-success-modal__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0b0b0c url("../assets/wallet-popup-bg.png") center / cover no-repeat;
  filter: blur(18px) saturate(0.9);
  transform: scale(1.08);
  pointer-events: none;
}

.connection-success-modal__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.connection-success-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.connection-success-modal.is-visible {
  opacity: 1;
}

.connection-success-modal__card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 432px;
  padding: 20px 20px 24px;
  background: #1c1d1f;
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 32px 80px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: scale(0.94) translateY(16px);
}

.connection-success-modal.is-visible .connection-success-modal__card {
  animation: connection-modal-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.connection-success-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease;
}

.connection-success-modal__close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.connection-success-modal__close svg {
  display: block;
}

.connection-success-modal__hero-wrap {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  line-height: 0;
  background: linear-gradient(105deg, #a85a4a 0%, #6b4578 50%, #3d3568 100%);
}

.connection-success-modal__hero {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center bottom;
}

.connection-success-modal__title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.connection-success-modal__text {
  margin: 0 0 20px;
  color: #949494;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.connection-success-modal__features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.connection-success-modal__feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.connection-success-modal__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  color: #fff;
}

.connection-success-modal__feature-title {
  margin: 0 0 2px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.connection-success-modal__feature-text {
  margin: 0;
  color: #949494;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.connection-success-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.connection-success-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  font: 600 16px/1 Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease;
}

.connection-success-modal__btn--primary {
  background: #fff;
  color: #000;
}

.connection-success-modal__btn--primary:hover {
  background: #e8e8e8;
}

.connection-success-modal__btn--secondary {
  background: #2c2c2f;
  color: #fff;
}

.connection-success-modal__btn--secondary:hover {
  background: #38383c;
}

@media (prefers-reduced-motion: reduce) {
  #connect-page {
    transition: none;
  }

  body.modal-open #connect-page {
    transform: none;
  }

  .connection-success-modal__card {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
