.modal-overlay {
    width: 100%;
    height: 100%;
    visibility: hidden;
    top: 0;
    left: 0;
    z-index: 100000;
    position: fixed;
    opacity: 0;
    background: rgba(0,0,0,0.8);
    transition: all 0.3s;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 640px;
    max-width: 90%;
    height: auto;
    z-index: 200000;
    visibility: hidden;
    backface-visibility: hidden;
    transform: translateX(-50%) translateY(-50%);
}
.modal-stage {
    margin: 0 auto;
    color: #4a4a4a;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 2px rgba(0,0,0,0.15);
}
.modal-body {
    padding: 20px;
    background-color: #f9f9f9;
}
.modal-close-button {
    margin: 0;
    padding: 0;
    width: 40px;
    height: 40px;
    font-size: 32px;
    line-height: 40px;
    cursor: pointer;
    z-index: 2;
    position: absolute;
    right: 0;
    top: 0;
    border: 0;
    background-color: transparent;
    appearance: none;
}
.modal-close-button:hover {
    color: white;
    background-color: #f43030;
}
.modal-show {
    visibility: visible;
}
.modal-show ~ .modal-overlay {
    opacity: 1;
    visibility: visible;
}


/*
 * MODAL EFFECTS
 */

/* fadeIn effect */
.modal-fadeIn .modal-stage  {
    opacity: 0.0;
    transform: scale(0.7);
    transition: all 300ms;
}
.modal-show.modal-fadeIn .modal-stage {
    transform: scale(1.0);
    opacity: 1.0;
}

/* spin effect */
.modal-spin .modal-stage  {
    opacity: 0.0;
    transform: scale(0.2);
    transition: all 300ms;
    animation-name: spinOff;
    animation-duration: 500ms;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}
.modal-show.modal-spin .modal-stage {
    opacity: 1.0;
    transform: rotate(0deg);
    animation-name: spin;
}
@keyframes spin {
    from {
        opacity: 0.0;
        transform: rotate(0deg) scale(0.2);
    }
    to {
        opacity: 1.0;
        transform: rotate(720deg) scale(1.0);
    }
}
@keyframes spinOff {
    from {
        opacity: 1.0;
        transform: rotate(720deg) scale(1.0);

    }
    to {
        opacity: 0.0;
        transform: rotate(0deg) scale(0.2);
    }
}

/* bottomUp effect */
.modal-bottomUp .modal-stage  {
    opacity: 0.0;
    top: 110%;
    transform: scale(1.0);
    transition: all 300ms;
}
.modal-show.modal-bottomUp .modal-stage {
    opacity: 1.0;
    top: 50%;
}