/*
    This stylesheet provides a common way to stylize the form in TEDB.

    ### General comments
        - Support of sumoSelect
        - Support TEDB selectize


    ### input, textarea, select
        The css class .form-item can be used to stylize.

        <input ... class="form-item date" />

    ### input with addon
        The css classes .form-item-group and.form-item can be used together to add a addon on an input field.

        <div class="form-item-group">
            <input class="form-item">
            <label>%</label>
        </div>

    ### Check boxes
        The css class .form-item-checkbox, .checkmark and .mark can be used together to stylize the check boxes.

        <label for="MyCheckBox" class="form-item-checkbox">
            My label
            <input type="checkbox" name="MyCheckBox" id="MyCheckBox">
            <span class="checkmark"><span class="mark"></span></span>
        </label>

    ### Radio buttons
        The css class .form-item-radio, .checkmark and .mark can be used together to stylize the radio buttons.

        <label for="MyRadioButton" class="form-item-radio">
            My Label
            <input type="radio" name="MyRadioButton" id="MyRadioButton">
            <span class="checkmark"><span class="mark"></span></span>
        </label>

    ### Ratio
        The css class .form-item-ratio, .form-item-ratio-numerator, .form-item-ratio-separator and .form-item-ratio-denominator
        can be used to display a ratio form item.

        <div class="form-item-ratio">
            <div class="form-item-ratio-numerator">
                <input type="text">
            </div>
            <div class="form-item-ratio-separator">:</div>
            <div class="form-item-ratio-denominator">
                <input type="text">
            </div>
        </div>

 */
.SumoSelect .SelectBox,
.form-item {
    display: block;
    width: 100%;
    min-height: 19px;
    padding: 6px 12px;
    line-height: 1.5;
    background-color: #fff;
    background-image: none;
    border: 1px solid #bbbbbb;
    border-radius: 4px;
    margin: 0 0 8px;
    min-width: 50px;
}
.SumoSelect .SelectBox,
.form-item,
.selectize-input.form-item input[tyep="text"]{
    font-size: 14px !important;
    font-family: Verdana, Arial, Helvetica, "DejaVu Sans", sans-serif;
}

    /* Adaptation for sumo select */
.SumoSelect {
    width: 100%;
}

.SumoSelect .SelectBox {
    width: calc(100% - 26px);
}

.SumoSelect .SelectBox .search-txt {
    width: 100%;
    min-height: 19px;
    padding: 6px 12px;
    font-size: 14px !important;
    line-height: 1.5;
    font-family: Verdana, Arial, Helvetica, "DejaVu Sans", sans-serif;
    margin: 0;
}

.SumoSelect > .CaptionCont > span {
    position: absolute;
    width: calc(100% - 35px);
}

.form-item:required {
    box-shadow: none;
}

.form-item:disabled, .form-item.disabled {
    background: #dddddd !important;
    color: #888 !important;
    cursor: default;
}

input.form-item,
textarea.form-item {
    width: calc(100% - 26px) !important;
}

textarea.form-item {
    overflow: hidden;
    resize: none;
}

select.form-item {
    padding: 7px 12px;
}

.form-item-group {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex !important;
    margin: 0 0 8px 0;
}

.inlineField .form-item-group {
    max-width: 150px !important;
}

.form-item-group > .form-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    float: left;
    margin: 0;
    width: 100% !important;
}

.form-item-group > *:not(.form-item) {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: normal;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee !important;
    border: 1px solid #bbbbbb;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    border-radius: 0 4px 4px 0;
    margin: 0 0 0 -3px;
    -ms-flex-negative: 0;
}

.inlineField .form-item-group > .form-item {
    font-size: 13px;
    min-height: 0;
    padding: 3px 6px;
}

.inlineField .form-item-group > *:not(.form-item) {
    font-size: 13px;
    font-weight: normal;
    padding: 3px 6px;
}


.form-item-group img {
    max-width: 15px;
    max-height: 15px;
}

.form-item.disabled {
    background: #ddd;
}


.form-item-checkbox,
.form-item-radio {
    display: inline-block;
    position: relative;
    padding-left: 22px;
    margin: 6px 0;
    padding-right: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    align-items: center;
}

.form-item-checkbox input,
.form-item-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.form-item-checkbox .checkmark,
.form-item-radio .checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    height: 14px;
    width: 14px;
    border: 1px #bbbbbb solid;
    margin-top: -9px;
}

.form-item-radio .checkmark {
    border-radius: 50%;
}

.form-item-checkbox:hover input ~ .checkmark,
.form-item-radio:hover input ~ .checkmark {
    background-color: #bbbbbb;
}

.form-item-checkbox input:checked ~ .checkmark {
    background: transparent;
}

.form-item-checkbox .checkmark .mark,
.form-item-radio .checkmark .mark {
    position: absolute;
    display: block;
    background: #ffffff;
}

.form-item-checkbox input:checked ~ .checkmark,
.form-item-radio input:checked ~ .checkmark .mark {
    background: #06498b;
}

.form-item-checkbox input:disabled ~ .checkmark,
.form-item-checkbox input.disabled ~ .checkmark,
.form-item-radio input:disabled ~ .checkmark,
.form-item-radio input.disabled ~ .checkmark {
    background: #dddddd;
}

.form-item-checkbox input:disabled ~ .checkmark .mark,
.form-item-checkbox input.disabled ~ .checkmark .mark,
.form-item-radio input:disabled ~ .checkmark .mark,
.form-item-radio input.disabled ~ .checkmark .mark {
    display: none;
}


.form-item-radio input:disabled:checked ~ .checkmark .mark,
.form-item-radio input.disabled:checked ~ .checkmark .mark {
    display: block;
    background: #666666
}

.form-item-checkbox input:disabled:checked ~ .checkmark .mark,
.form-item-checkbox input.disabled:checked ~ .checkmark .mark {
    display: block;
    border: solid #666666;
    border-width: 0 3px 3px 0;
}


.form-item-radio .checkmark .mark {
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.form-item-checkbox .checkmark .mark {
    top: 1px;
    left: 4px;
    width: 3px;
    height: 6px;
    border: solid white;
    border-width: 0 3px 3px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    background: transparent;
}

.form-item-ratio {
    display: flex;
}

.form-item-ratio div.form-item-ratio-numerator,
.form-item-ratio div.form-item-ratio-denominator {
    width: 100%;
}

.form-item-ratio div.form-item-ratio-separator {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee !important;
    border: 1px solid #bbbbbb;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin: 0 -3px 8px;
    -ms-flex-negative: 0;
}