@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

:root{
  --cor-extremos: rgb(9, 48, 56);
  --cor-de-fundo: #8c8c8c;
  --cor-do-container: #ffffff;

  --cor-card: #e6e6e6;
  --cor-linha: rgb(167, 165, 165);
  --cor-paragrafo: #fafafa;
  --cor-texto: #333;

  --cor-botao-nova: #2e7d32;
  --cor-botao-editar: #f9a825;
  --cor-botao-excluir: #c62828;

  --fonte-titulo: 'Poppins', sans-serif;
  --fonte-padrao: 'Inter', sans-serif;
}

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--fonte-padrao);
}

body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header{
  background: var(--cor-extremos);
  padding: 20px;
}

header h1{
  color: var(--cor-card);
  font-family: var(--fonte-titulo);
  font-weight: 700;
  text-align: center;
}

main{
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 20px 0;
  background: var(--cor-de-fundo);
}

#container{
  width: 92%;
  max-width: 460px;
  background: var(--cor-do-container);
  border-radius: 12px;
  box-shadow: 2px 2px 10px rgba(0,0,0,.25);
  padding: 20px;
}

#form-tarefa{
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.form-campo{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-campo label{
  font-size: 15px;
  font-weight: 600;
  color: var(--cor-texto);
}

.form-campo input,
.form-campo select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #bdbdbd;
  font-size: 15px;
  background: var(--cor-card);
  color: var(--cor-texto);
}

.form-campo input:focus,
.form-campo select:focus{
  outline: none;
  border-color: var(--cor-extremos);
}

#button-tarefa{
  margin-top: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: var(--cor-botao-nova);
  color: #fff;
}

#button-tarefa:active{ transform: scale(0.98); }

#resumo{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--cor-card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--cor-texto);
  flex-wrap: wrap;
}

#tabela-head{
  display: none;
}

.empty-state{
  background: var(--cor-card);
  border-radius: 12px;
  padding: 14px;
  color: var(--cor-texto);
  margin-top: 12px;
  text-align: center;
}

#lista-tarefas{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

section.tarefa{
  background: var(--cor-paragrafo);
  border-radius: 12px;
  padding: 14px;
  transition: transform .2s ease, box-shadow .2s ease, border-left-color .2s ease;
  border-left: 6px solid transparent;
}

section.tarefa:hover{
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

section.tarefa.tarefa--pendente{ 
    border-left-color: #c62828; 
}
section.tarefa.tarefa--completo{ 
    border-left-color: #2e7d32; 
}

.tarefa-data{
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
}

.campo{
  margin-bottom: 12px;
}

.campo:last-child{
  margin-bottom: 0;
}

.campo-titulo{
  font-weight: 700;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--cor-texto);
  background: var(--cor-linha);
  margin-bottom: 6px;
}

.campo p{
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--cor-card);
  padding: 10px 12px;
  border-radius: 8px;
  word-break: break-word;
}

section.tarefa .campo:last-child p {
    flex-wrap: nowrap;
    gap: 6px;
}

section.tarefa .campo:last-child p button{
    flex: 1 1 0;
    min-width: 0;
    font-size: 14px;
    padding: 8px 4px;
}

.status{
  font-weight: 700;
}
.status--pendente{ 
    color: #b71c1c; 
}
.status--completo{ 
    color: #1b5e20; 
}

button{
  font-weight: 600;
}

.button-editar,
.button-excluir,
.button-toggle{
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 0;
  color: #fff;
  white-space: nowrap;
}

.button-editar{ 
    background: var(--cor-botao-editar); 
}
.button-excluir{ 
    background: var(--cor-botao-excluir); 
}
.button-toggle{ 
    background: #1565c0; 
}

.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.hidden{
    display: none;
}

.modal{
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.modal h2{
  margin-bottom: 12px;
}

.modal-acoes{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-cancelar, .btn-salvar{
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 0;
}

.btn-cancelar{ background: #ddd; }
.btn-salvar{ background: #2e7d32; color: #fff; }

footer{
  background: var(--cor-extremos);
  padding: 20px;
}

footer p{
  text-align: center;
  color: var(--cor-card);
  font-size: 18px;
}

footer a{
  color: var(--cor-card);
  text-decoration: none;
  font-weight: 800;
}

@media (min-width: 900px){
  #container{
    max-width: 1100px;
  }

  #resumo{
    justify-content: space-between;
  }

  #tabela-head{
    display: grid;
    grid-template-columns: 150px 1.1fr 1.8fr 140px 320px;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: var(--cor-linha);
    font-weight: 800;
    color: var(--cor-texto);
    margin-bottom: 12px;
  }

  section.tarefa{
    display: grid;
    grid-template-columns: 150px 1.1fr 1.8fr 140px 320px;
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: var(--cor-paragrafo);
  }

  section.tarefa .tarefa-data{
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--cor-card);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  section.tarefa .campo{
    margin: 0;
  }

  section.tarefa .campo-titulo{
    display: none;
  }

  section.tarefa .campo p{
    margin: 0;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--cor-card);
    align-items: center;
  }

  section.tarefa .campo:last-child p{
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;   
  }

  .button-editar,
  .button-excluir,
  .button-toggle{
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    min-width: 90px; 
    text-align: center;
  }
}