* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Josefin Sans", sans-serif;
}

:root {
  --BrightBlue: hsl(220, 98%, 61%);
  --CheckBackground: linear-gradient(hsl(192, 100%, 67%), hsl(280, 87%, 65%));

  /*light theme */
  --bg-color: hsl(0, 0%, 98%);
  --bg-color-error: rgb(196, 6, 32);
  --body-color: hsl(236, 33%, 92%);
  --line-color: hsl(233, 11%, 84%);
  --text-color: hsl(236, 9%, 61%);
  --text-color-error: hsl(240, 42%, 93%);
  --text-color-2: hsl(235, 19%, 35%);
}

.credit {
  position: fixed;
  top: 1rem;
  right: 1rem;
  color: rgb(233, 211, 211);
  font-size: 0.8rem;
}
.credit a {
  color: rgb(190, 210, 231);
}

ul {
  list-style: none;
}
.container {
  width: 90%;
  max-width: 450px;
  margin-inline: auto;
}

.circle {
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--line-color);
}

.circle > * {
  display: none;
}

button {
  outline: none;
  border: none;
  background-color: transparent;
  cursor: pointer;
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--body-color);
}

header {
  background-image: url("./images/bg-mobile-light.jpg");
  min-height: 40vh;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

section {
  margin-top: -9rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 6rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top h1 {
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 2rem;
  color: white;
}

.top .toggler {
  cursor: pointer;
}

.input__wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-color);
  padding: 0.5rem;
  border-radius: 0.3rem;
}
.input__wrapper input {
  flex: 1;
  outline: none;
  border: none;
  background-color: transparent;
  font-size: 1.3rem;
  padding: 0.8rem 0.3rem;
  color: var(--text-color);
}

.todo__wrapper {
  background-color: var(--bg-color);
  border-radius: 0.3rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
}

.todo__items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
  color: var(--text-color-2);
  font-weight: 700;
}

.todo__items .no__item {
  text-align: center;
  font-style: italic;
  font-weight: 400;
  padding-block: 1rem;
  font-size: 0.8rem;
}

.todo__items li {
  padding: 1rem;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--line-color);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
}

.todo__items li p {
  flex: 1;
}

.todo__items li.completed .circle {
  border-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: var(--CheckBackground);
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.todo__items li.completed .circle > * {
  display: flex;
}

.todo__items li.completed p {
  text-decoration: line-through;
  font-weight: 400;
  color: var(--text-color);
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 1rem;
  color: var(--text-color);
}

.actions button {
  color: var(--text-color);
}

.btns__show {
  position: absolute;
  top: 105%;
  background-color: var(--bg-color);
  right: 0;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.btns__show button {
  font-weight: 700;
  font-size: 0.9rem;
}
.btns__show :is(.active, :hover),
.actions > button:hover {
  color: var(--BrightBlue);
}

.alert {
  display: flex;
  position: fixed;
  bottom: 1rem;
  right: -200%;
  opacity: 0;
  background-color: var(--bg-color-error);
  color: var(--text-color-error);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: right 1s;
}

.alert.show {
  opacity: 1;
  right: 10%;
}

body.dark {
  --bg-color: hsl(235, 24%, 19%);
  --body-color: hsl(235, 21%, 11%);
  --line-color: hsl(233, 14%, 35%);
  --text-color: hsl(236, 9%, 61%);
  --text-color-2: hsl(234, 39%, 85%);
}

body.dark header {
  background-image: url("./images/bg-mobile-dark.jpg");
}

@media screen and (min-width: 768px) {
  header {
    background-image: url("./images/bg-desktop-light.jpg");
  }
  body.dark header {
    background-image: url("./images/bg-desktop-dark.jpg");
  }
  .todo__items .no__item {
    font-size: 1rem;
  }
}

@media screen and (min-width: 1024px) {
  .container {
    max-width: 550px;
  }
  section {
    margin-top: -6rem;
  }
  .btns__show {
    position: static;
    top: 105%;
    background-color: transparent;
    right: 0;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0;
  }
}
