.modal {
    font-family: 'Open Sans', Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #415868;
    position: fixed; /* Change to fixed to center relative to the viewport */
    top: 50%;
    left: 50%;
    width: 280px;
    height: 210px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 4px 8px 12px 0 rgba(0, 0, 0, 0.4);
    text-align: center;
    overflow: hidden;
    transform: translate(-50%, -50%); /* Center the modal */
    animation: show-modal 0.5s ease-in-out;
  }
  
  .modal.hide {
    animation: hide-modal 0.4s ease-in-out both;
  }
  
  .modal img {
    margin-top: 24px;
  }
  .modal .title {
    display: block;
    font-size: 18px;
    line-height: 24px;
    font-weight: 400;
    margin: 14px 0 5px 0;
  }
  .modal p {
    font-size: 14px;
    font-weight: 300;
    line-height: 19px;
    margin: 0;
    padding: 0 30px;
  }
  .modal .button {
    position: absolute;
    height: 40px;
    bottom: 0;
    left: 0;
    right: 0;
    background: #F65656;
    color: #fff;
    line-height: 40px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
  }
  .modal .button:hover {
    background: #EC3434;
  }
  @keyframes show-modal {
    0% {
      transform: translate(-50%, -50%) scale(0);
    }
    60% {
      transform: translate(-50%, -50%) scale(1.1);
    }
    80% {
      transform: translate(-50%, -50%) scale(0.95);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
    }
  }
  @keyframes hide-modal {
    0% {
      transform: translate(-50%, -50%) scale(1);
    }
    20% {
      transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
      transform: translate(-50%, -50%) scale(0);
    }
  }