label,
input,
.input {
    display: block;
}

input,
textarea,
.input {
    display: block;
    width: 100%;
    padding: 8px 10px;
    box-shadow: none;

    font-family: inherit;
    font-size: inherit;
    font-weight: 400;

    background: @white;
    border: 1px solid @lightGrey;
    border-radius: 0px;

    // for links
    color: inherit;
    text-decoration: none;

    // Errors
    &.error {
        border-color: lighten(@red, 20%);
    }

    &:focus {
        outline: none;
        border-color: @turquoise;
    }
}

input,
textarea,
.input,
.checkbox label,
.form-error {
    +.form-error {
        background: @red;
        color: white;
        position: relative;
        top: -1px;
        padding: 8px;
        font-size: 13px;
        line-height: 1.2;
        // triangle
        &:before {
            content: '';
            display: block;
            position: absolute;
            bottom: 100%;
            left: 20px;
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 8px solid @red;
        }
    }
}

.form-error + .form-error {
    background: darken(@red, 5%);
    &:before {
        content: none;
        display: none;
    }
}

textarea {
    min-height: 78px; // ~3 lines
    &.textarea-large {
        min-height: 130px;
    }
}

select,
input {
    color: @black;
}

.input-swatch {
    float: left;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 1px solid @lightGrey;
}

label {
//    padding: 0 10px;
    font-size: 14px;
    color: @darkGrey;
    margin-bottom: 5px;
}

label + p {
    margin-top: 0;
}
p.url {
    word-break: break-all;
}

.form-group,
.checkbox {
    padding: @body-padding 0; // The left and right padding is defined by the main-container element of a view
    margin: 0;
    p {
        &:first-child {
            margin-top: 0;
        }
        margin-bottom: 0;
    }
}

::-moz-placeholder {
    color: @mediumGrey;
}

/*********************************************************
* Input groups
*/

.input-group {
    display: flex;
    input {
        width: auto;
        flex-grow: 1;
    }
    .input-group-addon {
        padding: 8px 10px;
        background: @lightGrey;
        border: 1px solid darken(@lightGrey, 5%);
        &:last-child {
            border-left: 0;
        }
        &:first-child {
            border-right: 0;
        }
    }
}

/*********************************************************
* Checkbox
*/
input[type="checkbox"] {
    width: auto;
}

.checkbox {
    position: relative;
    min-height: 20px;
    label {
        padding-left: 25px;
    }
    input[type="checkbox"] {
        position: absolute;
        width: 30px;
        margin: 4px 0 0 -30px;
    }
}

/*********************************************************
* Validation Messages
*/
.error {
    color: @red;
}

/*********************************************************
* Help block
*/
.help-block {
    margin-top: 5px;
    margin-bottom: 10px;
    color: lighten(@darkGrey, 15%);
}
