/*=======RESET=======*/
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}
img {
  display: block;
}
a {
  display: block;
}

.list {
  list-style: none;
}

.link {
  text-decoration: none;
}
/*=======END RESET=======*/

/*=======COMPONENT=======*/
.container {
  width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.section {
  padding: 50px 0;
}

/*=======END COMPONENT=======*/

/*=======END MAIN-LINK=======*/
.main-link {
  color: var(--page-bg-secondary-color);
  text-decoration: none;
  text-align: center;

  margin-left: auto;
  margin-right: 20px;
  padding: 15px;

  max-width: 150px;
  border-radius: 4px;
}
.main-link:hover,
.main-link:focus {
  background-color: tomato;
  color: white;
  outline: none;
}
/*=======END MAIN-LINK=======*/

/*=======FLEX-1=======*/
/* Вариант железно бетонный, но когда нет фона */
.flex-1 {
  background-color: teal;
}
.title {
  text-align: center;
  margin-bottom: 50px;
  color: #ffffff;
  font-style: italic;
  text-decoration: underline;
}
.flex-container {
  display: flex;
  flex-wrap: wrap;

  margin: -15px;
}
.flex-elements {
  background-color: tomato;
  width: 370px;

  padding: 5px;
  text-align: center;
  margin: 15px;

  border-radius: 5px;
}

/* вариант 1 */
/* .flex-elements {
  background-color: tomato;
  width: 370px;

  padding: 5px;
  text-align: center;
  margin-right: 30px;
  margin-bottom: 30px;
} */
/* Алтернатива но при этом нужно убрать у елемента марджины*/
/* .flex-elements:not(:nth-child(3n)) {
  margin-right: 30px;
}
.flex-elements:not(:nth-last-child(-n + 3)) {
  margin-bottom: 30px;
} */
/* .flex-elements:nth-child(3n) {
  margin-right: 0px;
}
.flex-elements:nth-last-child(-n + 3) {
  margin-bottom: 0;
} */

/* Вариант 2 Калк */

/* .flex-elements {
  background-color: tomato;

  width: calc((100% - 60px) / 3);
  padding: 5px;
  text-align: center;
  margin-right: 30px;
  margin-bottom: 30px;
} */
/* .flex-elements:not(:nth-child(3n)) {
  margin-right: 30px;
}
.flex-elements:not(:nth-last-child(-n + 3)) {
  margin-bottom: 30px;
} */
/* Алтернатива */
/* .flex-elements:nth-child(3n) {
  margin-right: 0px;
}
.flex-elements:nth-last-child(-n + 3) {
  margin-bottom: 0;
} */
/*=======END FLEX-1=======*/

/*=======Переменные для карточек=======*/
:root {
  --page-bg-color: #cccccc;
  --page-bg-secondary-color: teal;
  --primary-text-color: #212121;
  --card-set-gap: 20px;
  --card-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
}

body {
  background-color: var(--page-bg-color);
  color: var(--primary-text-color);
  line-height: 1.5;
}

/*=======FLEX-CARDS=======*/
.flex-cards {
  background-color: var(--page-bg-color);
}

/* CARDS-SET */
.card-set {
  margin: 0;
  padding: 0;
  list-style: none;

  display: flex;
  flex-wrap: wrap;

  margin-left: calc(-1 * var(--card-set-gap));
  margin-top: calc(-1 * var(--card-set-gap));
}

.card-set > .item {
  flex-basis: calc(100% / 3 - var(--card-set-gap));
  margin-left: var(--card-set-gap);
  margin-top: var(--card-set-gap);
}
/* END CARDS-SET */

/* CARD */
.card-thumb > img {
  max-width: 100%;
  height: auto;
}
.card-content {
  padding: 10px;
}
.dark-teame {
  text-align: center;
  color: teal;
  font-style: italic;
  text-decoration: underline;
}
.card-heading {
  margin-bottom: 15px;
}
.card {
  box-shadow: var(--card-shadow);
  border-radius: 5px;
  overflow: hidden;
}
/* END CARD */

/*=======END FLEX-CARDS=======*/

/*=======TRANSFORM 2D=======*/

.container-transform {
  background-color: var(--page-bg-secondary-color);

  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.box {
  width: 250px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-left: 5px;
  margin-right: 5px;
  box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
}

.box::before {
  font-size: 20px;
}

.box:nth-child(1) {
  /*   transform: translateX(50px); */

  animation: animateX50 3000ms infinite 1000ms;
  background-color: orange;
}

.box:nth-child(1)::before {
  content: 'translateX(50px)';
}

.box:nth-child(2) {
  /*   transform: translateY(110px); */

  animation: animateY110 3000ms infinite 1000ms;
  background-color: #03a9f4;
}

.box:nth-child(2)::before {
  content: 'translateY(110px)';
}

.box:nth-child(3) {
  /*   transform: translate(-50px, -100px); */

  animation: animateX50Y100 3000ms infinite 1000ms;
  background-color: palevioletred;
}

.box:nth-child(3)::before {
  content: 'translate(-50px, -100px)';
}

@keyframes animateX50 {
  0% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(50px);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes animateY110 {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(110px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes animateX50Y100 {
  0% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-50px, -100px);
  }

  100% {
    transform: translate(0, 0);
  }
}
/*=======END TRANSFORM 2D=======*/

/*=======Абсолютное позиционирование=======*/
.position-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.position-container .container {
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.thumb {
  position: relative;
  margin: 10px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);

  width: 370px;
}

.thumb > .label {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  padding: 8px 16px;
  border-bottom-left-radius: 4px;

  font-family: sans-serif;
  font-size: 24px;
  background-color: #2196f3;
  color: #fff;
}
/*=======END Абсолютное позиционирование=======*/

/*=======Абсолютное позиционирование с фиксированой иконкой=======*/
.section-icon {
  background-color: teal;
}
.chat-button {
  position: fixed;
  right: 30px;
  bottom: 30px;

  display: inline-block;
  width: 80px;
  height: 80px;

  margin: 0;
  padding: 0;
  border: none;
  background-color: transparent;

  background-image: url('https://image.flaticon.com/icons/svg/2925/2925365.svg');
  background-size: contain;

  cursor: pointer;
}
/*======= END Абсолютное позиционирование с фиксированой иконкой=======*/

/*=======Липкие заголовки=======*/
.section-title {
  position: sticky;
  top: -1px;

  margin: 0;
  padding: 16px;
  background-color: #ccc;
  text-align: center;

  box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2),
    0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
}

.section-text {
  font-size: 18px;
  margin-bottom: 0;
}

.section:nth-child(1) .section-title {
  color: #fff;
  background-image: repeating-linear-gradient(
    -45deg,
    #606dbc,
    #606dbc 10px,
    #465298 10px,
    #465298 20px
  );
}

.section:nth-child(2) .section-title {
  background-image: repeating-linear-gradient(
    to right,
    #f6ba52,
    #f6ba52 10px,
    #ffd180 10px,
    #ffd180 20px
  );
}

.section:nth-child(3) .section-title {
  color: #fff;
  background-image: repeating-radial-gradient(
    circle,
    purple,
    purple 10px,
    #4b026f 10px,
    #4b026f 20px
  );
}

.section:nth-child(4) .section-title {
  color: #fff;
  background-image: repeating-linear-gradient(
    to right,
    #ff8a00,
    #ff8a00 10px,
    #e52e71 10px,
    #e52e71 20px
  );
}
/*=======END Липкие заголовки=======*/

/*=======Декоративный оверлей=======*/
.section-overlay {
  background-color: teal;
}

h1 {
  text-align: center;
  font-size: 24px;
  color: #ffffff;
}

.overlay-box {
  position: relative;
  width: 300px;
  height: 300px;
  margin-left: auto;
  margin-right: auto;
  background-color: #bdbdbd;
  box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);

  overflow: hidden;
}

.overlay-box:hover .overlay {
  transform: translatex(0);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #3f51b5;

  transform: translatex(-100%);
  transition: transform 250ms ease;
}

.overlay > p {
  color: #fff;
  padding: 10px;
  margin: 0;
  font-size: 18px;
}

.overlay code {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 2px;
  background-color: #fff;
  color: #2a2a2a;
}
/*=======END Декоративный оверлей=======*/

/*=======Кнопка с переходом=======*/
.transition .container {
  text-align: center;
}
.btn-transition {
  display: inline-flex;
  border: none;
  padding: 10px 30px;
  border-radius: 3px;
  background-color: #008080;
  color: #ffffff;
  font: inherit;
  cursor: pointer;

  /* Полная запись
  transition-property: background-color;
  transition-duration: 250ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: 500ms; для задержки перехода */

  /* Можно делеть переход на нескольство свойст. Задаём через запятую (color и т.д..)  */
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-transition:hover,
.btn-transition:focus {
  background-color: tomato;
}
/*=======END Кнопка с переходом=======*/

/*=======Кнопка с иконкой=======*/
.btn-icon {
  position: relative;
  display: inline-flex;
  border: none;
  margin: 0;
  padding: 10px 30px;
  border-radius: 3px;
  background-color: #008080;
  color: #ffffff;
  font: inherit;
  cursor: pointer;

  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);

  overflow: hidden;
}
.btn-icon:hover,
.btn-icon:focus {
  background-color: orange;
}

.icon-left {
  margin-right: 5px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-icon:hover .icon-left,
.btn-icon:focus .icon-left {
  transform: translateY(-35px);
}
.icon-right {
  position: absolute;

  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);

  transform: translateY(calc(-50% + 50px));
}
.btn-icon:hover .icon-right,
.btn-icon:focus .icon-right {
  transform: translateY(0);
}
/*=======END Кнопка с иконкой=======*/

/*=======Нижний псевдоелемент=======*/
.menu {
  display: flex;
  justify-content: space-between;
}
.menu-item:not(:last-child) {
  margin-right: 20px;
}
.menu-link {
  position: relative;

  padding: 20px 30px;
  color: teal;
}
.menu-link::after {
  content: '';

  position: absolute;
  left: 0;
  bottom: 0;

  display: block;
  width: 100%;
  /* width: 0%; */
  height: 5px;
  border-radius: 5px;
  background-color: red;

  /* opacity: 0; */

  transform: scaleX(0);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Можно анимировать width и transform  */
}

.menu-link:hover::after,
.menu-link:focus::after {
  /* width: 100%; */
  /* opacity: 1; */
  transform: scaleX(1);
}
/*=======END Нижний псевдоелемент=======*/

/*=======FORM=======*/
textarea {
  resize: none;
  padding: 10px;
  border-radius: 4px;
}

.section-form {
  background-color: teal;
}

.form {
  width: 600px;
  margin: 0 auto;
  padding: 40px;
  border-radius: 4px;
  background-color: #ffffff;
}
.form-field {
  position: relative;
  display: block;
  margin-bottom: 40px;
}

.form-label {
  position: absolute;
  top: 50%;
  left: 40px;

  transition: transform 250ms linear, color 250ms linear;
  transform: translateY(-50%);
}

.form-input {
  width: 100%;
  padding: 10px 20px;
  margin-top: 5px;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding-left: 40px;
  transition: 250ms linear;
}
.form-input:focus-within {
  border: 1px solid teal;
  outline: none;
}
.form-input::placeholder {
  color: #2a2a2a2a;
}
.icon {
  position: absolute;
  top: 50%;
  left: 10px;

  transition: fill 250ms linear;
  transform: translateY(-50%);

  display: inline-block;
}
.form-field:focus-within .icon {
  fill: teal;
}
.form-field:focus-within .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  transform: translateY(-45px);
  color: teal;
}

.group {
  margin-bottom: 20px;
}
.group-title {
  margin-bottom: 20px;
}
/* .topic-options input[type='checkbox'] {
  width: 40px;
  height: 40px;
  margin-right: 10px;
} */

/* Checkbox */
.checkbox-input {
  position: absolute !important;
  clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden;
}
.checkbox-field {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
}
.checkbox-icon {
  display: inline-block;
  width: 15px;
  height: 16px;
  border: 2px solid #000000;
  border-radius: 4px;
  margin-right: 10px;

  transition: all 250ms linear;
}
.checkbox-input:checked + .checkbox-icon {
  background-image: url(../images/check.svg);
  background-color: #188ce8;
  background-origin: border-box;
  background-size: contain;
  border-color: transparent;
}
.checkbox-input:focus + .checkbox-icon {
  box-shadow: 0 0 0 0.1em #188ce8, 0 0 0 0.2em teal;
}
.checkbox-input:disabled + .checkbox-icon {
  border: 2px solid #ccc;
}
.checkbox-input:checked:disabled + .checkbox-icon {
  background-color: #ccc;
}
.checkbox-label {
  transition: transform 250ms linear;
}
.checkbox-input:checked ~ .checkbox-label {
  transform: translateX(10px);
}

/* radio */
.expiriance-option {
  display: flex;
}
.expiriance-item {
  margin-right: 20px;
}
.expiriance-label {
  font-size: 25px;
}
.expiriance-input {
  width: 20px;
  height: 20px;
}

/* data and textarea */
.data-field,
.file-field,
.coment-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.date {
  border: 1px solid tomato;
  border-radius: 6px;
  color: inherit;
  padding: 15px;
}
.data-label,
.file-label,
.coment-label {
  margin-bottom: 10px;
  font-style: italic;
}
.contact-form-title {
  margin-bottom: 10px;
}
.select {
  margin-bottom: 20px;
}
.btn-container {
  display: flex;
  justify-content: center;
}
.submit-btn {
  margin-right: 10px;
}

button {
  padding: 10px;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0px 3px 1px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.08),
    0px 2px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 250ms linear;
}
button:disabled {
  background-color: #ccc;
}
button:hover,
button:focus {
  background-color: yellowgreen;
}
.submit-btn {
  background-color: teal;
}
.reset-btn {
  background-color: tomato;
}
/*=======END FORM=======*/
