.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}


.modal.is-open {
    display: block;
}


.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1em;
}


.modal__container {
    background-color: #fff;
    padding: 2em;
    max-width: 32em;
    max-height: 100%;
    border-radius: 4px;
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
}


.modal__header {
    text-align: right;
    position: absolute;
    top: 0.5em;
    right: 0.5em;
}


.modal__close {
    background: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1.6;
    display: inline-block;
}


.modal__close:before {
    content: "\2715";
}


.modal__close:hover,
.modal__close:focus,
.modal__close:active {
    background: #ddd;
}


.modal__content {
    margin-top: 1em;
    margin-bottom: 1em;
}


.modal__btn:focus, .modal__btn:hover {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}


/*** animation ***/
@keyframes jwModalFadeIn {
    from { opacity: 0; }
      to { opacity: 1; }
}

@keyframes jwModalFadeOut {
    from { opacity: 1; }
      to { opacity: 0; }
}

@keyframes jwModalSlideIn {
  from { transform: translateY(15%); }
    to { transform: translateY(0); }
}

@keyframes jwModalSlideOut {
    from { transform: translateY(0); }
    to { transform: translateY(-10%); }
}

.modal[aria-hidden="false"] .modal__overlay {
  animation: jwModalFadeIn .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.modal[aria-hidden="false"] .modal__container {
  animation: jwModalSlideIn .3s cubic-bezier(0, 0, .2, 1);
}

.modal[aria-hidden="true"] .modal__overlay {
  animation: jwModalFadeOut .3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.modal[aria-hidden="true"] .modal__container {
  animation: jwModalSlideOut .3s cubic-bezier(0, 0, .2, 1);
}

.modal .modal__container,
.modal .modal__overlay {
  will-change: transform;
}
