@import "../ui.vars.less";

sc-form-section {  //breaks up form sections
    display: block;
    margin-bottom: 20px;

    p[label]{
        margin-bottom: 5px;
    }

    label {
        color: @scText;
        display: block;
        cursor: pointer;
        margin-bottom: 8px;

        &[disabled]{
            opacity: 0.4;
        }

        &[checkbox], [radio] {
            cursor: pointer;

            p {
                cursor: default;
                margin-left: 19px;
            }
        }
    }

    &[flex]{
        display: flex;
        flex: 1 1 0;
        -ms-flex: 1 1 auto;
        align-items: center;
    }
    &[flex-container]{
        display: flex;
        &[wrap] {
            flex-wrap: wrap;
        }
    }

    &[last-section]{
        margin-bottom: 0px;
    }

    input[type=url], input[type=text], input[type=search], input[type=tel], input[type=number], input[type=email], input[type=password], select, textarea {
        display: inline-block;
        height: auto;
        padding: 6px 10px;
        font-size: 0.875rem;
        line-height: 1.25rem;
        width: 100%;
        max-width: 100%;
        color: lighten(@scText, 10%);
        border-radius: 8px;
        vertical-align: middle;
        background-color: #fff;
        border: 1px solid #C8C8C8; //#A0A0A0
        -webkit-appearance: none;
        -moz-appearance: none;
        -ms-appearance: none;

        &[input-max-width] {
            max-width: 400px;
        }

        &[small] {
            max-width: 300px;
        }

        &:hover, &:visited, &:active {
            border: 1px solid #989898; //#6D6D6D
            outline: none;
            outline-offset: none;
            box-shadow: none;
            transition: .3s;
        }

        &:focus {
            outline: none !important;
            border: 1px solid @scAction;
            box-shadow: 0px 0px 0px 3px @scActionBackground;
        }

        &[invalid], &.invalid, &.ng-touched.ng-invalid {
            border: 1px solid @scNegative;
            outline: none;
            outline-offset: none;
            box-shadow: none;
            transition: .2s;
        }

        &[warning]{
            border: 1px solid @scWarningBorder;
            outline: none;
            outline-offset: none;
            box-shadow: none;
            transition: .2s;
        }
    }

    select {
        -webkit-appearance: none;
        -moz-appearance: none;
        -ms-appearance: none;
        appearance: none;
        background: url('chevron-down.svg') ~"calc(100% - 7px)" no-repeat;
        background-size: 20px 13px;       
        color:@scAction;  

        &[tall] {
            height: 52px;
        }
    }

    select::-ms-expand {
        display: none;
    }
    
    input[type=number] {
        width: 114px;
        text-align: right;
    }

    input[type=checkbox], input[type=radio] {
        vertical-align: middle;
    }

    input[type=search] {
        max-width: 240px;
        padding-right: 25px;
        
        &[full-width] {
            max-width: 100%;
            width: 100%;
        }
    }

    input[type=text] {
        &[postal-code] {
            max-width: 120px;
        }
    }
}

[form-error-text] {
    color: @scNegative;
    position: absolute; // Keeps text from pushing elements below it.

    &.ng-enter, &.ng-leave {
        transition: 0.2s;
    }

    &.ng-enter, &.ng-leave.ng-leave-active {
        opacity: 0;
    }

    &.ng-leave, &.ng-enter.ng-enter-active {
        opacity: 1;
    }
}

[form-error] {
    color: @scNegative;
}

[min-form-error-height]{
    min-height: 15px;
}