form legend {
    padding: 8px 0 8px 2px;
    color: #555;
}

form legend.required::after {
    content: ' *';
    color: red;
}

form input[type=text], /* will only select text fields */
form input[type=email], /* will only select email fields */
form input[type=password], /* will only select password fields */
form textarea,
form select {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;

    margin: 0;
    padding: 8px;
    line-height: 24px;

    border: 1px solid #CCC;
    border-radius: 0;
    background-color: #FFF;
    color: #000;

    box-sizing: border-box;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

form textarea {
    height: 60px;
    min-height: 60px;
    resize: vertical;
}

/* remove dropdown arrow on IE from select */
form select::-ms-expand { display: none; }

form 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 .w100 input,
form .w100 textarea,
form .w100 select,
form .w100 button,
form .w100 {
    width: 100%;
    box-sizing: border-box;
}

/*  Бутони */
form button[type=submit] {
    border: none;
    background-color: var(--green);
    color: #fff;

    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    line-height: 20px;
    text-decoration: none;
    padding: 10px 30px;
    display: inline-block;
    border-radius: 8px;
    cursor: pointer;
    box-sizing: border-box;

    transition: background-color 0.5s ease;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

form button[type=submit]:hover { background-color: var(--lblue); }

form button[type=submit]:disabled {
    background-color: #CCC;
    cursor: default;
}

/* Checkbox */
label.checkbox {
    line-height: 19px;
    /*white-space: nowrap;*/
    padding: 5px 20px 5px 30px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    vertical-align: bottom;
    display: inline-block;
}

label.checkbox input { display: none;}

label.checkbox span {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #FFF;
    border: 1px solid #CCC;
    /*border-radius: 3px;*/
    content: ' ';
    vertical-align: bottom;
    margin-right: 6px;
    margin-left: -30px;
}

label.checkbox:hover span { border-color: var(--green); }

label.checkbox input:checked + span {
    position: relative;
    background-color: var(--green);
    border-color: var(--green);
}

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);
}
/* <<< */

/* LOADER */
form.disabled { position: relative; }

/*form .mgLoader { display: none; } ???*/

form.disabled .mgLoader {
    position: absolute;
    inset: 0;
    background-color: #FFFFFF99; /* INFO: body background-color + alpha 99 */

    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    opacity: 0;
    transition: opacity 0.5s ease;
}

.mgLoader .circular {
    animation: loaderRotate 2s linear infinite;
    height: 48px;
    position: relative;
    width: 48px;
}

.mgLoader .path {
    stroke-dasharray: 1,200;
    stroke-dashoffset: 0;
    animation: loaderDash 1.5s ease-in-out infinite;
    stroke-linecap: round;
    stroke: var(--green);
}

@keyframes loaderRotate {
    100%{ transform: rotate(360deg); }
}

@keyframes loaderDash {
    0%{
        stroke-dasharray: 1,200;
        stroke-dashoffset: 0;
    }
    50%{
        stroke-dasharray: 89,200;
        stroke-dashoffset: -35;
    }
    100%{
        stroke-dasharray: 89,200;
        stroke-dashoffset: -124;
    }
}
/* <<<<<< */

/* formerror */
.mgErrorTooltip {
    position: absolute;
    max-width: 520px;
    padding: 7px 20px 7px 10px;
    text-align: left;
    border-radius: 4px;
    color: var(--white);
    background-color: var(--red);
    box-shadow: 1px 1px 3px 0 rgba(0, 0 ,0, 0.35);
    margin-top: 3px;
    z-index: 1;
}

/* INFO: top left arrow */
.mgErrorTooltip:after {
    height: 0;
    width: 0;
    bottom: 100%;
    left: 25px;
    border: solid transparent;
    content: " ";
    position: absolute;
    /* border-color: rgba(196, 0, 0, 0); ??? */
    border-bottom-color: var(--red);
    border-width: 7px;
    margin-left: -7px;
}
/* <<<<<< */

/*SUCCESS START*/
svg.success path:first-child {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: success-dash 5s linear forwards;
}

svg.success path:last-child {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: success-dash 5s linear forwards;
    animation-delay: .5s;
}

@keyframes success-dash {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}
/*SUCCESS END*/

/*FAIL START*/
svg.failed path:first-child {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: failed-dash 5s linear forwards;
}

svg.failed path:nth-child(2) {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: failed-dash 5s linear forwards;
    animation-delay: .4s;
}

svg.failed path:last-child {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: failed-dash 5s linear forwards;
    animation-delay: .6s;
}

@keyframes failed-dash {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}
/*FAIL END*/

form input.user,
form input.phone,
form input.email,
form textarea.comment {
    background-repeat: no-repeat;
    background-position: top 11px left 11px;
    background-size: 18px;
    padding-left: 40px;
}

form input.user { background-image:url(../svg/contacts/user.svg); }

form input.phone { background-image:url(../svg/contacts/phone.svg); }

form input.email { background-image:url(../svg/contacts/email.svg); }

form textarea.comment { background-image:url(../svg/contacts/comment.svg); }

a.icon {
    border: 1px solid var(--green);
    border-radius: 50%;
    display: inline-block;
    width: 40px;
    height: 40px;
    padding: 15px;
}