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

:root {
  --bg-primary: #F4F5FB;
  --bg-secundary: #FFFFFF;

  --brand: #CA3884;
  --brand-hover: #A52C6B;
  --danger: #C93847;

  --ct-primary: #080B12;
  --ct-secundary: #374151;
  --ct-tertiary: #9CA3AF;

  --bd-primary: #D1D5DB;
  --bd-hover: #B9C2D0;

  --ff-base: "Inter", sans-serif;

}

body {
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;

  align-items: center;
  font-family: var(--ff-base);

  h1 {
    font-size: 1, 5rem;
    font-weight: 700;
    line-height: 2rem;
    margin: 1rem 0 2rem;
  }

  & p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25rem;
  }

  & a {
    text-decoration: none;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1rem;
    color: var(--brand);
  }
}

header {
  padding: 2rem 0;
}


#content {
  min-width: 49rem;

}

form {
  height: 2.75rem;
  display: flex;
  gap: 1rem;

  & button {
    all: unset;
    width: 10rem;
    height: 2.75rem;
    padding: 0 1.5rem;
    background-color: var(--brand);
    color: var(--bg-secundary);
    border: none;
    border-radius: .75rem;

    font-weight: 500;

    &:hover {
      background-color: var(--brand-hover);
    }

  }

  & input {
    all: unset;
    width: 100%;
    height: 100%;
    border-radius: .5rem;
    background-color: var(--bg-secundary);
    border: 1.5px solid var(--bd-primary);

    padding: 0 1rem;

    &:hover {
      border-color: var(--bd-hover);
    }

    &:focus {
      border: 2px solid var(--brand);
      outline: none;
      color: var(--ct-primary);
    }
  }

}

#list {
  margin: 2.5rem 0;
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: .75rem;

  li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;

    height: 3rem;
    padding: .5rem .75rem;
    background-color: var(--bg-secundary);
    border-radius: .75rem;

    .delete{
      flex: 0 0 1.25rem;
      height: 1.25rem;
      background: url(./img/Lixeira.svg) no-repeat center/contain;
    }

    .item{
      display: flex;
      align-items: center;
      gap: 1rem;
      width: 100%;
      height: 100%;

      p {
        width: 100%;
      }
      
      position: relative;
      
      & [type="checkbox"] {
        all: unset;
        position: absolute;
        inset: 0;
      }
      
      & .checkbox-image {
        flex: 0 0 1.25rem;
        height: 1.25rem;
        
        border-radius: .5rem;
        border: 1px solid var(--bd-primary);
        background-color: var(--bg-secundary);
      }
      
      &:has(:hover) .checkbox-image {
        flex: 0 0 1.25rem;
        height: 1.25rem;
        
        border-radius: .5rem;
        border: 1px solid var(--bd-hover);
        background-color: var(--bg-secundary);
      }
      
      &:has(:checked) {
        
        p{
          text-decoration: line-through;
        }

        .checkbox-image {
          border-color: var(--brand);
          padding: .125rem;
          background: url(./img/checkbox/selected.svg) no-repeat center/contain;
        }
      }
    }
  }

}


.alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background-color: var(--danger);

  height: 3rem;
  padding: .75rem;
  border-radius: .75rem;

  p {
    width: 100%;
    color: var(--bg-primary);
  }

  img {
    filter: brightness(0) invert(1);
  }

  button {
    all: unset;
  }
  
  opacity: 0;
}

.alert-show {
  opacity: 1;
  animation: alert 3s ease-in-out both;
}


@media (width <= 30rem) {
  body {
    h1{
      font-size: 1.5rem;
    }

    a{
      font-size: 1rem;
      font-weight: 500;
    }
  }

 #content {
  min-width: 20rem;
  padding: 0 2rem;
}

form {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;


  input{
    height: 2.75rem;
    width: auto;
    padding: 0 1rem;
  }

  button{
    height: 2.75rem;
    width: auto;
    text-align: center;
  }
}

}


@keyframes alert {

  
  50%{
    opacity: 1;
  }

  
  75%{
    opacity: .7;
  }

  100% {
    opacity: 0;
  }
  
}