// lms - views - login/register view
// ====================
@import '../base/grid-settings';
@import "neat/neat"; // lib - Neat

%heading-4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0 !important;
    color: $m-gray-d2;
}

%body-text {
    font-size: 15px;
    margin: 0 0 $baseline 0;
    color: $base-font-color;
    line-height: lh(1);
}

.section-bkg-wrapper {
    background: $m-gray-l4;
}

.login-register {
    @include box-sizing(border-box);
    @include outer-container;
    $grid-columns: 12;
    background: white;

    width: 100%;

    h2 {
        line-height: 16px;
        margin: 0;
        font-family: $sans-serif;
    }

    /* Temp. fix until applied globally */
    > {
        @include box-sizing(border-box);
    }


    /* Remove autocomplete yellow background */
    input:-webkit-autofill {
        -webkit-box-shadow:0 0 0 50px white inset;
        -webkit-text-fill-color: #333;
    }

    input:-webkit-autofill:focus {
        -webkit-box-shadow: white, 0 0 0 50px white inset;
        -webkit-text-fill-color: #333;
    }

    .header {
        @include outer-container;
        border-bottom: 1px solid $gray-l4;
        width: 100%;
        padding-top: 35px;
        padding-bottom: 35px;
        overflow: hidden;

        .headline {
            @include box-sizing(border-box);
            @include font-size(35);
            padding: 0 10px;
            font-family: $sans-serif;
            font-weight: $font-semibold;
            text-align: left;
            margin-bottom: 0;
            color: $m-blue-d5;
        }

        .tagline {
            @include box-sizing(border-box);
            @include font-size(24);
            padding: 0 10px;
            font-family: $sans-serif;
            font-weight: $font-regular;
        }
    }

    .form-toggle {
        margin: 0;
    }

    .form-type {
        @include box-sizing(border-box);
        @include span-columns(12);
        padding: 25px 10px;

        &:nth-of-type(2) {
            border-bottom: 1px solid $gray-l4;
        }
    }

    .note {
        @extend %t-copy-sub2;
        display: block;
        font-weight: normal;
        color: $gray;
        margin-top: 15px;
    }


    /** The forms **/
    .form-wrapper {
        padding-top: 25px;

        form {
            @include clearfix;
            clear: both;
        }
    }

    .login-form {
        margin-bottom: 20px;
    }

    %bold-label {
        @include font-size(16);
        font-family: $sans-serif;
        font-weight: $font-semibold;
        font-style: normal;
        text-transform: none;
    }

    .form-label {
        @extend %bold-label;
        padding: 0 0 0 5px;
        letter-spacing: 1px;
    }

    .action-label {
        @extend %bold-label;
        margin-bottom: 20px;
    }

    .form-field {
        @include clearfix;
        clear: both;
        position: relative;
        width: 100%;
        margin: 0 0 $baseline 0;

        /** FROM _accounts.scss - start **/
        label,
        input,
        textarea {
            border-radius: 0;
            height: auto;
            font-family: $sans-serif;
            font-style: normal;
            font-weight: 500;
            color: $base-font-color;
        }

        label {
            @include transition(color 0.15s ease-in-out 0s);
            margin: 0 0 ($baseline/4) 0;
            color: tint($black, 20%);
            font-weight: $font-semibold;

            &.inline {
                display: inline;
            }

            &.error {
                color: $red;
            }

            a {
                font-family: $sans-serif;
            }
        }

        .field-link {
            position: relative;
            color: $link-color-d1;
            font-weight: $font-regular;
            text-decoration: none !important; // needed but nasty
            font-family: $sans-serif;
            font-size: 0.8em;
            padding-top: 7px;
        }

        input,
        textarea {
            display: block;
            width: 100%;
            margin: 0;
            padding: ($baseline/2) ($baseline*.75);

            &.long {
                width: 100%;
            }

            &.short {
                width: 25%;
            }

            &.checkbox {
                display: inline;
                width: auto;
                margin-right: 5px;
            }

            &.error {
                border-color: tint($red,50%);
            }
        }

        textarea.long {
            height: ($baseline*5);
        }

        select {
            width: 100%;

            &.error {
                border-color: tint($red,50%);
            }
        }
        /** FROM _accounts.scss - end **/
    }

    .input-block {
        width: 100%;
    }

    .input-inline {
        display: inline;
    }

    .desc {
        @include transition(color 0.15s ease-in-out 0s);
        display: block;
        margin-top: ($baseline/4);
        color: $lighter-base-font-color;
        font-size: em(13);
    }

    .action-primary {
        @extend %m-btn-primary;
        width: 100%;
        text-transform: none;
        color: white;
    }

    .login-provider {
        @extend %btn-secondary-blue-outline;
        width: 100%;
        margin-bottom: 20px;
        text-shadow: none;
        text-transform: none;

        .icon {
            color: inherit;
            margin-right: $baseline/2;
        }

        &:last-child {
            margin-bottom: 20px;
        }

        &.button-Google:hover,
        &.button-Google:focus {
            background-color: #dd4b39;
            border: 1px solid #A5382B;
        }

        &.button-Google:hover {
            box-shadow: 0 2px 1px 0 #8D3024;
        }

        &.button-Facebook:hover,
        &.button-Facebook:focus {
            background-color: #3b5998;
            border: 1px solid #263A62;
        }

        &.button-Facebook:hover {
            box-shadow: 0 2px 1px 0 #30487C;
        }

        &.button-LinkedIn:hover,
        &.button-LinkedIn:focus {
            background-color: #0077b5;
            border: 1px solid #06527D;
        }

        &.button-LinkedIn:hover {
            box-shadow: 0 2px 1px 0 #005D8E;
        }

    }

    /** Error Container - from _account.scss **/
    .status {
        @include box-sizing(border-box);
        margin: 0 0 $baseline 0;
        border-bottom: 3px solid shade($yellow, 10%);
        padding: $baseline $baseline;
        background: tint($yellow,20%);

        .message-title {
            @extend %heading-4;
            font-family: $sans-serif;
            margin: 0 0 ($baseline/4) 0;
            font-size: em(14);
            font-weight: 600;
        }

        .message-copy {
            @extend %body-text;
            font-family: $sans-serif;
            margin: 0 !important;
            padding: 0;
            list-style: none;

            li {
                margin: 0 0 ($baseline/4) 0;
            }
        }
    }

    .submission-error, .system-error {
        box-shadow: inset 0 -1px 2px 0 tint($red, 85%);
        border-bottom: 3px solid shade($red, 10%);
        background: tint($red,95%);

        .message-title {
            color: shade($red, 10%) !important;
        }

        .message-copy {

        }
    }

    .submission-success {
        box-shadow: inset 0 -1px 2px 0 tint($green, 85%);
        border-bottom: 3px solid shade($green, 10%);
        background: tint($green, 95%);

        .message-title {
            color: shade($green, 10%) !important;
        }

        .message-copy {

        }
    }

    /** RWD **/
    @include media( $tablet ) {
        $grid-columns: 8;

        %inline-form-field-tablet {
            clear: none;
            display: inline-block;
            float: left;
        }

        .header .headline,
        .header .tagline,
        .form-type {
            @include span-columns(6);
            @include shift(1);
        }

        .form-toggle {
            margin-right: 5px;
        }

        .form-field {
            &.select-gender {
                @extend %inline-form-field-tablet;
                width: calc( 50% - 10px );
                margin-right: 20px;
            }

            &.select-year_of_birth {
                @extend %inline-form-field-tablet;
                width: calc( 50% - 10px );
            }

            .field-link {
                position: absolute;
                top: 0;
                right: 0;
            }
        }
    }

    @include media( $desktop ) {
        $grid-columns: 12;

        %inline-form-field-desktop {
            clear: none;
            display: inline-block;
            float: left;
        }

        .header .headline,
        .header .tagline,
        .form-type {
            width: 600px;
            margin-left: calc( 50% - 300px );
            margin-right: calc( 50% - 300px );
        }

        .form-toggle {
            margin-right: 10px;
        }

        .form-field {
            &.select-level_of_education {
                @extend %inline-form-field-desktop;
                width: 300px;
                margin-right: 20px;
            }

            &.select-gender {
                @extend %inline-form-field-desktop;
                width: 60px;
                margin-right: 20px;
            }

            &.select-year_of_birth {
                @extend %inline-form-field-desktop;
                width: 100px;
            }

            .field-link {
                position: absolute;
                top: 0;
                right: 0;
            }
        }

        .login-provider {
            @include span-columns(6);

            /* Node uses last-child which is not specific enough */
            &:nth-of-type(2n) {
                margin-right: 0;
            }
        }
    }
}
