///////////////////////////////////////////////////////////////
// Device: Desktop
///////////////////////////////////////////////////////////////

.newsletter {
    margin: 40px 0;
}

.newsletter-title {
    margin-bottom: 10px;
    text-align: center;
    font-family: "lucien-light";
    font-size: 2.2rem;
}

.newsletter-subtitle {
    margin-bottom: 70px;
    text-align: center;
    font-size: 1.1rem;
}

.newsletter-container {
    @include outer-container;
}

.newsletter-content {
    @include span-columns(10);
    @include shift(1);
}

.newsletter-form {
    @include span-columns(5 of 10);

    .form-group {
        margin-bottom: 25px;

        &:nth-of-type(2) {
            float: left;
            width: 46%;
        }
        &:nth-of-type(3) {
            margin-left: 50%;
            width: 50%;
        }
        &[data-id="submit"] {
            @include span-columns(2 of 5);
        }
    }
}

/* confirmation */
.newsletter-confirmation {
    @include span-columns(5 of 10);
    display: none;
    margin-top: 15%;
    .newsletter-confirmation-wrapper {
        border: 1px solid $color-golden;
        padding: 40px;
    }
    p {
        text-align: center;
        font-family: "lucien-regular";
        font-size: 1.2rem;
        display: block;
        width: 80%;
        margin: 0 auto;
    }
}

.newsletter-form-birthdate {
    display: flex;
    justify-content: space-between;

    .form-group {
        flex-basis: 0;
        margin-bottom: 0;

        &:nth-child(1) {
            flex-grow: 1;
        }
        &:nth-child(2) {
            flex-grow: 2;
            margin-left: 4%;
        }
        &:nth-child(3) {
            flex-grow: 1;
            margin-left: 4%;
        }
    }
}

.newsletter-form-preferences {
    display: block;
}

.newsletter-form-preferences-title {
    font-family: lucien-light, sans-serif;
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 0;
}

.newsletter-form-preferences-checkboxes {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.newsletter-form-preferences-checkbox {
    &:not(:first-child) {
        margin-left: 2%;
    }
}

.newsletter-form-preferences-checkbox-input {
    display: none;
}

.newsletter-form-preferences-checkbox-input:checked {
    & + .newsletter-form-preferences-checkbox-ui {
        background: $color-grey-border-light;

        .newsletter-form-preferences-checkbox-ui-icon {
            transform: translateY(-50%) rotateX(180deg);
        }
        .newsletter-form-preferences-checkbox-ui-icon-check {
            opacity: 1;
            transform: rotateX(-180deg) scale(0.7);
        }
    }
}

.newsletter-form-preferences-checkbox-ui {
    background: $color-grey-lighter;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
}

.newsletter-form-preferences-checkbox-ui:hover {
    background: $color-grey-border-light;
}

.newsletter-form-preferences-checkbox-ui-icon {
    height: 16px;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    width: 16px;
    pointer-events: none;
}

.newsletter-form-preferences-checkbox-ui-icon-shape {
    display: block;
    fill: #FFFFFF;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    transform: rotate(90deg);
    width: 100%;
}

.newsletter-form-preferences-checkbox-ui-icon-check {
    display: block;
    fill: $color-grey-border-light;
    height: 100%;
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    transform: rotateX(0) scale(0);
    transition: all 0.3s ease;
    width: 100%;
}

.newsletter-form-preferences-checkbox-ui-label {
    color: #FFFFFF;
    cursor: pointer;
    font-family: lucien-light, sans-serif;
    line-height: 1;
    margin: 0;
    padding: 15px 20px 15px 40px;
    width: 100%;
    height: 100%;
}

.newsletter-form-preferences-paragraph {
    color: #000000;
    font-family: lucien-book, sans-serif;
    font-size: 0.8rem;
    line-height: 1.4;

    a {
        color: $color-grey-lighter;
        text-decoration: underline;
    }
}

.newsletter-illustration {
    @include span-columns(5 of 10);

    height: 0;
    padding-top: 50%;
    position: relative;
    overflow: hidden;

    picture {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;

        img {
            display: block;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translateX(-50%) translateY(-50%);
            height: 100%;
        }

        @media screen and (max-width: 481px) {

        }
        @media screen and (min-width: 481px) {

        }
        @media screen and (min-width: 1441px) {
            img {
                height: auto;
                width: 100%;
            }
        }
    }
}

.error-message {
    padding-top: 8px;
    font-size: 0.6em;
    color: red;
}

///////////////////////////////////////////////////////////////
// Device: Desktop XL
///////////////////////////////////////////////////////////////

@include desktop-xl {
    .newsletter-confirmation {
        margin-top: 20%;
    }
}

///////////////////////////////////////////////////////////////
// Device: Tablet
///////////////////////////////////////////////////////////////

@include tablet-landscape-and-below {
    .newsletter-form {
        @include span-columns(12);
    }
    .newsletter-illustration {
        display: none;
    }
    .newsletter-form-preferences-checkbox-input:checked {
        & + .newsletter-form-preferences-checkbox-ui {
            background: $color-grey-border-light !important;
        }
    }
    .newsletter-form-preferences-checkbox-ui:hover {
        background: $color-grey-lighter !important;
    }
    .newsletter-confirmation {
        margin: 0 0 40px 0;
        width: 100%;
    }
}

///////////////////////////////////////////////////////////////
// Device: Mobile
///////////////////////////////////////////////////////////////

@include mobile-landscape-and-below {
    .newsletter {
        margin-bottom: 0;
    }
    .newsletter-content {
        float: none;
        margin: 0;
        width: 100%;
    }
    .newsletter-form {
        float: none;
        padding: 0 20px;

        .form-group {
            &:nth-of-type(1) {
                .form-inline {
                    margin-left: 0;

                    &:first-child {
                        display: block;
                        margin-bottom: 10px;
                        width: 100%;
                    }
                    &:nth-child(3) {
                        margin-left: 20px;
                    }
                }
            }
            &:nth-of-type(2) {
                float: none;
                width: 100%;
            }
            &:nth-of-type(3) {
                margin-left: 0;
                width: 100%;
            }
            &[data-id="submit"] {
                float: none;
                width: 100%;
            }
        }
    }
    .newsletter-form-birthdate {
        .form-group {
            &:nth-child(2) {
                flex-grow: 1;
            }
            &:nth-child(3) {
                margin-left: 5%;
            }

        }
    }
    .newsletter-form-preferences-checkbox {
        &:not(:first-child) {
            margin-left: 0;
        }
    }
    .newsletter-form-preferences-checkboxes {
        display: block;
        justify-content: none;
        margin-bottom: 20px;
    }
    .newsletter-form-preferences-checkbox {
        margin-top: 10px;
    }

}