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

.exit-popup {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.exit-popup-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(25, 31, 27, .62);
  backdrop-filter: blur(5px);
  cursor: default;
}

.exit-popup-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: clamp(34px, 6vw, 62px);
  border: 1px solid rgba(179, 140, 71, .42);
  background: #fffdf8;
  box-shadow: 0 30px 90px rgba(36, 48, 41, .28);
  color: var(--ink);
  text-align: center;
  animation: exit-popup-in .38s cubic-bezier(.2, .75, .25, 1) both;
}

.exit-popup-dialog::before {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  margin: 0 auto 25px;
  background: #b38c47;
}

.exit-popup-close {
  position: absolute;
  top: 12px;
  right: 15px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #596057;
  font: 300 2rem/1 var(--sans);
  cursor: pointer;
  transition: color .2s, transform .2s;
}

.exit-popup-kicker {
  margin: 0 0 12px;
  color: #b38c47;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.exit-popup-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1;
}

.exit-popup-dialog > p:not(.exit-popup-kicker) {
  max-width: 500px;
  margin: 22px auto 0;
  color: var(--muted);
}

.exit-popup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 27px;
  padding: 12px 25px;
  border: 1px solid #b38c47;
  border-radius: 999px;
  background: #b38c47;
  color: #fffdf8;
  font-family: var(--serif);
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}

.exit-popup-guide {
  width: min(100%, 700px);
}

.exit-popup-guide h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

.exit-popup-form {
  display: grid;
  gap: 13px;
  max-width: 520px;
  margin: 27px auto 0;
}

.exit-popup-form input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 13px 17px;
  border: 1px solid rgba(36, 48, 41, .25);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  outline: none;
  text-align: center;
}

.exit-popup-form input[type="email"]:focus {
  border-color: #b38c47;
  box-shadow: 0 0 0 3px rgba(179, 140, 71, .15);
}

.exit-popup-form .exit-popup-button {
  width: 100%;
  margin-top: 0;
}

.exit-popup-form small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.exit-popup-form small a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.exit-popup-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.exit-popup-status {
  min-height: 1.5em;
  margin: 0;
  font-size: .88rem;
}

.exit-popup-status.success {
  color: #4d6a42;
}

.exit-popup-status.error {
  color: #9a3e32;
}

body.exit-popup-open {
  overflow: hidden;
}

@keyframes exit-popup-in {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (hover: hover) and (pointer: fine) {
  .exit-popup-button:hover {
    background: transparent;
    color: #b38c47;
    transform: translateY(-2px);
  }

  .exit-popup-close:hover {
    color: #b38c47;
    transform: rotate(5deg) scale(1.08);
  }
}

@media (max-width: 560px) {
  .exit-popup {
    align-items: end;
    padding: 12px;
  }

  .exit-popup-dialog {
    max-height: calc(100svh - 24px);
    overflow-y: auto;
    padding: 35px 21px 27px;
  }

  .exit-popup-dialog h2 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exit-popup-dialog {
    animation: none;
  }
}
