*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

:root{
    --background-body: linear-gradient(45deg, #EDEDFF, #9292FF, #5d5dd2, #4949FF); 
    --background-app: #414177;
    --color-app: #C8C8FF;
    --background-hover-button: #42ebebb6;
    
    --background-output:rgba(148, 237, 188, 0.974);
    --color-output: #393981;

}

body{
    background-image: var(--background-body);
    height: 100vh;
    width: 100%;
    background-attachment: fixed;
    background-repeat: repeat;
    background-size: 300%;  
    display: flex;
    justify-content: center;
    align-items: center;
    animation: moveBackground 8s alternate linear infinite;
}


main
{
    background-color: var(--background-app);
    border-radius: 7px;
    padding-top: 16px;
    width: 29.5%;
    height: fit-content;
}

fieldset, #output{
    border: none;
    color: var(--color-app);
    width: 100%;
    padding: 0 20px 0 20px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 40px;
}

legend{
    text-align: center;
    font-size: xx-large;
    margin-bottom: 18px;
}
input, button{
    width: 100%;
    border: none;
    outline: none;
    border-radius: 3px;
}
input{
    height: 36px;
    padding-left: 5.2px; 
}
input:focus{
    border: none;
    outline: none;
}

button{
    height: 45px;
    text-transform: uppercase;
    letter-spacing: 3.5px;
}

h2{
    margin: 2.3px;
    transition: transform 340ms cubic-bezier(0.175, 0.885, 0.32, 1.075);
}

label{
    display: flex;
    flex-direction: column-reverse;
}

button:hover{
    background-color: var(--background-hover-button);
    transition: background-color 140ms linear;
}


#output{
    margin: 25px 0 5px 0;
    font-size: xx-large;
    height: 40px;
    color: var(--color-output);
}




/* Animação: Movimenta a tag h2 (altura e peso) ao input ficar em 'focus' */
input:focus ~ h2{
    transform: translateX(45%) rotate(1.7deg);
    transition: transform 340ms cubic-bezier(0.175, 0.885, 0.32, 1.775);
}


/* Animação: Movimentação do background */
@keyframes moveBackground {
    0%{
        background-position: 0 45deg;
    } 100%{
        background-position: 100%;
    }
}


/* Animação: Resultado IMC sendo 'digitado' */
.typing{
    animation: typeIMCResult 200ms linear forwards;
    font-size: xx-larger;
    background-color: var(--background-output);
}

@keyframes typeIMCResult{
    from{
        width: 0px;
    } to{
        width: 100%;
    }
}

