:root {
    --white: hsl(0, 0%, 100%);
    --grey: hsl(0, 0%,58%);
    --blue700: hsl(235, 18%, 26%);
    --blue800: hsl(234, 29%, 20%);
    --red: hsl(4, 100%, 67%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    align-items: center;
    background-color: var(--blue700);
    color: var(--blue700);
    display: flex;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    height: 100vh;
    justify-content: center;
}

article {
    background-color: var(--white);
    height: 50.75rem;
    width: 23.4375rem;
}

picture img { display: block; margin: auto; }

#newsletter-content {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
}

h1, h2 { color: var(--blue800); font-size: 2.5rem; }
h2 { line-height: 2.5rem;}

/* LIST ITEMS */
#list-text { line-height: 1.5rem; } 

ul { margin-block-start: 1rem; margin-block-end: 1rem; }

li {
    line-height: 1.5rem;
    list-style: none;
    margin-bottom: 0.5rem;
    padding-left: 2rem;
    position: relative;
}

li::before {
    background-image: url('./assets/images/icon-list.svg');
    background-repeat: no-repeat;
    background-size: contain;
    content: '';
    height: 1.2rem;
    left: 0;
    position: absolute;
    top: 0.1rem;
    width: 1.2rem;
}

/* FORM CONTENT */
form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

label { font-size: 0.813rem; font-weight: 700; }

input, .button {
    border: none;
    border-radius: 0.5rem;
    padding: 1.2rem;
}

input { 
    border: 0.08rem solid var(--grey); 
    cursor: pointer; 
    margin-bottom: 0.7rem;
}

input:focus { outline: none; border: 0.08rem solid var(--blue800); } /* Remove blue focus outline*/

input.invalid { 
    background-color: hsla(0, 100%, 50%, 0.1); 
    border: 0.08rem solid var(--red);
    box-shadow: none;
}

#error-message { color: var(--red); font-size: 0.813rem; }

/* BUTTON CONTENT */
.button {
    background-color: var(--blue800);
    color: var(--white);
    cursor: pointer;
    font-weight: 700;
    width: 100%;
}

.button:hover {
    background-image: linear-gradient(90deg, hsl(342, 80%, 63%), hsl(4, 100%, 67%));
    box-shadow: 0.4rem 0.4rem 2rem var(--grey);
}

/* SUCCESS SCREEN */
.hidden { display: none !important; }

#success-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.5rem;
}

#success-text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    line-height: 1.5rem;
    margin-top: 8rem;
}

/* Desktop device */
@media screen and (min-width: 48rem) {
    article {
        align-items: center;
        border-radius: 1.5rem;
        box-shadow: 1rem 1rem 2rem rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: row-reverse;
        gap: 2.5rem;
        height: 100%;
        padding: 1.2rem;
        width: 58rem;
    }

    #newsletter-content { padding: 2rem; }
    h1, h2 { font-size: 3.5rem; line-height: 3.5rem; }
    #success-container { padding: 3rem; width: 30rem; }
    ul { margin-block-start: 1.5rem; margin-block-end: 1rem; }   
    #success-text { margin-top: 1rem; }
    input:hover { border: 0.08rem solid var(--blue800); }
}