/**
 * This file provides the design styles for forms.
 *
 * @author Jana Deutschlaender <deutschlaender@cosmocode.de>
 */


/* for all of the form styles, style.ini colours are not used on purpose (except for fieldset border) */

form {
    display: inline;
    margin: 0;
    padding: 0;


    // multiline label
    fieldset > label.block > span:first-child {
        display: inline-block;

        @media @screen_min-lg {
            width: 48.8%;
        }

        @media @screen_max-lg {
            width: 48.5%;
        }
    }
}

fieldset {
    font-size: @font-size-default;
    line-height: 140%;
    border: 1px solid @ini_text_alt;
    padding: .7rem 1rem;

    > :last-child {
        margin-bottom: 0;
    }

    + p {
        padding-top: 1rem;
    }
}

legend {
    margin: 0;
    padding: 0 .1em;
}

label {
    vertical-align: baseline;
    cursor: pointer;
}

input,
textarea,
button,
select,
optgroup,
option,
keygen,
output,
meter,
progress {
    font: inherit;
    font-weight: normal;
    color: #333;
    background-color: #fff;
    line-height: normal;
    margin: 0;
    vertical-align: middle;
    box-sizing: border-box;
}

select {
    max-width: 100%;
}

textarea.edit {
    font-size: @font-size-default;
}

optgroup {
    font-style: italic;
    font-weight: bold;
}

option {
    font-style: normal;
    font-weight: normal;
}

input,
textarea,
select,
keygen {
    min-height: @formfield_min-height;
    border: 1px solid @ini_border;
    box-shadow: inset 0 0 1px #eee;
    border-radius: @fix_border-radius;
    padding-left: .3rem;
    padding-right: .3rem;
}

input[type="radio"],
input[type="checkbox"] {
    min-height: 1rem;
}

input[type="radio"],
input[type="checkbox"],
input[type="image"] {
    padding: 0;
    border-style: none;
    //box-shadow: none; :in ie picture and checkbox disappear
}


input:active,
input:focus,
textarea:active,
textarea:focus,
select:active,
select:focus,
keygen:active,
keygen:focus {
    border-color: #999;
}

input[type="file"] {
    padding-top: .1rem;
    padding-bottom: .1rem;
}


/* + + + + +  buttons  + + + + + */
button {
    background-color: #eee;
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc4MjQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0VFRUVFRSIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0NDQ0NDQyIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnODI0KSIgLz4KPC9zdmc+);
    background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
    border: 1px solid #ccc;
    border-radius: @fix_border-radius;
    color: #333;
    padding: .1em .5em;
    cursor: pointer;
    transition: @transition background-color, @transition color;

    &:hover,
    &:focus,
    &:active {
        background-color: #ddd;
        background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2NzAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0RERERERCIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0JCQkJCQiIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNjcwKSIgLz4KPC9zdmc+);
        background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
        border-color: #999;
    }
}


/* + + +  all types of submit-buttons  + + + */
form input[type=submit], // heredity 'adnewpage'
a.button,
input[type=submit],
input[type=reset],
button[type=submit],
.qq-upload-button {
    cursor: pointer;
    box-shadow: none;
    background-image: none;
    background-color: @ini_button_background;
    border: 1px solid @ini_button_background;
    border-radius: @fix_border-radius;
    color: @ini_button_color;
    vertical-align: top;
    padding: .3em @grid;
    transition: @transition background-color, @transition color;

    &:hover,
    &:active,
    &:focus {
        background-color: @ini_button_color;
        color: @ini_button_background;
    }
}

button[type='reset'] {
    min-height: @formfield_min-height;
    vertical-align: middle;
    padding: .3em 1rem;
}

input[type=submit],
button[type=submit] {
    min-height: @formfield_min-height;
    vertical-align: middle;

    &[disabled] {
        cursor: default;

        &:hover,
        &:active,
        &:focus {
            box-shadow: none;
            background-image: none;
            background-color: @ini_button_background;
            color: @ini_button_color;
            border-color: @ini_button_background;
        }
    }

    + span {
        display: block;
        margin-top: @grid;
    }
}


/* + + +  all types of buttons not being submit-buttons  + + + */
input.button,
input[type=button] {
    cursor: pointer;
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc4MjQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0VFRUVFRSIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0NDQ0NDQyIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnODI0KSIgLz4KPC9zdmc+);
    background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: @fix_border-radius;
    color: #333;
    padding: .1em .5em;
    transition: @transition background-color, @transition color;

    &:hover,
    &:active,
    &:focus {
        background-color: #ddd;
        border-color: #999;
        background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2NzAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0RERERERCIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0JCQkJCQiIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNjcwKSIgLz4KPC9zdmc+);
        background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
    }
}


/* + + +  all disabled buttons  + + + */
input[disabled],
button[disabled],
select[disabled],
textarea[disabled],
option[disabled],
input[readonly],
button[readonly],
select[readonly],
textarea[readonly] {
    cursor: auto;
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc4MjQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0VFRUVFRSIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0NDQ0NDQyIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnODI0KSIgLz4KPC9zdmc+);
    background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
    background-color: #eee;
    opacity: .5;
    border: 1px solid @ini_border;
    border-radius: @fix_border-radius;
    color: #333;
    font-weight: normal;
    padding: .3em @grid;
    transition: @transition background-color, @transition color;

    &:hover,
    &:active,
    &:focus {
        background-color: #ddd;
        background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2NzAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0RERERERCIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0JCQkJCQiIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNjcwKSIgLz4KPC9zdmc+);
        background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
        border-color: #999;
        color: #333;
    }
}

input::-moz-focus-inner,
button::-moz-focus-inner {
    border: 0;
    padding: 0;
}


/* + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* media queries - Styles for auth forms */

@media @screen_max-xs {
    .tpl_sprintdoc {
        #dw__login,
        #dw__register,
        #dw__resendpwd {
            fieldset {
                width: 100%;

                label.block {
                    text-align: left;

                    > span:first-child {
                        width: 100%;
                    }

                    input.edit {
                        width: 100%;
                        margin-top: .5rem;
                    }
                }
            }
        }

        #dw__login {
            label[for="remember__me"] {
                width: 100%;
                margin-left: 0;
            }
        }
    }
}
