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

body {
  background-color: #eee;
  font-family: "Roboto", sans-serif;

  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 32px;
}

/* Acessibilidade: foco visível */
:focus-visible {
  outline: 3px solid #ca3884;
  outline-offset: 2px;
}

/* Texto acessível (invisível na tela) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   HEADER
   ========================================================= */
header {
  margin-top: 20px;
  margin-bottom: 50px;
}

/* =========================================================
   MAIN / RESET / TÍTULO
   ========================================================= */
main {
  width: 100%;
  max-width: 560px;
  padding-bottom: 120px; /* respiro no final */
}

#clear {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ca3884;
  font: inherit;
  cursor: pointer;
}

#clear:hover {
  color: #a52c6b;
}

#clear img{
  width: 16px;
}
#clear:hover{
  filter: brightness(0.85) saturate(0.9) contrast(1.1);
}

h1 {
  margin: 10px 0 50px;
}

/* =========================================================
   FORM (INPUT + BOTÃO)
   ========================================================= */
form {
  width: 100%;
  display: flex;
  gap: 12px;
  flex-wrap: wrap; /* mobile */
}

form input {
  flex: 1 1 280px;
  height: 56px;

  padding: 16px;
  font-size: 16px;
  font-family: inherit;

  border-radius: 7px;
  border: 2px solid #202024;
  background: #fff;
}

.button {
  flex: 0 0 auto;
  height: 56px;

  padding: 0 16px;
  border: none;
  border-radius: 7px;

  background-color: #ca3884;
  color: #fff;

  font-size: 14px;
  font-weight: bold;
  cursor: pointer;

  transition: background-color 0.2s;
}

.button:hover {
  background-color: #a52c6b;
}

/* =========================================================
   LISTA (UL) + ITENS (LI)
   ========================================================= */
ul {
  list-style: none;
  margin-top: 42px;

  display: grid;
  gap: 15px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 20px;
  border-radius: 7px;
  background-color: #fff;

  font-size: 16px;
  font-weight: bold;
}

/* lado esquerdo (checkbox + texto) */
.item label {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* alinhamento fino */
.item div span {
  line-height: 1.2;
}

/* botão remover (ícone de uma lixeira) */
.item button {
  border: none;
  background: transparent;

  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.item button:hover {
  filter: invert(12%) sepia(95%) saturate(7500%) hue-rotate(355deg)
    brightness(50%) contrast(120%);
}

/* =========================================================
   CHECKBOX CUSTOM
   ========================================================= */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  width: 16px;
  height: 16px;

  border: 2px solid #202024;
  border-radius: 3px;

  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background-color: #ca3884;
  border-color: #a52c6b;
}

/* ícone de ✔ */
input[type="checkbox"]:checked::after {
  content: "✔";
  color: #fff;
  font-size: 12px;

  position: absolute;
  top: -2px;
  left: 1.5px;
}

/* item concluído */
.riscado {
  color: #777;
  text-decoration: line-through;
}

/* =========================================================
   TOAST / MENSAGEM (REMOVIDO)
   ========================================================= */
.mensagem {
  position: fixed;
  left: 50%;
  bottom: 50px;

  background-color: #c93847;
  color: #fff;

  padding: 14px 20px;
  border-radius: 7px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  width: min(92vw, 420px);

  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}

/* escondida */
.mensagem.toggle {
  transform: translate(-50%, 300px);
  opacity: 0;
}

/* visível */
.mensagem:not(.toggle) {
  transform: translate(-50%, 0);
  opacity: 1;
}

.mensagem span p {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 0;
}

/* botão de fechar (X) */
.close {
  border: none;
  background: transparent;
  padding: 4px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 600px) {
  body {
    padding: 20px;
  }

  header {
    display: none;
  }

  main {
    max-width: 100%;
    padding-top: 20px;
    padding-bottom: 0px;
  }

  h1 {
    margin: 10px 0 40px;
    font-size: 22px;
  }

  .button {
    width: 100%;
  }
}
