// Base form styles
// -------------------------------------------------------------------
// Apply `.form-control` to any of the following form controls:
// select
// textarea
// input (of any type)
.form-control {
    background-image: none; // Reset unusual Firefox-on-Android default style
    background: $white;
    border: $border-width solid $border-color;
    border-radius: $border-radius;
    color: $text-color;
    display: block;
    font-family: $font-family--ui;
    font-size: 1rem;
    line-height: $line-height--base;
    max-width: 100%;
    padding: $form-padding;
    width: 100%;
    -moz-osx-font-smoothing: grayscale;

    &:focus {
        border-color: $primary-color;
    }
}

.label {
    cursor: default;
    display: inline-block;
    font-weight: 700;
    max-width: 100%; // Force IE8 to wrap long content
}

.legend {
    display: block;
    white-space: normal;
    width: 100%;
}


// Form layouts
// -------------------------------------------------------------------
.form--stacked {
    .input,
    .select,
    .radio,
    .checkbox,
    .textarea,
    .label {
        display: block;
        width: 100%;
    }
}

.form--inline {
    .form-control {
        display: inline-block;
        vertical-align: middle;
        width: auto; // Prevent labels from stacking above inputs
                     // in `.form-group`
    }

    .radio,
    .checkbox {
        display: inline-block;
        vertical-align: middle;
    }
}


// Select
// ----------------------------------------------------------------
.select {
    color: $text-color;
    display: block;
    position: relative;
}

.select select {
    background-color: $white;
    border: $border-width solid $border-color;
    border-radius: $border-radius;
    color: $text-color;
    cursor: pointer;
    display: inline-block;
    font-family: $sans-serif;
    line-height: $line-height--base;
    margin: 0;
    outline: 0;
    padding: $form-padding;
    width: 100%;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;

    >option {
        background-color: $white;
    }
}

// Dropdown arrow
.select:after {
    border-top: 5px solid;
    border-right: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 5px solid transparent;
    content: "";
    display: inline-block;
    height: 0;
    margin-top: -2px;
    pointer-events: none;
    position: absolute;
    right: 13px;
    top: 50%;
    width: 0;
}


// Placeholder styling
// -------------------------------------------------------------------
::-webkit-input-placeholder {
    color: $light-gray;
    -webkit-font-smoothing: antialiased;
}
::-moz-placeholder {
    color: $light-gray;
    -moz-osx-font-smoothing: grayscale;
}
:-ms-input-placeholder {
    color: $light-gray;
}
