.sgp-popup,
.sgp-popup * {
  box-sizing: border-box;
}

.sgp-popup {
  --sgp-button: #0d214c;
  --sgp-button-hover: #17366f;
  --sgp-accent: #6388df;
  position: fixed;
  inset: 0;
  z-index: 2147480000;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility .28s ease;
}

.sgp-popup.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sgp-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 15, 36, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sgp-popup__dialog {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(280px, .92fr) minmax(390px, 1.08fr);
  width: min(940px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 30px;
  background: #fbfcff;
  box-shadow: 0 32px 90px rgba(2, 9, 27, .36), 0 8px 28px rgba(2, 9, 27, .16);
  transform: translateY(24px) scale(.97);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}

.sgp-popup__dialog--no-photo {
  grid-template-columns: minmax(0, 1fr);
  width: min(610px, 100%);
}

.sgp-popup.is-open .sgp-popup__dialog {
  transform: translateY(0) scale(1);
}

.sgp-popup__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(12, 31, 73, .1);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #0d214c;
  box-shadow: 0 8px 24px rgba(6, 21, 50, .14);
  cursor: pointer;
  appearance: none;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.sgp-popup__close:hover {
  transform: rotate(7deg) scale(1.06);
  background: #0d214c;
  color: #fff;
}

.sgp-popup__close:focus-visible,
.sgp-popup__button:focus-visible {
  outline: 3px solid #8faeff;
  outline-offset: 3px;
}

.sgp-popup__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.sgp-popup__photo {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  background: #d9e3ec;
}

.sgp-popup__photo img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: 50% 45%;
  transform: scale(1.015);
}

.sgp-popup__photo-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(5, 17, 39, .62) 100%);
  pointer-events: none;
}

.sgp-popup__brand {
  position: absolute;
  left: 24px;
  bottom: 22px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: .04em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sgp-popup__content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  padding: 70px clamp(38px, 5vw, 64px) 62px;
  overflow-y: auto;
  background: radial-gradient(circle at 100% 0, rgba(171, 192, 239, .25), transparent 35%), #fbfcff;
}

.sgp-popup__accent {
  display: block;
  width: 62px;
  height: 5px;
  margin-bottom: 23px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sgp-button), var(--sgp-accent));
}

.sgp-popup__title {
  margin: 0;
  color: #0b1730;
  font-family: inherit;
  font-size: clamp(35px, 4vw, 49px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.sgp-popup__text {
  max-width: 460px;
  margin: 24px 0 31px;
  color: #5d6678;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.58;
}

.sgp-popup__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 56px;
  padding: 15px 23px 15px 25px;
  border: 0;
  border-radius: 16px;
  background: var(--sgp-button);
  color: #fff !important;
  font-family: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  box-shadow: 0 14px 30px rgba(13, 33, 76, .24);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.sgp-popup__button:hover {
  transform: translateY(-2px);
  background: var(--sgp-button-hover);
  color: #fff !important;
  box-shadow: 0 18px 34px rgba(13, 33, 76, .3);
}

.sgp-popup__button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.sgp-popup__button:hover svg {
  transform: translateX(3px);
}

@media (max-width: 760px) {
  .sgp-popup {
    padding: 14px;
  }

  .sgp-popup__dialog {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    border-radius: 24px;
  }

  .sgp-popup__photo {
    min-height: 0;
    height: clamp(150px, 29vh, 220px);
  }

  .sgp-popup__photo img {
    object-position: 50% 34%;
  }

  .sgp-popup__brand {
    left: 18px;
    bottom: 15px;
    padding: 7px 11px;
    font-size: 11px;
  }

  .sgp-popup__close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .sgp-popup__content {
    display: block;
    padding: 27px 24px 28px;
    overflow: visible;
  }

  .sgp-popup__accent {
    width: 50px;
    height: 4px;
    margin-bottom: 17px;
  }

  .sgp-popup__title {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.1;
  }

  .sgp-popup__text {
    margin: 16px 0 22px;
    font-size: 16px;
    line-height: 1.5;
  }

  .sgp-popup__button {
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
  }
}

@media (max-width: 380px), (max-height: 650px) and (max-width: 760px) {
  .sgp-popup__photo {
    height: 118px;
  }

  .sgp-popup__content {
    padding: 21px 20px 22px;
  }

  .sgp-popup__accent {
    margin-bottom: 13px;
  }

  .sgp-popup__title {
    font-size: 27px;
  }

  .sgp-popup__text {
    margin: 13px 0 18px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sgp-popup,
  .sgp-popup__dialog,
  .sgp-popup__close,
  .sgp-popup__button,
  .sgp-popup__button svg {
    transition: none;
  }
}
