/*************************************************
* ---- Forms ----
*/

@form-step-label: 20px;
@form-step-field: 8;

.w2ui-form {
    position: relative;
    color: @form-color;
    background-color: @form-background-color;
    border: @form-border;
    border-radius: @form-border-radius;
    padding: 0px;
    overflow: hidden !important;

    > div {
        position: absolute; 
        overflow: hidden;
    }

    .w2ui-form-header {
        position: absolute;
        left: 0;
        right: 0;
        border-bottom: @form-header-border-bottom !important;
        overflow: hidden;
        color: @form-header-color;
        font-size: 13px;
        text-align: center;
        padding: 8px;
        .linear-gradient-vertical(@form-header-linear-gradient-start, @form-header-linear-gradient-end);
        border-top-left-radius: 3px;
        border-top-right-radius: 3px;
    }

    .w2ui-form-toolbar {
        position: absolute;
        left: 0px; 
        right: 0px;
        margin: 0px;
        padding: 6px 3px;
        // background-color: @form-buttons-background-color;
        border-bottom: @form-buttons-border-top;
    }

    .w2ui-form-tabs {
        margin: 0px;
        padding: 0px;
    }

    .w2ui-tabs {
        position: absolute;
        left: 0;
        right: 0;
        border-top-left-radius: 3px;
        border-top-right-radius: 3px;
        padding-top: 5px !important;
        background-color: @form-tabs-background-color;

        .w2ui-tab.active {
            background-color: @form-background-color;
        }
    }

    .w2ui-page {
        position: absolute;
        left: 0;
        right: 0;
        overflow: auto;
        padding: 10px;
        border-left: @form-page-border;
        border-right: @form-page-border;
        background-color: @form-page-background-color;
        border-radius: 3px;
    }
    
    .w2ui-buttons {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        text-align: center;
        border-top: @form-buttons-border-top;
        border-bottom: @form-buttons-border-bottom;
        background-color: @form-buttons-background-color;
        padding: 15px 0px !important;
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
        
        input[type="button"], button {
            min-width: 80px;
            margin-right: 5px;
        }
    }

    input[type=checkbox], input[type=radio] {
        margin-top: 4px;
        margin-bottom: 4px;
    }

    input[type=checkbox].w2ui-toggle {
        margin: 0px;
    }
}

// ==================================================
// --- It is outside of the form on purpose

.w2ui-group-title {
    padding: 5px 2px;
    color: #8D96A2; 
    text-shadow: 1px 1px 2px rgb(253, 253, 253); 
    font-size: 120%;
}

.w2ui-group {
    background-color: @form-group-background-color;
    margin: 5px 0px 10px 0px;
    padding: 10px 5px;
    border-top: @form-group-border;
    border-bottom: @form-group-border;
}

.w2ui-field {
    > label {
        display: block;
        float: left;
        margin-top: 7px;
        margin-bottom: 3px;
        width: 120px;
        padding: 0px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: right;
        min-height: 20px;
        color: #666;
    }
    > div {
        /* do not include width */
        margin-bottom: 3px;
        margin-left: 128px;
        padding: 3px;
        min-height: 28px;
        float: none;
    }
    &.w2ui-required > div {
        position: relative;
    }

    &.w2ui-required > div::before {
        content: '*';
        position: absolute;
        margin-top: 5px;
        margin-left: -9px;
        color: @form-required-color;
    }
    &.w2ui-span0 {
        > label { display: none; }
        > div { margin-left: 0; }
    }
    &.w2ui-span1 { 
        > label { width: (@form-step-label * 1); }
        > div { margin-left: ((@form-step-label * 1) + @form-step-field); }
    }
    &.w2ui-span2 { 
        > label { width: (@form-step-label * 2); }
        > div { margin-left: ((@form-step-label * 2) + @form-step-field); }
    }
    &.w2ui-span3 { 
        > label { width: (@form-step-label * 3); }
        > div { margin-left: ((@form-step-label * 3) + @form-step-field); }
    }
    &.w2ui-span4 { 
        > label { width: (@form-step-label * 4); }
        > div { margin-left: ((@form-step-label * 4) + @form-step-field); }
    }
    &.w2ui-span5 { 
        > label { width: (@form-step-label * 5); }
        > div { margin-left: ((@form-step-label * 5) + @form-step-field); }
    }
    &.w2ui-span6 { 
        > label { width: (@form-step-label * 6); }
        > div { margin-left: ((@form-step-label * 6) + @form-step-field); }
    }
    &.w2ui-span7 { 
        > label { width: (@form-step-label * 7); }
        > div { margin-left: ((@form-step-label * 7) + @form-step-field); }
    }
    &.w2ui-span8 { 
        > label { width: (@form-step-label * 8); }
        > div { margin-left: ((@form-step-label * 8) + @form-step-field); }
    }
    &.w2ui-span9 { 
        > label { width: (@form-step-label * 9); }
        > div { margin-left: ((@form-step-label * 9) + @form-step-field); }
    }
    &.w2ui-span10 { 
        > label { width: (@form-step-label * 10); }
        > div { margin-left: ((@form-step-label * 10) + @form-step-field); }
    }
}

.w2ui-error {
    border: @form-error-border !important;
    background-color: @form-error-background-color !important;
}
