/* #region Font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
/* #endregion */
/* #region Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: currentColor;
  text-decoration: none;
  transition: 300ms ease-in;
}

body {
  margin: 16px;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #fff;
  color: #2e2f42;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
input {
  min-height: 2.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: inherit;
  border-radius: 0.25rem;
  border: 1px solid rgb(128, 128, 128);
  outline: transparent;

  &:hover {
    border-color: #000;
  }

  &:focus {
    box-shadow: 0 0 0 0.25rem rgba(128, 128, 128, 0.25);
  }
  &::placeholder {
    color: #2e2f42;
  }
}
button {
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: inherit;
  color: #fff;
  background: #4e75ff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;

  &:hover,
  &:focus {
    background: #6c8cff;
  }
}
ul {
  list-style-type: none;
}
p {
  margin-block-end: 1rem;
}
a[href*='./index.html'] {
  display: block;
  width: fit-content;
  padding: 0.25rem 0.5rem;
  border: 1px solid;
  border-radius: 0.25rem;
  background: #2e2f42;
  color: #fff;
  transition-property: color, background-color;

  &:hover,
  &:focus {
    color: #2e2f42;
    background: transparent;
  }
}
.tasks-list {
  text-align: center;
}
/* #endregion */
/* #region Task 1 */
#categories {
  max-width: 392px;
  width: 90%;
  margin-inline: auto;

  .item {
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f6f6fe;

    &:not(:last-child) {
      margin-block-end: 1.5rem;
    }

    h2 {
      margin-block-end: 1rem;
      font-size: 24px;
      font-weight: 600;
      line-height: 1.33;
    }

    li {
      padding: 0.5rem 1rem;
      border: 1px solid #808080;
      border-radius: 0.25rem;

      &:not(:last-child) {
        margin-block-end: 0.5rem;
      }
    }
  }
}
/* #endregion */
/* #region Taks 2 */
.gallery {
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 22.5rem));
  grid-template-rows: repeat(2, minmax(auto, 18.75rem));
  gap: 3rem 1.5rem;
  justify-content: center;
}
/* #endregion */
/* #region Task 3 */
#name-input {
  max-width: 22.5rem;
  margin-block-end: 1rem;
}
h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.33;
}
/* #endregion */
/* #region Task 4 */
.login-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  max-width: 25.5rem;
  width: 100%;
  padding: 1.5rem;
  background: #fff;
  border-radius: 0.5rem;

  label {
    width: 100%;
  }

  input {
    display: block;
    width: 100%;
    min-height: 2.5rem;
    margin-block-start: 0.5rem;
  }
}
/* #endregion */
/* #region Task 5 */
body:has(.widget) {
  background-color: rgb(245, 245, 245);
}
.widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 21.56rem;
  margin-inline: auto;
  padding: 6.25rem 0;
  border-radius: 1rem;
  background: #fff;

  .color {
    display: inline-block;
    min-width: 4.5rem;
    text-align: center;
  }
}
/* #endregion */
/* #region Task 6 */
#controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: fit-content;
  padding: 2rem;
  margin-inline: auto;
  margin-block-end: 1rem;
  background: #f6f6fe;
  border-radius: 1rem;

  input {
    min-width: 9rem;
  }

  button[data-destroy] {
    background: #ff4e4e;

    &:hover,
    &:focus {
      background: #ff7070;
    }
  }
}
#boxes {
  max-width: 80vw;
  margin-inline: auto;
  padding: 2rem;
  background: #f6f6fe;
  border-radius: 1rem;

  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
}
/* #endregion */
