* {
  box-sizing: border-box;
}

body {
  margin: 16px;
  font-family: -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: #fafafa;
  color: #212121;
  line-height: 1.5;
}

img {
  width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  display: inline-block;
  margin-left: 24px;
  margin-bottom: 50px;
  width: 140px;
  padding: 8px 16px;
  font-weight: 500;
  color: #fff;
  background: #4e75ff;
  border: none;
  border-color: transparent;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  transition: 0.3s ease;
}

a:hover {
  background: #6c8cff;
}

/*---task-1---*/

#categories {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 392px;
  padding: 24px;
}

.item > h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.33;
}

#categories > .item {
  padding: 16px;
  background-color: #f6f6fe;
}

.item ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item li {
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #808080;
}

/*------------*/

/*---task-2---*/
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.gallery > li {
  display: flex;
  flex-basis: calc((100% - 48px) / 3);
}
/*------------*/

/*---task-3---*/
input#name-input {
  width: 360px;
  height: 40px;
  padding: 8px 16px;
  margin-bottom: 16px;
  margin-left: 24px;
  border: 1px solid #808080;
  border-radius: 4px;

  letter-spacing: 0.04em;

  outline: none;
  transition: border-color 0.3s;
}

input#name-input:hover,
input#name-input:focus {
  border-color: #000;
}

h1,
input#name-output {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 24px;

  line-height: 1.33333;
  letter-spacing: 0.04em;
}

h1 {
  margin-left: 24px;
}

/*------------*/

/*---task-4---*/
.login-form {
  border-radius: 8px;
  padding: 24px;
  width: 408px;
  height: 256px;
  background: #fff;
  margin-left: 24px;
}

.login-form input {
  display: block;
  width: 100%;
  border: 1px solid #808080;
  border-radius: 4px;
  padding: 8px 16px;
  margin-top: 8px;
  outline: none;
  transition: border-color 0.3s;
}

.login-form input:hover,
.login-form input:focus {
  border-color: #000;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
}

.login-form button {
  display: inline-block;
  margin-top: 16px;
  border-radius: 8px;
  padding: 8px 16px;
  width: 86px;
  height: 40px;
  font-weight: 500;
  color: #fff;
  background: #4e75ff;
  border: none;
  border-color: transparent;
  text-decoration: none;
  text-align: center;
  transition: 0.3s ease;
}

.login-form button:hover {
  background: #6c8cff;
}
/*------------*/

/*---task-5---*/
.widget {
  border-radius: 8px;
  padding: 100px 88px;
  width: 345px;
  height: 280px;
  margin-left: 24px;

  background: #fff;
}

.change-color {
  display: inline-block;
  margin-top: 16px;
  border-radius: 8px;
  padding: 8px 16px;
  width: 148px;
  height: 40px;
  font-weight: 500;
  color: #fff;
  background: #4e75ff;
  border: none;
  border-color: transparent;
  text-decoration: none;
  text-align: center;
  transition: 0.3s ease;
}

.change-color:hover,
.change-color:focus {
  background-color: #6c8cff;
}

p,
p > span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.04em;
}
