// Display inline flex
@mixin display-inline-flex() {
    display: -webkit-inline-flex;
    display: -ms-inline-flex;
    display: inline-flex;
}

// Align items
@mixin align-items($args) {
    -webkit-align-items: $args;
    -ms-flex-align: $args;
    align-items: $args;
}

// Justify content
@mixin justify-content($args) {
    -webkit-justify-content: $args;
    -ms-flex-pack: $args;
    justify-content: $args;
}

// Transform
@mixin transform($args) {
    -ms-transform: $args;
    -webkit-transform: $args;
    -o-transform: $args;
    -moz-transform: $args;
    transform: $args;
}

// Transition
@mixin transition($args) {
    -webkit-transition: $args;
    -moz-transition: $args;
    -ms-transition: $args;
    -o-transition: $args;
    transition: $args;
}

// Animation
@mixin animation($args) {
    -webkit-animation: $args;
    -moz-animation: $args;
    -ms-animation: $args;
    -o-animation: $args;
    animation: $args;
}

// Opacity
@mixin opacity($opacity) {
    -moz-opacity: $opacity;
    -webkit-opacity: $opacity;
    opacity: $opacity;
}

// Border radius
@mixin border-radius($radius) {
    -webkit-border-radius: $radius;
    -moz-border-radius: $radius;
    -ms-border-radius: $radius;
    border-radius: $radius;
}

// Box Shadow
@mixin box-shadow($args) {
    -webkit-box-shadow: $args;
    -moz-box-shadow: $args;
    box-shadow: $args;
}

// Popup
#opl-login-form {
    display: none;
    overflow-x: hidden;
    overflow-y: auto;

    &,
    .opl-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100001;
    }

    .opl-popup-block {
        position: relative;
        width: 500px;
        max-width: 100%;
        background-color: #fff;
        color: #777;
        @include border-radius(3px);
        text-align: center;
        overflow: hidden;
    }

    .opl-login-wrap {
        position: relative;
        display: inline-block;
        width: 100%;
        height: 100%;
        vertical-align: top;
        z-index: 1;
    }

    .opl-show {
        display: block;
    }

    .opl-hide {
        display: none;
    }

    .content-header,
    .opl-wrap form,
    .opl-social-login-wrap {
        padding: 0 10%;

        @media (min-width: 600px) {
            padding: 0 20%;
        }
    }

    .content-header {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .opl-wrap form {
        padding-top: 20px;
        padding-bottom: 25px;
    }

    h3.opl-title {
        font-size: 26px;
        line-height: 1.2;
        text-transform: capitalize;
        margin: 0 0 16px;
    }

    .opl-intro {
        font-size: 14px;
        line-height: 1;
    }

    .opl-errors {
        display: none;
        margin-bottom: 20px;

        .alert {
            background-color: #222;
            color: #fff;
            padding: 10px 30px;
            font-size: 11px;
            line-height: 1.6;

            &.alert-danger {
                background-color: #e2401c;

                a {
                    display: block;
                }
            }

            &.alert-success {
                background-color: #3fc387;
            }

            &.alert-warning {
                background-color: #d5af0a;
            }

            a {
                color: #fff;

                &:hover {
                    color: #fff;
                    text-decoration: underline;
                }
            }

            p {
                margin: 0;
            }
        }
    }

    .input-wrap {
        display: inline-block;
        width: 100%;
        position: relative;
        font-size: 15px;
        font-weight: 400;
        color: #040404;
        margin-bottom: 30px;
        text-align: left;

        .input-lg {
            position: relative;
            background-color: transparent !important;
            color: #333 !important;
            height: 24px;
            min-height: 24px;
            font-size: 15px;
            margin: 0;
            padding: 0;
            border: 0;
            @include box-shadow(none);

            &:invalid {
                font-style: italic;
            }

            &:focus ~ .opl-label,
            &:valid ~ .opl-label {
                top: -12px;
                font-size: 11px;
                @include opacity(0.6);
            }

            &:focus ~ .opl-focus-line,
            &:valid ~ .opl-focus-line {
                @include animation(inputAddUnderline 0.3s cubic-bezier(0.4, 0, 0.2, 1));
                @include transform(scaleX(1));
            }
        }

        .opl-label {
            position: absolute;
            top: 3px;
            left: 0;
            font-size: 14px;
            line-height: 1;
            color: #757575;
            width: 100%;
            margin: 0;
            text-align: left;
            pointer-events: none;
            @include transition(all 0.2s ease);
        }

        .opl-line {
            background-color: rgba(0, 0, 0, 0.12);
            bottom: -2px;
            height: 1px;
            left: 0;
            margin: 0;
            padding: 0;
            position: absolute;
            width: 100%;
        }

        .opl-focus-line {
            background-color: #13aff0;
            bottom: -2px;
            height: 2px;
            left: 0;
            margin: 0;
            padding: 0;
            position: absolute;
            width: 100%;
            @include animation(inputRemoveUnderline 0.3s cubic-bezier(0.4, 0, 0.2, 1));
            @include transform(scaleX(0));
        }

        &.opl-remember {
            margin-bottom: 20px;

            label {
                display: inline-block;
                font-size: 14px;
                margin: 0;
                cursor: pointer;
            }
        }
    }

    .opl-button {
        width: 100%;
        height: auto;
        background-color: #13aff0;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        padding: 16px;
        text-transform: uppercase;
        text-align: center;
        border: 0;
        @include border-radius(0);
        @include transition(all 0.3s ease);

        &:active,
        &:hover {
            background-color: #0b7cac;
            @include box-shadow(1px 2px 2px rgba(0, 0, 0, 0.18));
        }
    }

    .opl-text {
        display: block;
        margin-top: 8px;
        font-size: 12px;
    }

    .opl-bottom {
        display: block;
        background-color: #f6f6f6;
        padding: 20px 10px;

        .text {
            display: inline-block;
            margin: 0 20px 0 0;
            font-size: 14px;
            line-height: 18px;
            color: #000;
        }

        .opl-btn {
            display: inline-block;
            font-size: 14px;
            line-height: 20px;
            font-weight: 600;
            text-transform: uppercase;
            background-color: #fff;
            color: #1f1f1f;
            border: 0;
            padding: 12px 30px;
            text-align: center;
            @include border-radius(3px);

            &:active,
            &:focus,
            &:hover {
                @include box-shadow(1px 2px 2px rgba(0, 0, 0, 0.18));
            }
        }
    }

    .opl-close-button {
        position: absolute;
        top: 8px;
        right: 8px;
        color: #333;
        opacity: 0.5;
        font-weight: 300;
        font-size: 40px;
        width: 40px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        z-index: 100003;

        &:hover {
            opacity: 1;
        }
    }

    .opl-social-login-wrap {
        margin: 0 0 20px;
    }

    .wp-social-login-widget {
        margin-botom: 0;
    }

    .wp-social-login-connect-with {
        display: none;
    }

    .opl-social-title {
        position: relative;
        margin-bottom: 14px;

        span {
            display: inline-block;
            position: relative;
            background-color: #fff;
            color: #808080;
            padding: 0 18px;
            z-index: 1;
        }

        &:after {
            content: "";
            position: absolute;
            top: 50%;
            left: 0;
            width: 100%;
            height: 1px;
            background-color: #d8d8d8;
            margin-top: -1px;
        }
    }

    .wp-social-login-provider-list a {
        margin: 0 3px;
        padding: 0;
        width: 44px;
        min-width: 44px;
        height: 44px;
        border-radius: 50%;
        text-align: center;
        @include display-inline-flex();
        @include align-items(center);
        @include justify-content(center);

        > span {
            display: none;
        }
    }

    &.has-background-image {
        background-color: #000;
        color: #fff;

        h3.opl-title {
            color: #fff;
        }

        .input-wrap .opl-line {
            background-color: rgba(#fff, 0.2);
        }

        .input-wrap,
        .opl-text a {
            color: #757575;
        }

        .opl-close-button {
            color: #fff;
        }

        .opl-bottom {
            background-color: #111;

            .text {
                color: #fff;
            }
        }
    }

    // Background image
    &.has-background-image {
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;

        &:after {
            content: "";
            display: block;
            width: 100%;
            height: 100%;
            background-color: rgba(#000, 0.1);
            position: absolute;
            top: 0;
            left: 0;
            z-index: 0;
        }

        .input-wrap .opl-line {
            background-color: rgba(#fff, 0.7);
        }

        .input-wrap .opl-label,
        .input-wrap,
        .opl-text a {
            color: #fff;
        }
    }

    .opl-privacy {
        font-size: 12px;
        margin-bottom: 20px;
    }
}

.opl-login-container {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    text-align: center;
    padding: 30px 8px;

    &:before {
        content: "";
        display: inline-block;
        height: 100%;
        vertical-align: middle;
    }

    .opl-login-content {
        position: relative;
        display: inline-block;
        vertical-align: middle;
        margin: 0 auto;
        max-width: 100%;
        z-index: 100002;
        opacity: 0;
        @include transform(translateY(-30px));
        -webkit-transition: transform 0.5s, opacity 0.3s;
        -moz-transition: transform 0.5s, opacity 0.3s;
        transition: transform 0.5s, opacity 0.3s;
    }
}

.is-visible .opl-login-container .opl-login-content {
    opacity: 1;
    @include transform(translateY(0));
}

.opl-overlay {
    background-color: rgba(11, 11, 11, 0.8);
    cursor: pointer;
}

.g-recaptcha {
    margin-bottom: 20px;
}

@-webkit-keyframes inputRemoveUnderline {
    0% {
        -webkit-transform: scaleX(1);
        opacity: 1;
    }
    to {
        -webkit-transform: scaleX(1);
        opacity: 0;
    }
}

@-moz-keyframes inputRemoveUnderline {
    0% {
        -moz-transform: scaleX(1);
        opacity: 1;
    }
    to {
        -moz-transform: scaleX(1);
        opacity: 0;
    }
}

@-o-keyframes inputRemoveUnderline {
    0% {
        -o-transform: scaleX(1);
        opacity: 1;
    }
    to {
        -o-transform: scaleX(1);
        opacity: 0;
    }
}

@keyframes inputRemoveUnderline {
    0% {
        transform: scaleX(1);
        opacity: 1;
    }
    to {
        transform: scaleX(1);
        opacity: 0;
    }
}

@-webkit-keyframes inputAddUnderline {
    0% {
        -webkit-transform: scaleX(0);
    }
    to {
        -webkit-transform: scaleX(1);
    }
}

@-moz-keyframes inputAddUnderline {
    0% {
        -moz-transform: scaleX(0);
    }
    to {
        -moz-transform: scaleX(1);
    }
}

@-o-keyframes inputAddUnderline {
    0% {
        -o-transform: scaleX(0);
    }
    to {
        -o-transform: scaleX(1);
    }
}

@keyframes inputAddUnderline {
    0% {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* RTL */
body.rtl {
    #opl-login-form {
        .input-wrap {
            text-align: right;

            .opl-label {
                right: 0;
                left: auto;
                text-align: right;
            }

            .opl-line {
                right: 0;
                left: auto;
            }

            .opl-focus-line {
                right: 0;
                left: auto;
            }
        }

        .opl-close-button {
            left: 8px;
            right: auto;
        }

        .opl-social-title:after {
            right: 0;
            left: auto;
        }
    }
}

/* Responsive */
@media screen and (max-width: 850px) {
    .opl-login-container:before {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    #opl-login-form .wp-social-login-provider-list a {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
}
