/* ============================
   Popup Overlay
============================ */

#custom-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  /* semi-transparent overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}


/* Show overlay (fade in) */

#custom-popup.active {
  opacity: 1;
  visibility: visible;
  animation: fadeIn 0.4s ease forwards;
}


/* Close overlay (fade out) */

#custom-popup.closing {
  opacity: 0;
  visibility: visible;
  /* keep visible until animation finishes */
  animation: fadeOut 0.4s ease forwards;
}


/* ============================
   Popup Box
============================ */

.custom-popup .popup-content {
  background: #fff;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  padding: 2em;
  box-sizing: border-box;
  text-align: center;
  font-family: "Lato", sans-serif;
  color: #545454;
  position: relative;
  transform: scale(0.7);
  opacity: 0;
}


/* Pop-in animation */

#custom-popup.active .popup-content {
  animation: popIn 0.45s ease-out forwards;
}


/* Pop-out animation */

#custom-popup.closing .popup-content {
  animation: popOut 0.35s ease-in forwards;
}


/* ============================
   Elements
============================ */


/* Icon */

.custom-popup .popup-icon {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 1em;
}


/* Heading */

.custom-popup h2 {
  color: #545454;
  font-family: "Libre Caslon Text", serif;
  font-weight: 600;
  font-size: 1.75em;
  /* ~30px */
  margin: 0 0 0.5em;
}


/* Description */

.custom-popup p {
  font-size: 1.125em;
  /* ~18px */
  color: #555;
  margin: 0 0 1.5em;
  line-height: 1.5;
}


/* Button */

#custom-popup .popup-btn {
  display: inline-block;
  background-color: #00305b;
  /* brand color */
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 48, 91, 0.5);
  transition: background 0.2s, box-shadow 0.2s;
}


/* Hover & Focus */

#custom-popup .popup-btn:hover {
  background-color: #002244;
}

#custom-popup .popup-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 48, 91, 0.5);
}


/* ============================
   Animations
============================ */

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }

  60% {
    opacity: 1;
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.7);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}
