/* TODO: clean the style */
form {
    margin-bottom: 15px;
}

/* Flexbox */
form .flex-element {
    justify-content: space-between;
    align-content: flex-start;
    margin-bottom: 50px;
}

form .flex-element.general-error {
    margin-bottom: 5px;
}

form .flex-element-item-one-col {
    flex-basis: 100%;
}

form .flex-element-item-two-col {
    flex-basis: 45%;
}

form .flex-element-item-long {
    flex-basis: 35%;
}

form .flex-element-item-short {
    flex-basis: 10%;
}

label {
    display: block;
    width: 100%;
    margin: 5px;
    text-align: left;
    color: var(--label-color-text);
    font-weight: bold;
}

input, select, textarea {
    width: 50%;
    min-height: 40px;
    margin: 5px;
    padding: 5px;
    border: 1px solid var(--input-color-border);
    border-radius: var(--main-element-radius);
    background-color: var(--input-color-background);
    color: var(--input-color-text);
    font-size: 25px;
}

/* style des select2, pour changer les couleurs et la font */
span.select2-container span.select2-selection {
    border: none;
    background: none;
    outline: none;
}
span.select2-container span.select2-selection__rendered,
span.select2-container span.select2-dropdown,
span.select2-container span.select2-search input.select2-search__field,
span.select2-container span.select2-selection--multiple,
span.select2-container.select2-container--focus span.select2-selection--multiple
{
    border: 1px solid var(--input-color-border);
    border-radius: var(--main-element-radius);
    padding: 5px;
}
span.select2-container span.select2-search input.select2-search__field
{
    margin: 0;
    outline: none;
}
span.select2-container span.select2-dropdown {
    margin-top: 15px;
}
span.select2-container span.select2-selection--multiple li.select2-selection__choice
{
    background: none;
    border: 1px solid var(--input-color-border);
    border-radius: var(--main-element-radius);
    margin: 0;
}

span.select2-container span.select2-selection span.select2-selection__rendered,
span.select2-container span.select2-dropdown,
span.select2-container li.select2-results__option--selected
{
    background: var(--body-background-color);
    color: var(--input-color-text);
    font-size: 25px;
}
article form div ul.select2-selection__rendered {
    border: unset;
    background: unset;
}

form .flex-element input, form .flex-element select, .flex-element textarea {
    width: 100%;
}

input::placeholder {
    color: var(--input-placeholder-color-text);
}

input[type="checkbox"] {
    width: 30px;
}

/* classes are deleted by the files bundle on file inputs, so we apply a style for them */
input[type="file"] {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

select {
    background: transparent;
}

select[multiple="multiple"] {
    min-height: 125px;
    padding: 5px;
    font-size: 1em;
}

select:not([multiple="multiple"]) option {
    color: var(--select-option-color-text);
}

/* errors */
article form div ul {
    display: block;
    width: 100%;
    padding: 0px;
    border: 1px solid var(--list-error-color-border);
    border-radius: 5px;
    list-style-type: none;
}

article form div ul li {
    width: 100%;
}

div.flash {
    display: block;
    width: 100%;
    padding: 0px;
    border: 1px solid var(--list-notice-color-border);
    border-radius: 5px;
    background-color: var(--list-notice-color-background);
    font-size: 20px;
}
div.flash--error {
    color: var(--list-error-color-text);
    background-color: var(--list-error-color-background);
}
div.flash--success {
    color: var(--list-success-color-text);
    background-color: var(--list-success-color-background);
}
div.flash--warning {
    color: var(--list-notice-color-text);
    background-color: var(--list-notice-color-background);
}

/* date picker icon
   apply a color doesn't work, so we invert it to have white */
::-webkit-calendar-picker-indicator {
    filter: invert(100%);
    cursor: pointer;
}

/* without margin, the label is written on the field for CKEditorType */
.cke {
    /* apply a color doesn't work, so we invert the element */
    filter: invert(70%);
    margin-top: 5px !important;
    border: 1px solid var(--editor-color-border-reversed) !important;
}

.help-text, .info-text {
    font-size: 0.8em;
}

/* add an asterisk to the required fields */
label.required::after {
    content: " *";
}
