/* Overlay */

.newsletter-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  display: none;
}

.newsletter-card {
  width: 100%;
  max-width: 450px;
  background: #f7f7f7;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  margin: auto;
  top: 40px;
}

/* Close button */

.newsletter-modal .close-btn {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #cfcfcf;
  background: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
}

/* Header */

.newsletter-modal .newsletter-header {
  background: linear-gradient(180deg,
      #9b4df7,
      #7000d3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Decorative shapes */

.newsletter-modal .newsletter-header::before,
.newsletter-modal.newsletter-header::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
}

.newsletter-modal .newsletter-header::before {
  left: 120px;
  top: 260px;
  transform: rotate(15deg);
}

.newsletter-modal .newsletter-header::after {
  right: 120px;
  top: 180px;
  transform: rotate(-45deg);
}

/* Envelope */

.newsletter-modal .envelope {
  width: 450px;
  position: relative;
}

.newsletter-modal .envelope-letter {
  position: absolute;
  width: 320px;
  height: 230px;
  background: #ece5f4;
  border-radius: 20px;
  top: -70px;
  left: 15px;
  z-index: 1;
  padding: 40px 35px;
}

.newsletter-modal .envelope-letter span {
  display: block;
  height: 16px;
  border-radius: 12px;
  background: #d5cbe3;
  margin-bottom: 28px;
}

.newsletter-modal .envelope-letter span:nth-child(3) {
  width: 65%;
}

/* Envelope body */

.newsletter-modal .envelope-back {
  position: absolute;
  inset: 0;
  background: #ececec;
  z-index: 2;
}

.newsletter-modal.envelope-left {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 175px solid #f3f3f3;
  border-top: 130px solid transparent;
  border-bottom: 130px solid transparent;
  z-index: 3;
}

.newsletter-modal .envelope-right {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-right: 175px solid #f3f3f3;
  border-top: 130px solid transparent;
  border-bottom: 130px solid transparent;
  z-index: 3;
}

.newsletter-modal .envelope-front {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 175px solid transparent;
  border-right: 175px solid transparent;
  border-top: 170px solid #efefef;
  z-index: 4;
}

/* Content */

.newsletter-modal .newsletter-content {
  text-align: center;
  padding: 15px;
}

.newsletter-modal .newsletter-content h2 {
  font-size: 24px;
  line-height: 0.8;
  margin: 0 0 10px;
  color: #151515;
}

.newsletter-modal .subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  max-width: 720px;
}

.newsletter-modal .iframe-link {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 10px;
}

.newsletter-modal .legal {
  max-width: 700px;
  margin: auto;
  color: #666;
  font-size: 10px;
  line-height: 1.7;
}

.newsletter-modal .legal a {
  color: #3158b7;
}

@media screen and (max-width: 850px) {

  .newsletter-modal {
    overflow: auto;
  }

  .newsletter-card {
    width: 90%;
  }
}