form.admin {
    font-family: sans-serif;
    font-size: 14px;
}

form.admin h3 { /* INFO: form title */
    font-size: 20px;
    padding: 20px 30px;
    margin: 0 60px 0 0;
    font-weight: normal;
}

form.admin h4 { /* INFO: group title */
    font-size: 16px;
}

form.admin .group {
    padding: 10px 30px;
    margin: 20px 0 0 -20px;
    font-weight: normal;
    background-color: #EEE;
    max-width: calc(33.333% - 50px);
}

form.admin fieldset {
    border: 0 none;
    margin: 0;
    padding: 10px 20px 20px 20px;
    background-color: #F7F7F7;
}

form.admin fieldset .p {
    padding: 10px;
}

form.admin fieldset .nolegend {
    padding: 45px 10px 10px 10px;
}

form.admin fieldset .ib {
    display: inline-block;
    vertical-align: top;
    box-sizing: border-box;
}

form.admin fieldset div.f {
    display: flex;
    justify-content: space-between;
}

form.admin fieldset div.f > div.p {
    flex: 1;
}

form.admin fieldset .p:not(.ib) input,
form.admin fieldset .p:not(.ib) textarea,
form.admin fieldset .p:not(.ib) select {
    width: 100%;
}

form.admin fieldset + div {
    padding: 15px 30px;
}

form.admin fieldset + div.f { /* INFO: bottom buttons line */
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

form.admin {
    font-family: sans-serif;
    font-size: 14px;
    color: #000;
}

form.admin legend {
    padding: 8px 0 8px 2px;
    color: #555;
}

form.admin legend.required::after {
    content: ' *';
    color: #D70000;
}

form.admin input[type=text], /* will only select text fields */
form.admin input[type=email], /* will only select email fields */
form.admin input[type=password], /* will only select password fields */
form.admin textarea,
form.admin select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;

    margin: 0;
    padding: 4px 8px;
    line-height: 24px;

    border: 1px solid #CCC;
    border-radius: 0;
    background-color: #FFF;

    box-sizing: border-box;

    appearance: none;
}

form.admin textarea {
    height: 60px;
    min-height: 60px;
    resize: vertical;
}

/* remove dropdown arrow on IE from select */
form.admin select::-ms-expand { display: none; }

/* TODO: replace down.svg with ::after -> see label.checkbox */
/* INFO: https://stackoverflow.com/questions/3532649/problem-with-select-and-after-with-css-in-webkit; */
form.admin select {
    background-image: url(/svg/form/down.svg);
    background-size: 28px 28px;
    background-repeat: no-repeat;
    background-position: right center;
    padding: 4px 30px 4px 6px;
}
/* <-- */

form.admin input[type=text]:focus, /* will only select text fields */
form.admin input[type=email]:focus, /* will only select text fields */
form.admin input[type=password]:focus, /* will only select password fields */
form.admin textarea:focus,
form.admin select:focus {
    border: 1px solid #1cc664;
    box-shadow: 0px 0px 3px 0 rgba(0,0,0,.1);
}

form.admin input:disabled,
form.admin textarea:disabled,
form.admin select:disabled {
    background-color: #EEE;
    color: #999;
}

/* Checkbox */
form.admin label.checkbox {
    line-height: 19px;
    padding: 5px 20px 5px 30px;
    vertical-align: bottom;
    display: inline-block;

    user-select: none;
}

form.admin label.checkbox input { display: none;}

form.admin label.checkbox span {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #FFF;
    border: 1px solid #CCC;
    content: ' ';
    vertical-align: bottom;
    margin-right: 6px;
    margin-left: -30px;
}

form.admin label.checkbox:hover span { border-color: #1CC664;}

form.admin label.checkbox input:checked + span {
    position: relative;
    background-color: #1CC664;
    border-color: #1CC664;
}

form.admin label.checkbox input:checked + span::before {
    position: absolute;
    display: block;
    content: ' ';
    border-bottom: 2px solid #FFF;
    border-right: 2px solid #FFF;
    width: 4px;
    height: 8px;
    top: 3px;
    left: 6px;
    transform: rotate(45deg);
}
/* <<< */

form.admin button[type=submit],
form.admin a.button,
form.admin a.xClose {
    font-family: sans-serif;
    font-size: 14px;
    line-height: 24px;
    padding: 5px 20px;
    height: 36px;
    text-transform: uppercase;

    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    box-sizing: border-box;
}

form.admin button[type=submit] {
    border: 1px solid #1CC664;
    background-color: #1CC664;
    color: #fff;

    transition: background-color .5s, border .5s;
}

form.admin button[type=submit]:hover{
    background-color: #000;
    border-color: #000;
}

form.admin a.button.border {
    background-color: #FFF;
    border: 2px solid #1CC664;
    border-radius: 4px;
    color: #000;
    padding: 0 20px;
    line-height: 32px;

    transition: color .5s;
}

form.admin a.button.border:hover {
    color: #1CC664;
}

form.admin a.xClose {
    color: #999;
    border: 1px solid transparent;
}

form.admin a.xClose:hover {
    background-color: #EEE;
    color: #000;
    border-radius: 3px;
    border: 1px solid #E1E1E1;
}

/* mgBlocks */
form.admin .xBlock,
form.admin #xBlocks {
    display: inline-block;
    vertical-align: top;
    margin-left: 20px;
} /* <<< TODO: remove */

form.admin .xBlocks > div:last-child {
    display: inline-block;
    vertical-align: top;
    padding: 2px;
    margin-left: 5px;
    max-width: 75%;
}

form.admin .xBlocks > div:last-child .xSpace {
    vertical-align: top;
    display: inline-block;
    margin: 3px;
}

form.admin .xBlock .xItem,
form.admin .xBlocks > div:last-child .xItem {
    vertical-align: top;
    padding: 5px 32px 5px 8px;
    margin: 2px 4px 2px 0;
    display: inline-block;
    color: #212121;
    text-decoration: none;
    background-color: #FFF;
    border: 1px solid #DADADA;
    border-radius: 2px;
    position: relative;

    user-select: none;
}

form.admin .xItem del,
form.admin .xItem .xRemove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

form.admin .xItem del::before,
form.admin .xItem .xRemove::before,
form.admin .xItem del::after,
form.admin .xItem .xRemove::after {
    content: '';
    border-top: 1px solid #8e8e8e;
    width: 50%;
    display: block;
    position: absolute;
}

/* INFO: for gallery */
form.admin .xUploaded .xItem del::before,
form.admin .xUploaded .xItem del::after {
    top: 17px;
    left: 8px;
}

/* INFO: for gallery */
form.admin .xBlocks .xItem del::before,
form.admin .xBlocks .xItem del::after {
    top: 11px;
    left: 6px;
}

form.admin .xItem del::before,
form.admin .xItem .xRemove::before {
    transform: rotate(45deg);
}

form.admin .xItem del::after,
form.admin .xItem .xRemove::after {
    transform: rotate(-45deg);
}

form.admin .xItem del:hover::before,
form.admin .xItem .xRemove:hover::before,
form.admin .xItem del:hover::after,
form.admin .xItem .xRemove:hover::after {
    border-color: #000;
}

/*
form.admin #xBlocks .xItem .xRemove hr {
    border: none;
    width: 14px;
    height: 1px;
    background-color: #8e8e8e;
    position: absolute;
    top: 3px;
    left: 5px;
}

form.admin #xBlocks .xItem .xRemove hr:first-child {
    transform: rotate(45deg);
}

form.admin #xBlocks .xItem .xRemove hr:last-child {
    transform: rotate(-45deg);
}

form.admin #xBlocks .xItem .xRemove:hover hr {
    background-color: #000;
}
*/
form.admin .xBlocks button.add {
    text-transform: uppercase;
    font-family: sans-serif;
    font-size: 20px;
    line-height: 26px;
    text-decoration: none;
    padding: 4px 20px;
    display: inline-block;

    color: #fff;
    background-color: #1CC664;
    /*border-radius: 5px;*/
    border: none;
    cursor: pointer;

    vertical-align: middle;
    transition: background-color 0.5s ease, border 0.5s ease;

    appearance: none;
}

form.admin .xBlocks button.add:hover { background-color: #000; }
/* *** */

form.admin .xIcons img {
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px 5px 0;
    padding: 10px;
}

/* ???
form.admin .xIcons img.current {
    border-color: #999;
    background-color: #FFF;
}
*/

form.admin .xIcons label > input { display: none; }

form.admin .xIcons label > input:checked + img {
    border: 1px solid #999;
    background-color: #FFF;
}

form.admin .xIcons label > input:not(:checked) + img {
    background-color: #F0F0F0;
    border: 1px solid #CCC;
    opacity: .5;
}

/* range */
form.admin .xRange {
    display: inline-block;
    position: relative;
}

form.admin .xRange::after {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 1px;
    content: attr(data-num);
    font-size: 12px;
    background-color: #FFF;
    line-height: 21px;
    padding: 0px 7px;
    max-height: 30px;
}

form.admin .xRange:not(.ok)::after { color: #EB8080; }

form.admin .xRange.ok::after { color: #1CC664; }
/* <-- */

/* mobile & tablet */
@media (max-width: 799.999px) {
    form.admin { width: 100vw; }
}

@media (min-width: 800px) and (max-width: 1279.999px) {
    /* INFO: .xPopup > div { margin: 40px; } */
    form.admin { width: calc(100vw - 80px); }
}

/* desktop */
@media (min-width: 1280px) {
    form.admin { width: 1200px; }
}

form.admin .currency
{
    position: relative;
}

form.admin .currency input
{
    padding-left: 25px;
}

form.admin .currency::before
{
    position: absolute;
    top: 8px;
    left: 10px;
    color: #999;
}

form.admin .currency.euro::before
{
    content: '€';
}
