/* Form */

li > form {
    display: block;
}

form > div:not(.clear):not(.control) {
    min-height: 9rem;
    position: relative;
    box-sizing: border-box;
}

form > div.compact:not(.clear):not(.control) {
    min-height: 0;
}

li > form > div:not(.control) { /* If we put the form in a list */
    min-height: 0;
    padding-top: 0rem;
    top: -1.5rem;
}

form > div > label {
    position: absolute;
    top: 2rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    left: 0; /* We force the left align */
}


*[dir="rtl"] form > div > label {
    right: 0;
}

form > div.icon {
    padding-left: 9rem;
}

form > div > textarea,
#hiddendiv {
    border: none;
    resize: none;
    font-family: sans-serif;
    line-height: 3rem;
    box-sizing: border-box;
}

form > div > .select:after {
    font-family: "Material-Design-Iconic-Font";
    content: "\f2f2";
    display: block;
    font-size: 4rem;
    color: #999;
    position: absolute;
    right: 1.25rem;
    bottom: 0.25rem;
    pointer-events: none;
}

*[dir="rtl"] form > div > .select::after {
    left: 1.25rem;
    right: auto;
}

form > div > .select:hover:after {
    color: #555;
}

form > div > .select select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background-color: transparent;
    background-image: none;
    padding: 0.75rem 0;
}

main > header form > div:not(.clear):not(.control) {
    min-height: 0;
}

main > header li > form > div:not(.clear):not(.control) {
    top: 1rem;
}

main > header form > div:not(.clear):not(.control) > input,
main > header form > div:not(.clear):not(.control) > .select {
    padding-top: 0;
}

main > header form > div:not(.clear):not(.control) > .select option {
    background-color: white;
    color: initial;
}

main > header form > div:not(.clear):not(.control) > input,
main > header form > div:not(.clear):not(.control) > .select:after,
main > header form > div:not(.clear):not(.control) > .select select {
    color: white;
}

/* Placeholders to mimic FF */

::-webkit-input-placeholder, /* WebKit browsers */
:-ms-input-placeholder { /* Internet Explorer 10+ */
    color: #fff;
    opacity: 0.5;
}

/* Webkit weird CSS, sic */

form > div > .select select,
form > div > input:not([type=submit]),
form > div > textarea {
    outline-width: 0;
}

form > div > .select,
form > div > input:not([type=submit]),
form > div > textarea {
    display: block;
    padding: 1rem 0;
    padding-top: 4.5rem;
    width: 100%;
    background-color: transparent;
    margin-bottom: 1rem;

    -webkit-appearance: none; /* iOS */
    border-radius: 0; /* iOS */
    overflow: hidden; /* Fixme */
    box-shadow:0px 1px 0px rgba(0, 0, 0, 0.12);
}

form > div > .select {
    position: relative;
    padding-top: 4rem;
    padding-bottom: 0;
}

form > div.compact > .select,
form > div.compact > input:not([type=submit]),
form > div.compact > textarea {
    padding-top: 2.5rem;
}

/* Webkit hack */
form > div > input:not([type=submit]):-webkit-autofill {
    -webkit-box-shadow: 0 0 0 50px white inset;
}
form > div > input:not([type=submit]):-webkit-autofill:focus {
    box-shadow: 0;
    -webkit-text-fill-color: #333;
}

/* Checkbox element */

form > div .checkbox > input[type="checkbox"],
form > div .radio > input[type="radio"] {
    display: none;
}

form > div .checkbox {
    position: relative;
    width: 4.5rem;
    height: 5rem;
    top: 1rem;
    direction: ltr;
}

form > div .checkbox:before,
form > div .checkbox:after {
    content: '';
    display: block;
    position: absolute;
    height: 2.25rem;
    width: 2.25rem;
}

form > div .checkbox:before {
    border-radius: 2rem 0 0 2rem;
}

form > div .checkbox:after {
    border-radius: 0 2rem 2rem 0;
    background-color: rgba(0, 0, 0, 0.25);
    right: 0;
    top: 0;
}

form > div .checkbox > input[type="checkbox"] + label {
    z-index: 1;
    display: block;
    background-color: #FAFAFA;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.5);
    width: 3rem;
    height: 3rem;
    border-radius: 2rem;
    top: -0.5rem;
    left: -0.2rem;
    position: relative;
    font-size: 2rem;
    text-align: center;

    transition: left 0.3s ease, box-shadow 0.1s ease;
}

form > div .checkbox > input[type="checkbox"] + label:hover,
form > div .checkbox > input[type="checkbox"]:checked + label:hover {
    cursor: pointer;
    box-shadow: 0  0 0 1.75rem rgba(0, 0, 0, 0.05), 0 0.2rem 0.5rem rgba(0, 0, 0, 0.5);
}

form > div .checkbox > input[type="checkbox"]:checked + label {
    background-color: #009587;
    left: 0.8em;
}

/* Radio */

form > div .radio > input[type="radio"] + label {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border-radius: 2rem;
    border-width: 2px;
    border-style: solid;
    border-color: gray;
    transition: box-shadow 0.1s ease;
    margin: 1.25rem;
    margin-bottom: 0;
}

form > div .radio > input[type="radio"] + label:hover {
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0  0 0 1.5rem rgba(0, 0, 0, 0.1);
}

form > div .radio > input[type="radio"]:checked + label {
    background-color: blue;
    background-color: #009688;
    border-color: #009688;
    box-shadow: inset 0 0 0 0.4rem white;

}

form > div .radio > input[type="radio"]:checked + label:hover {
    box-shadow: inset 0 0 0rem 0.4rem white, 0 0 0 1.5rem rgba(0, 0, 0, 0.1);
}

/* Disabled */

form > div > input:disabled,
form > div > input:disabled + label {
    opacity: 0.5;
}

/* Button */

.button.oppose {
    float: right;
}

.button:disabled,
.button.inactive {
    opacity: 0.5;
    pointer-events:none;
}

.button,
input[type=button] {
    -webkit-appearance:none; /* iOS */
    min-width: 5rem; /* 8rem ? */
    text-align: center;
    display: inline-block;
    box-sizing: border-box;
    text-transform: uppercase;
    font-size: 2rem;
    font-weight: 700;
    line-height: 4.5rem;
    height: 4.5rem;
    margin: 0.75rem 0.5rem;

    border-radius: 0.25rem;
    padding: 0 1rem;

    border: 0;

    transition: background 0.3s ease, box-shadow 0.3s ease;

    box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.5);

    background-image: none;
}

.button:not(.color),
input[type=button]:not(.color) {
    background-color: white;
}

.button:active {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.23), 0 0.5rem 1.25rem rgba(0, 0, 0, 0.16);
}

.button.flat,
input[type=button].flat {
    box-shadow: none;
    background-color: transparent;
    border: 0;
}

.button:hover,
input[type=button]:hover {
    cursor: pointer;
}

.button.flat:hover,
.button.flat.on,
input[type=button].flat:hover {
    background-color: rgba(153, 153, 153, 0.2);
}

.button:focus,
input[type=button]:focus {
    border: 0;
}

.button.flat:focus,
input[type=button].flat:focus {
    background-color: rgba(153, 153, 153, 0.4);
}

.button.action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    min-height: 0rem;
    min-width: 0rem;
    line-height: 7rem;
    height: 7rem;
    width: 7rem;
    z-index: 1;
    font-size: 3.5rem;
}

.button.action,
.button.action .actions li {
    border-radius: 10rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.23), 0 0.5rem 1.25rem rgba(0, 0, 0, 0.16);
}

.button.action:hover {
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%);
}

.button.action,
.button.action .actions li,
.button.action > i {
    transition: all 0.15s ease 0s;
}

.button.action.active > i {
    transform: rotate(45deg);
}

li.action div.action .button {
    margin: 0.5rem;
    display: block;
}

header.big ~ .button.action {
    bottom: auto;
    position: relative;
    float: right;
    top: -6rem;
}

@media screen and (min-width: 1025px) {
    main > section > div:first-child:nth-last-child(2) .button.action {
        right: calc(70% + 3rem);
    }

    aside ~ * .button.action {
        right: calc(50% - 18rem);
    }
}

.button.action .actions {
    position: absolute;
    bottom: 7rem;
    left: 0;
    padding: 0;
    pointer-events: none;
}

.button.action .actions li {
    background-color: white;
    color: #888;
    font-size: 3rem;
    line-height: 6rem;
    margin: 2rem 0.5rem;
    width: 6rem;
    height: 6rem;
    padding: 0;
    opacity: 0;
    transition: all 0.3s ease 0.15s;
    pointer-events: none;
}

.button.action.active .actions {
    pointer-events: auto;
}

.button.action.active .actions li {
    opacity: 1;
    pointer-events: auto;
}

.button.action .actions li:hover {
    background-color: white;
}

.button.activity {
    display: inline-block;
    margin: 0;
    font-size: 3rem;
    line-height: 7rem;
    height: auto;
    width: 7rem;
}

.button i {
    margin: 0 0.5rem;
}

.button.icon i {
    position: relative;
    font-size: 2.8rem;
    top: 0.3rem;
}

/* The textarea hidden div */
#hiddendiv {
    position: fixed;
    display: block;
    z-index: -1;
    opacity: 0;
    height: auto;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */
}

