.app-popup-open,
.app-popup-open body {
  overflow: hidden;
}

.app-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: Montserrat, 'Open Sans', sans-serif;
}

.app-popup[hidden] {
  display: none;
}

.app-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 27, 41, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
}

.app-popup__card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 440px;
  padding: 32px 24px calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -12px 40px rgba(6, 27, 41, .2);
  text-align: center;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.app-popup__card::before {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  border-radius: 2px;
  background: rgba(6, 27, 41, .12);
  content: "";
}

.app-popup.is-visible .app-popup__backdrop {
  opacity: 1;
}

.app-popup.is-visible .app-popup__card {
  transform: none;
}

.app-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 27, 41, .06);
  cursor: pointer;
  transition: background-color .2s;
}

.app-popup__close:hover {
  background: rgba(6, 27, 41, .12);
}

.app-popup__close::before,
.app-popup__close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  margin: -.75px 0 0 -6px;
  border-radius: 1px;
  background: #536068;
  content: "";
}

.app-popup__close::before {
  transform: rotate(45deg);
}

.app-popup__close::after {
  transform: rotate(-45deg);
}

.app-popup__icon {
  display: block;
  width: 88px;
  height: 88px;
  margin: 4px auto 16px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(11, 143, 230, .3);
}

.app-popup__title {
  margin: 0 24px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #061b29;
}

.app-popup__stars {
  display: block;
  width: 84px;
  height: auto;
  margin: 10px auto 0;
}

.app-popup__text {
  margin: 12px 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: #536068;
}

.app-popup__button {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: 14px;
  background: #0b8fe6;
  box-shadow: 0 6px 16px rgba(11, 143, 230, .35);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: background-color .2s, transform .2s;
}

.app-popup__button:hover {
  background: #0a7fcd;
  color: #fff;
}

.app-popup__button:active {
  transform: scale(.98);
}

.app-popup__secondary {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #536068;
  cursor: pointer;
}

.app-popup__secondary:hover {
  color: #061b29;
}

.app-popup__button:focus-visible,
.app-popup__secondary:focus-visible,
.app-popup__close:focus-visible {
  outline: 2px solid #0b8fe6;
  outline-offset: 2px;
}

html.dark .app-popup__card,
.dark-theme .app-popup__card {
  background: #141518;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
}

html.dark .app-popup__card::before,
.dark-theme .app-popup__card::before,
html.dark .app-popup__close,
.dark-theme .app-popup__close {
  background: rgba(255, 255, 255, .1);
}

html.dark .app-popup__close::before,
html.dark .app-popup__close::after,
.dark-theme .app-popup__close::before,
.dark-theme .app-popup__close::after {
  background: #dfe1e5;
}

html.dark .app-popup__title,
.dark-theme .app-popup__title,
html.dark .app-popup__secondary:hover,
.dark-theme .app-popup__secondary:hover {
  color: #fff;
}

html.dark .app-popup__text,
.dark-theme .app-popup__text,
html.dark .app-popup__secondary,
.dark-theme .app-popup__secondary {
  color: #9aa6b0;
}

@media (min-width: 600px) {
  .app-popup {
    align-items: center;
    padding: 24px;
  }

  .app-popup__card {
    padding-bottom: 20px;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(6, 27, 41, .3);
    opacity: 0;
    transform: scale(.94);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
  }

  .app-popup__card::before {
    display: none;
  }

  .app-popup.is-visible .app-popup__card {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-popup__backdrop,
  .app-popup__card {
    transition: none;
  }
}
