
.modal {
    position: fixed;
    top: 15%;
    left: 5%;

    min-width: auto;
    width: 90%;

    backface-visibility: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, .1);
    visibility: hidden;
    z-index: 2000;
}

@media (max-width: 480px) {
    .modal { top: 8%; }
}

    .modal img {
        max-width: 100%;
        max-height: 100%;
    }

    .modal .gm-bundled-control img {
        max-height: inherit;
    }

.modal.modal-full-width {
    height: 80%;
    width: 85%;
    max-width: none;

    box-shadow: none;
    overflow: hidden;
}
    .modal.modal-full-width img {
        display: block;
        position: relative;
        top: 50%;
        left: 50%;
        max-width: 100%;
        max-height: 100%;

        -webkit-transform: translateX(-50%) translateY(-50%) translate3d(0,0,0); /* mobile Safari requires -webkit prefix */
        transform: translateX(-50%) translateY(-50%) translate3d(0,0,0);
    }

.modal-show {
    visibility: visible;
}

.modal-overlay {
    opacity: 0;
    visibility: hidden;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;

    z-index: 1000;

    background: rgba(152,164,168,.8);
    transition: all .3s;
}
.in-iosapp .modal-overlay {
    top: -55px; /* iphone X */
}

    .modal-overlay.modal-show,
    .modal-show ~ .modal-overlay,
    .modal-keep-overlay ~ .modal-overlay,
    .modal-overlay.show {
        opacity: 1;
        visibility: visible;
    }

.modal-close {
    position: absolute;
    right: 0px;
    top: 0px;
    color: white;
    z-index: 3000;
    text-align: center;
    line-height: 11px;
    cursor: pointer;
    font-size: 0.8em !important;
    padding: 4px !important;
    background-color: grey;
}

    .modal-close:hover {
        opacity: .7;
    }

.modal-content {
    position: relative;
    margin: 0 auto;

    background: #359db1;
    color: #fff;

    border-radius: 3px;
}
    .modal-content h3 {
        margin: 0;
        padding: 0.4em;

        background: rgba(0,0,0,0.1);
        border-radius: 3px 3px 0 0;

        font-size: 1.35em;
        font-weight: normal;
        text-align: center;

        opacity: .8;
    }
    .modal-content > div {
        padding: 1em;
        margin: 0;

        font-size: 1.15em;
        font-weight: 300;
    }
    .modal-content > div p {
        margin: 0;
        padding: 10px 0;
    }

    .modal-content [class^=button] {
        display: inline-block;
        background-color: rgb(192, 192, 192);
        padding: 0.6em 1.2em;
        margin: 4px;
        font-size: 1.1em;

        border: none;
        border-radius: 2px;

        text-transform: uppercase;

        cursor: pointer;
    }
        .modal-content .secondary {
            margin-left: 1em;
        }

        .modal-content .button-confirm {
            color: white;
            background: #1e5f6c;
            font-weight: bold;
            letter-spacing: 1px;
            width: 100%;
        }
            .button-confirm:hover {
                background: #194851;
            }

        .modal-content .button-cancel {
            background: #308090;

            font-size: .9em;
            float: right;
        }
            .modal-content .button-cancel:hover {
                background: #266C7a;
            }
            .modal-content .button-cancel.center {
                display: block;
                margin: 0 auto;

                float: none;
            }

        .modal-content input[disabled],
        .modal-content button[disabled] {
            cursor: default;
            opacity: .7;
        }
            .modal-content .button-confirm[disabled]:hover {
                background: #1e5f6c;
            }
            .modal-content .button-cancel[disabled]:hover {
                background: #308090;
            }

    .modal-content input {
        display: block;
        width: 98.15%;
        margin-bottom: 1.5em;
        padding: 0 .25em;

        background: #fff;
        border: 1px solid #aaa;
        border-radius: 1px;
        color: rgb(0, 0, 0);

        line-height: 1.5em;
        outline: none;
    }
    .modal-content .error {
        margin-top: .5em;
    }


.modal-content {
    opacity: 0;

    -webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
    -moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
    transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
}
.modal-from-left .modal-content {
    -webkit-transform: translateX(-20%);
    -moz-transform: translateX(-20%);
    -ms-transform: translateX(-20%);
    transform: translateX(-20%);
}
.modal-from-right .modal-content {
    -webkit-transform: translateX(20%);
    -moz-transform: translateX(20%);
    -ms-transform: translateX(20%);
    transform: translateX(20%);
}

.modal-show .modal-content {
    opacity: 1;

    -webkit-transform: translateX(0);
    -moz-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}


.modal.loading .button-confirm,
.comment-form.loading .button-submit {
    -webkit-animation: rotatePlane 1.2s infinite ease-in-out;
    animation: rotatePlane 1.2s infinite ease-in-out;
}

#modal-toolong-submission-confirm [class^=button] {
    font-size: .85em;
}

@-webkit-keyframes rotatePlane {
    0% { -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); }
    50% { -webkit-transform: perspective(120px) rotateX(180.1deg) rotateY(0deg); }
    100% { -webkit-transform: perspective(120px) rotateX(359.9deg) rotateY(0deg); }
}
@keyframes rotatePlane {
    0% { transform: perspective(120px) rotateX(0deg) rotateY(0deg); }
    50% { transform: perspective(120px) rotateX(180.1deg) rotateY(0deg); }
    100% { transform: perspective(120px) rotateX(359.9deg) rotateY(0deg); }
}

@media (min-width: 480px) {
    .modal-content h3 {
        font-size: 1.7em;
    }
}

@media (min-width: 640px) {
    .modal {
        top: 50%;
        left: 50%;

        width: 50%;
        height: auto;
        max-width: 630px;
        min-width: 320px;

        transform: translateX(-50%) translateY(-50%) translate3d(0,0,0);
    }
        .modal-content > div {
            padding: 15px 40px 30px;
        }

        #modal-toolong-submission-confirm [class^=button] {
            font-size: 1em;
        }
}

@media (min-width: 800px) {
    .modal-content h3 {
        font-size: 2.3em;
    }
}

@media (max-width: 480px) {
    .modal {
        position: absolute; // because of an iOS+Safari bug in displaying inputs in fixed elements
    }
}
