* {
  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;
}

#categories {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 392px;
}

.item {
  background-color: #f6f6fe;
  border-radius: 8px;
  padding: 16px;
}

.item:not(:last-child) {
  margin-bottom: 24px;
}

.item h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: 0.04em;
}

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

.item ul li {
  border: 1px solid #808080;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 16px;
  line-height: 1.5;
}

.item ul li:not(:last-child) {
  margin-bottom: 8px;
}

.gallery {
  list-style: none;
  margin: 100px 156px;
  padding: 0;

  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.gallery-item {
  width: calc((100% - 48px) / 3);
}

.gallery-image {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
}

#name-input {
  display: block;
  width: 360px;
  height: 40px;
  margin-bottom: 16px;
  padding: 8px 16px;
  border: 1px solid #808080;
  border-radius: 4px;
  outline: none;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}

#name-input::placeholder {
  color: #2e2f42;
}

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

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: 0.04em;
}

.login-form {
  width: 360px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.login-form label:not(:last-of-type) {
  margin-bottom: 16px;
}

.login-form input {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 8px;
  padding: 8px 16px;
  box-sizing: border-box;
  border: 1px solid #808080;
  border-radius: 4px;
  outline: none;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.login-form input:hover {
  border-color: #000000;
}

.login-form input:focus {
  border-color: #808080;
}

.login-form input::placeholder {
  color: #808080;
}

.login-form button {
  margin-top: 16px;
  min-width: 86px;
  height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background-color: #4e75ff;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.login-form button:hover,
.login-form button:focus {
  background-color: #6c8cff;
}

.widget {
  width: 345px;
  min-height: 280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.widget p {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.33;
  letter-spacing: 0.04em;
}

.change-color {
  min-width: 148px;
  height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background-color: #4e75ff;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  cursor: pointer;
}

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

#controls {
  width: 486px;
  padding: 32px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 8px;
  background-color: #f6f6fe;
  box-sizing: border-box;
}

#controls input {
  width: 150px;
  height: 40px;
  padding: 8px 16px;
  box-sizing: border-box;
  border: 1px solid #808080;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

#controls input:hover,
#controls input:focus {
  border-color: #000000;
}

button[data-create],
button[data-destroy] {
  min-width: 120px;
  height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  cursor: pointer;
}

button[data-create] {
  background-color: #4e75ff;
}

button[data-create]:hover,
button[data-create]:focus {
  background-color: #6c8cff;
}

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

button[data-destroy]:hover,
button[data-destroy]:focus {
  background-color: #ff7070;
}

#boxes {
  width: 486px;
  min-height: 134px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 8px;
  background-color: #f6f6fe;
  box-sizing: border-box;
}
