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

body{
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--tertiary-color);
    color: var(--quinary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background-image: url('./img/sapiens.png'), url('./img/sapiens-woman.png');
    background-position: left bottom, right top;
    background-repeat: no-repeat, no-repeat;
    background-size: 40%, 30%; 
    background-attachment: fixed, fixed;
}

:root{
    --primary-color: #08415C;
    --secundary-color: #CC2936;
    --tertiary-color: #6B818C;
    --quaternary-color: #2C363F;
    --quinary-color: #EEE5E9;
}

header{
    margin: 20px 0;
    padding: 20px;
}

#cabecalho{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#cabecalho h1{
    font-size: 3rem;
}

main{
    display: flex;
    flex-direction: column;
    
    margin: 20px 0;
    padding: 20px 40px;

    
}

form{
    display: flex;
    flex-direction: row;
    gap: 20px;

    padding: 20px;

    background-color: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

form input{
    width: 400px;
    border: 1px solid red;
    border: none;
    border-radius: 5px;
    padding: 10px;
    font-size: 1rem;
}

form img{
    width: 50px;
}

#lista-tarefas{
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    list-style-type: none;
    transition: 1s;
}

@keyframes tarefa-animacao {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.tarefa{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--quaternary-color);
    color: var(--quinary-color);

    border: none;
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);

    text-decoration: none;

    animation: tarefa-animacao 1s;
    transition: 1s;
}

.removendo {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.4s ease;
}

.tarefa p input{
    border: none;
    margin: 5px 15px 5px 5px;
}

.tarefa button img{
    width: 30px;
}

.tarefa button,
form button{
    border: none;
    background-color: transparent;
    color: var(--quinary-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.feito{
    text-decoration: line-through;
    color: var(--secundary-color);
}

footer{
    position: fixed;
    bottom: 0;
    /* width: 100%;
    background-color: var(--primary-color); */
    color: var(--quinary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 20px;
    font-size: 1rem;
    font-weight: bold;
    bottom: 0px;
}

footer a{
    color: var(--quinary-color);
    text-decoration: none;
}

/* =========================================
    📱 RESPONSIVIDADE PARA CELULARES
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. Removemos as imagens laterais para limpar a tela e facilitar a leitura */
    body {
        background-blend-mode: color-burn;
    }

    /* 2. Diminuímos um pouco o título para não quebrar a linha de forma estranha */
    #cabecalho h1 {
        font-size: 2.2rem;
        text-align: center;
    }

    /* 3. Diminuímos as margens laterais do main para aproveitar bem o espaço da tela */
    main {
        padding: 15px;
        width: 100%;
    }

    /* 4. Ajustamos o formulário para ocupar a largura total disponível */
    form {
        width: 100%;
        gap: 10px; /* Reduz o espaço entre o input e o botão */
        padding: 15px;
    }

    /* 5. A mágica acontece aqui: tiramos os 400px fixos e deixamos flexível */
    form input {
        width: 100%; /* Ocupa 100% do espaço que sobrar no form */
        flex: 1; /* Permite que o input estique, empurrando o botão pro cantinho */
    }

    /* 6. Ajustamos o tamanho dos botões e tarefas para o toque do dedo (Touch Target) */
    .tarefa {
        padding: 15px 10px; /* Um pouco mais alto para facilitar o clique */
    }
    
    /* Previne que o footer sobreponha a última tarefa da lista */
    #lista-tarefas {
        margin-bottom: 80px; 
    }
}
