* {
  box-sizing: border-box;
}

.hidden {
  display: none;
}

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

/*reset*/
a {
  text-decoration: none;
  color: currentColor;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

input,
textarea,
button {
  font-family: inherit;
  line-height: inherit;
}

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

button {
  cursor: pointer;
}

/*common*/
.go-back-btn {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  text-align: center;

  display: inline-block;
  border-radius: 8px;
  padding: 8px 16px;
  background-color: #4e75ff;
  height: 40px;

  transition: background-color 0.3s ease;
  margin-bottom: 20px;
}

.go-back-btn:hover,
.go-back-btn:focus {
  background-color: #6c8cff;
}

h1 {
  font-size: 24px;
  font-weight: 600;

  line-height: 1.33;
  letter-spacing: 0.04em;
  color: #2e2f42;
}

h2 {
  font-size: 24px;
  font-weight: 600;

  line-height: 1.33;
  letter-spacing: 0.04em;
  color: #2e2f42;

  margin-bottom: 16px;
}

/*task-1*/
#categories {
  background-color: #ffffff;
  border-radius: 8px;

  padding: 24px;
  max-width: 440px;

  margin-left: auto;
  margin-right: auto;
}

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

  padding: 16px;
  max-width: 392px;

  margin-bottom: 24px;
}

#categories :last-child {
  margin-bottom: 0;
}

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

.item li {
  background-color: inherit;
  border: 1px solid #808080;
  border-radius: 4px;

  max-width: 360px;
  padding: 8px 16px;

  letter-spacing: 0.04em;
  color: #2e2f42;
}

/*task-2*/
.gallery {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 48px;

  justify-content: space-between;
  padding: 0;
  margin: 0;
}

.gallery-item {
  flex-basis: calc((100% - 72px) / 3);
}

/*task-3*/
#name-input {
  display: block;

  padding: 8px 16px;
  width: 100%;
  max-width: 360px;
  height: 40px;

  font: inherit;
  line-height: inherit;
  letter-spacing: 0.04em;
  color: #2e2f42;

  border-radius: 4px;
  border: 1px solid #808080;
  outline: none;
  transition: border-color 0.3s ease;

  margin-bottom: 16px;
}

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

#name-input:focus {
  border-color: #4e75ff;
}

/*task-4*/
.login-form {
  max-width: 408px;
  margin: 0 auto;
  padding: 24px;

  background-color: #ffffff;
  border-radius: 8px;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;

  letter-spacing: 0.04em;
  color: #2e2f42;
}

.login-form input {
  padding: 8px 16px;
  width: 100%;
  max-width: 360px;
  height: 40px;

  font: inherit;
  line-height: inherit;
  letter-spacing: 0.04em;
  color: #2e2f42;

  border-radius: 4px;
  border: 1px solid #808080;
  outline: none;
  transition: border-color 0.3s ease;
}

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

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

.login-form button {
  align-self: flex-start;

  padding: 8px 16px;
  height: 40px;
  background-color: #4e75ff;

  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ffffff;

  border: none;
  border-radius: 8px;

  transition: background-color 0.3s ease;
}

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

/*task-5*/
.widget {
  border-radius: 8px;
  padding: 100px 88px;
  max-width: 345px;

  background-color: #ffffff;
}

.widget p {
  letter-spacing: 0.04em;
  color: #2e2f42;

  margin-bottom: 16px;
}

.color {
  font-weight: 600;
}

.change-color {
  display: inline-block;

  padding: 8px 16px;
  height: 40px;
  background-color: #4e75ff;

  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;

  border: none;
  border-radius: 8px;

  transition: background-color 0.3s ease;
}

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