/* RESET RULES
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
    --white: #525252;
    --red: hsl(315, 66%, 80%);
    --bodyColor: #fff;
    --borderFormEls: hsl(315, 66%, 80%);
    --bgFormEls: hsl(0, 0%, 98%);
    --bgFormElsFocus: hsl(315, 66%, 97%);
}

.my-form-container * {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    outline: none;
}

.my-form-container a {
    color: inherit;
}

.my-form-container input,
.my-form-container select,
.my-form-container textarea,
.my-form-container button {
    font-family: inherit;
    font-size: 100%;
}

.my-form-container button,
.my-form-container label {
    cursor: pointer;
}

.my-form-container select {
    appearance: none;
}

/* Remove native arrow on IE */
.my-form-container select::-ms-expand {
    display: none;
}

/*Remove dotted outline from selected option on Firefox*/
/*https://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002*/
/*We use !important to override the color set for the select on line 99*/
.my-form-container select:-moz-focusring {
    color: transparent !important;
    text-shadow: 0 0 0 var(--white);
}

.my-form-container textarea {
    resize: none;
}

.my-form-container ul {
    list-style: none;
}

.my-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0px 10px 20px 2px var(--borderFormEls);
}

/* FORM ELEMENTS
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.my-form h1,
.my-form h4 {
    margin-bottom: 1.5rem;
}

.my-form li,
.my-form .grid > *:not(:last-child) {
    margin-bottom: 1.5rem;
}

.my-form select,
.my-form input,
.my-form textarea,
.my-form button {
    width: 100%;
    line-height: 1.5;
    padding: 15px 10px;
    border: 1px solid var(--borderFormEls);
    color: var(--white);
    background: var(--bgFormEls);
    transition: background-color 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25),
    transform 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25);
}

.my-form textarea {
    height: 170px;
}

.my-form ::placeholder {
    color: inherit;
    /*Fix opacity issue on Firefox*/
    opacity: 1;
}

.my-form select:focus,
.my-form input:focus,
.my-form textarea:focus,
.my-form button:enabled:hover,
.my-form button:focus,
.my-form input[type="checkbox"]:focus + label {
    background: var(--bgFormElsFocus);
}

.my-form select:focus,
.my-form input:focus,
.my-form textarea:focus {
    transform: scale(1.02);
}

.my-form *:required,
.my-form select {
    background-repeat: no-repeat;
    background-position: center right 12px;
    background-size: 15px 15px;
}

.my-form *:required {
    background-image: url("../images/ContactForm/asterisk.svg");
}

.my-form select {
    background-image: url("../images/ContactForm/down.svg");
}

.my-form *:disabled {
    cursor: default;
    filter: blur(2px);
}

/* FORM BTNS
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.my-form .required-msg {
    display: none;
    background: url("../images/ContactForm/asterisk.svg")
    no-repeat center left / 15px 15px;
    padding-left: 20px;
}

.my-form .btn-grid {
    position: relative;
    overflow: hidden;
    transition: filter 0.2s;
}

.my-form button {
    font-weight: bold;
}

.my-form button > * {
    display: inline-block;
    width: 100%;
    transition: transform 0.4s ease-in-out;
}

.my-form button .back {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-110%, -50%);
}

.my-form button:enabled:hover .back,
.my-form button:focus .back {
    transform: translate(-50%, -50%);
}

.my-form button:enabled:hover .front,
.my-form button:focus .front {
    transform: translateX(110%);
}


/* CUSTOM CHECKBOX
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.my-form input[type="checkbox"] {
    position: absolute;
    left: -9999px;
}

.my-form input[type="checkbox"] + label {
    position: relative;
    display: inline-block;
    padding-left: 2rem;
    transition: background 0.3s cubic-bezier(0.57, 0.21, 0.69, 1.25);
}

.my-form input[type="checkbox"] + label::before,
.my-form input[type="checkbox"] + label::after {
    content: '';
    position: absolute;
}

.my-form input[type="checkbox"] + label::before {
    left: 0;
    top: 7px;
    width: 18px;
    height: 18px;
    border: 1px solid var(--borderFormEls);
}

.my-form input[type="checkbox"]:checked + label::before {
    background: var(--bgFormElsFocus);
}

.my-form input[type="checkbox"]:checked + label::after {
    left: 7px;
    top: 2px;
    width: 5px;
    height: 12px;
    border-bottom: 2px solid var(--white);
    border-right: 2px solid var(--white);
    transform: rotate(45deg);
}

/* MQ
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media screen and (min-width: 600px) {
    .my-form .grid {
        display: grid;
        grid-gap: 1.5rem;
    }

    .my-form .grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .my-form .grid-3 {
        grid-template-columns: auto auto auto;
        align-items: center;
    }

    .my-form .grid > *:not(:last-child) {
        margin-bottom: 0;
    }

    .my-form .required-msg {
        display: block;
    }
}

@media screen and (min-width: 541px) {
    .my-form input[type="checkbox"] + label::before {
        top: 50%;
        transform: translateY(-50%);
    }

    .my-form input[type="checkbox"]:checked + label::after {
        top: 3px;
    }
}