/* font-family Roboto, Raleway*/

/* Використовуючи універсальний селектор * (вибирає всі елементи), значення border-box встановлюється для всіх елементів і псевдоелементів ::before та ::after документа (про них дізнаємося пізніше). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  color: #2e2f42;
  background-color: #fff;
  font-size: 16px;
  line-height: 1.5;
  padding-top: 72px;
}

a {
  text-decoration: none;
}

p {
  letter-spacing: 0.02em;
  color: #434455;
}

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

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

h1,
h2,
h3,
p {
  margin: 0;
}

.container {
  max-width: 1158px;
  padding: 0 15px;
  margin: 0 auto;
}

h2 {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;
    margin-bottom: 72px;
}

h3 {
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #2e2f42;
  margin-bottom: 8px;
}

/* HEADER */

.header {
  background-color: #fff;
  left: 0;
  top: 0;
  width: 100%;
  position: fixed;
  z-index: 12;
  border-bottom: 1px solid #e7e9fc;
  box-shadow: 0 1px 6px 0 rgba(46, 47, 66, 0.08), 0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 2px 1px 0 rgba(46, 47, 66, 0.08);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 76px;
}

.logo {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  display: block;
  margin: 0;
  line-height: 1.17;
  letter-spacing: 0.03em;
  color: #4d5ae5;
}

.logo-header-part {
  color: #2e2f42;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 40px;

}

.nav-link {
  position: relative;
  display: block;
  padding: 24px 0;
  font-weight: 500;
  color: #2e2f42;
  text-decoration: none;
  letter-spacing: 0.02em;

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

.nav-link:hover,
.nav-link:focus {
  color: #404bbf;
}

.nav-link.current {
  color: #404bbf;
  position: relative;
}

.nav-link.current::after {
  content: "";
  position: absolute;
  left: 0;
  /* Чому саме bottom: -1px

у header є border-bottom: 1px solid #e7e9fc

-1px візуально ставить лінію рівно над бордером

це стандартний прийом у макеті WebStudio
*/ 
  bottom: -1px;
  display: block;

  width: 100%;
  height: 4px;
  border-radius: 2px;
  transition: 
  background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #404bbf;
}

.address {
  font-style: normal;
}

.address-list {
  display: flex;
  gap: 40px;
}

.address-nav {
  display: inline-block;
  color: #434455;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: 
  color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.address-nav:hover,
.address-nav:focus {
  color: #404bbf;
}

/* HERO */

.main-hero {
  margin: 0 auto;
/*  padding-top: 72px; */
}

.hero-bg {
  padding: 188px 0;
  text-align: center;
  max-width: 1440px;
  margin: 0 auto;
  /* height: 600px; */

  background-color: #2e2f42;
  background-image:
    linear-gradient(rgba(46,47,66,0.7), rgba(46,47,66,0.7)),
    url(../images/people-office.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.main-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

h1 {
  font-size: 56px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  max-width: 496px;
  line-height: 1.07;
  letter-spacing: 0.02em;
}

.hero-button {
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: #4d5ae5;
  color: #fff;
  padding: 16px 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;

  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;

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

.hero-button:hover,
.hero-button:focus {
  background-color: #404bbf;
}

/* FEATURES */

.features {
  padding: 120px 0;
}

.features .container {
  display: block; 
  /* flex;
  align-items: center;
  gap: 48px; */
}

.features-list {
  display: flex;
  gap: 24px;
}

.features-item {
  width: calc((100% - 72px) / 4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.box {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  background-color: #f4f4fd;
  border: 1px solid #8e8f99;
  border-radius: 4px;
  width: 264px;
  height: 112px;
  margin-bottom: 8px;
}

/* TEAM */

.team {
  background-color:  #f4f4fd;
  padding: 120px 0;
}

.team-title {
  text-align: center;
}

.team-list {
  display: flex;
  gap: 24px;
}

.team-part {
  width: calc((100% - 72px) / 4);
  border-radius: 0 0 4px 4px;
  background-color: #fff;
  box-shadow: 0 2px 1px 0 rgba(46, 47, 66, 0.08), 0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 1px 6px 0 rgba(46, 47, 66, 0.08);
}

.team-part img {
  width: 264px;
  height: 260px;
}

.border-team {
  padding: 32px 16px;
  text-align: center;
}

.list-social-media {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-top: 8px;
}

/*
.list-social-media:hover,
.list-social-media:focus {
  color: #404bbf;
} */

.list-social-media .link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color:  #4d5ae5;

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

.list-social-media .link:hover,
.list-social-media .link:focus {
  background-color: #404bbf;
}

.team-icon {
  fill: #f4f4fd;
}

/* PORTFOLIO */

.portfolio {
  padding: 120px 0;
}

.grid-list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
}

.portfolio-part {
  width: 360px;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-part:hover {
  box-shadow:
  0px 2px 1px 0px rgba(46, 47, 66, 0.08),
  0px 1px 1px 0px rgba(46, 47, 66, 0.16),
  0px 1px 6px 0px rgba(46, 47, 66, 0.08);
}

.portfolio-part:hover .overlay {
  transform: translateY(0);
}

.img-wrapper {
  position: relative;
  overflow: hidden;
}

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

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

.overlay p {
  font-family: "Roboto", sans-serif;
  color: #f4f4fd;
  font-weight: 400;
  font-size: 16px;

  line-height: 1.5;
  letter-spacing: 0.02em;

  padding: 40px 32px;
}

.portfolio-part img {
  width: 360px;
}

.border-portfolio {
  border: 1px solid #e7e9fc;
  border-top: none;
  padding: 32px 16px;
}

/* FOOTER */

.footer {
  background-color: #2e2f42;
  padding: 100px 0;
}

.footer .container {
  display: flex;
  align-items: baseline;
}

.footer-left {
  display: flex;
  gap: 120px;
}

.footer-text {
  color: #f4f4fd;
  width: 264px;
}

.footer-logo {
  margin-bottom: 16px;
}

.footer-logo-part-two {
  color: #f4f4fd;
}

.footer-social-media {
  font-weight: 500;
  font-size: 16px; 
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;
}

.footer-icon {
  fill: #f4f4fd;
}

.footer .list-social-media {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-top: 16px;
}


/* .footer-social-media .link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color:  #4d5ae5;

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

.footer .list-social-media .link:hover,
.footer .list-social-media .link:focus {
  background-color: #31d0aa;
}
.footer-form-wrapper {
  margin-left: auto;
}

.footer-form-title {
  margin-bottom: 16px;
  font-weight: 500;
  color: #fff;
}

.footer-form {
  display: flex;
  gap: 24px;
}
/*
.footer-form {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer-label {
  display: flex;
  flex-direction: column;

  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 16px;
 
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;
}
  */
/*
.footer-label:focus-within {
  color: #009688;
}*/
.footer-input {
  border: 1px solid #fff;
  background-color: transparent;
  border-radius: 4px;
  width: 264px;
  height: 40px;

  font-weight: 400;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: #fff;
  background-color: #2e2f42;
  padding: 16px;
  outline: none;

  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15); 
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-input:hover,
.footer-input:focus {
  border-color: #31d0aa;
}


.footer-input::placeholder {
  color: #fff;
}
.footer-input:hover,
.footer-input:focus {
  outline: none;
}
.footer-thumb-form {
  display: flex;
  flex-direction: row;
  gap: 24px;
}
.footer-form-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 16px;
  border-radius: 4px;
  padding-block: 8px;
  padding-inline: 24px;
  width: 165px;
  height: 40px;
  background: #4d5ae5;
  border: none;

  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: #fff;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-form-btn:hover,
.footer-form-btn:focus {
  background-color: #31d0aa;
}

.footer-btn-svg {
  width: 24px;
  height: 24px;
}


/* MODAL WINDOW*/

.backdrop {
  position: fixed;
  background-color: rgba(46, 47, 66, 0.4);
  width: 100%;
  height: 100%;
  z-index: 999;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center; 

  opacity: 0;
  visibility: hidden;

  pointer-events: none;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);

}
.backdrop.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal {
  padding: 72px 24px 24px 24px; /* зверху 72px, з боків і знизу 24px */
  position: relative; /* щоб кнопка закриття могла залишатися абсолютною відносно модалки */
  border-radius: 4px;
  width: 408px;
  height: 584px;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 2px 1px 0 rgba(0, 0, 0, 0.2);
  background-color: #fcfcfc;
}
.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 24px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  background-color:  #e7e9fc;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.close-btn:hover,
.close-btn:focus {
background-color: #404bbf;
}

.close-icon {
  width: 100%;
  height: 100%;
  fill: #2E2F42;
  transition:
  fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.close-btn:hover .close-icon,
.close-btn:focus .close-icon {
  fill: #fff;
}
.modal-title {
  margin: 0 auto;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 16px;

  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;
  margin-bottom: 16px;
}
.modal-form {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  /* gap: 12px;  тепер між comment та i accept policy буде 12 пікселів +геп 4 пікселя = 16пікселів*/
  border-radius: 4px;
  width: 360px;
  height: 336px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;   /* 4px між label та input */
  margin-bottom: 8px;
  /* gap — працює між дітьми всередині flex-контейнера

margin-bottom — працює між самими контейнерами */
}

/* 16px між textarea і policy

Оскільки textarea знаходиться всередині .modal-field,
нам потрібно просто змінити відступ останнього поля. */
.modal-field:last-of-type {
  margin-bottom: 16px;
}
.modal-label {
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  font-size: 12px;
 
  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: #8e8f99;
}
.modal-thumb-form {
  resize: none;
  width: 360px;

  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: row;
  gap: 8px; /* було 4 піксля */
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  padding-left: 38px; /* щоб текст не залазив на іконку */
  outline: transparent;
  
  font-weight: 400;
  font-size: 12px;

  line-height: 24; /*24px*/
  letter-spacing: 0.04em;
  padding-left: 38px;
  
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);

 /* width: 360px; */
}
.modal-input:focus {
  outline: none;
  border-color: #4d5ae5; /* акцентний колір при фокусі */
  box-shadow: 0 0 0 2px rgba(77, 90, 229, 0.2); /* легкий ефект навколо */
}
.modal-btn-svg {
  position: absolute;

  left: 16px;      /* відступ зліва */
  top: 50%;
  transform: translateY(-50%); /* центруємо по вертикалі */
  
  width: 18px;
  height: 24px;
  fill: #2E2F42;

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

/* hover по всьому полю */
.modal-thumb-form:hover .modal-btn-svg {
  fill: #4d5ae5;
}

/* focus у середині (клік / tab) */
.modal-thumb-form:focus-within .modal-btn-svg {
  fill: #4d5ae5;
}

/* і бордер інпута теж */
.modal-thumb-form:hover .modal-input,
.modal-thumb-form:focus-within .modal-input {
  border-color: #4d5ae5;
}

.modal-comment {

}
.modal-input-comment {
  letter-spacing: 0.04em; 
  /*padding: 16px;*/
  /*margin-bottom: 16px; Відступ між textarea та чекбоксом */

  width: 100%;
  height: 120px;
  resize: none;

  border: 1px solid rgba(46, 47, 66, 0.4); /* нейтральний */
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #2e2f42;
  background-color: #fff;

  transition: 
  border-color 250ms cubic-bezier(0.4, 0, 0.2, 1), 
  box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-input-comment:focus {
  outline: none;
  border-color: #4d5ae5; /* акцентний колір при фокусі */
  box-shadow: 0 0 0 2px rgba(77, 90, 229, 0.2);
}
.modal-thumb-confirm { /* чекбокс і текст на одному рівні */
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 24px;/* відступ до кнопки */
  /*margin-top: 8px; */
}

.modal-label-confirm {
  /* Відступ між лейблом конфірм та кнопкою */
  display: block; /* щоб margin-bottom працював на блоковому елементі */
  /*margin-bottom: 24px;  відступ до кнопки Send */
  
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  font-size: 12px;

  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: #8e8f99;
}
.custom-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 16px;
  height: 16px;

  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 2px;
  margin-right: 8px; /* горизонтальний відступ до тексту */

  transition: 
  background-color 250ms cubic-bezier(0.4,0,0.2,1),
  border 250ms cubic-bezier(0.4,0,0.2,1);
}
.check-svg {
  width: 100%; /* 10px */
  height: 100%; /* 8px */

  opacity: 0;
  fill: #fff;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
/*
Те, що через +, — це сусідній селектор (adjacent sibling combinator).
*/
.modal-input-confirm:checked 
+ .modal-label-confirm 
.custom-checkbox {
  background-color: #404bbf;
  border: none;
}
.modal-input-confirm:focus 
+ .modal-label-confirm 
.custom-checkbox {
  border-color: #404bbf;
}
.modal-input-confirm:checked 
+ .modal-label-confirm 
.custom-checkbox 
.check-svg {
  opacity: 1;
}

.modal-confirm-link {
  line-height: 1.33333;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: #4d5ae5;
}
.modal-send {
  border: none;

  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 16px;

  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #fff;

  display: flex;
  align-self: center; /*відцентрувати кнопку */
  align-items: flex-start;
  justify-content: center;
  flex-direction: row;
  
  border-radius: 4px;
  padding-block: 16px;
  padding-inline: 32px;
  width: 169px;
  height: 56px;
  background-color: #4d5ae5;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  transition: 
  background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
  box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-send:hover,
.modal-send:focus {
  background-color: #404bbf;
  box-shadow:
  0px 2px 1px 0px rgba(46, 47, 66, 0.08),
  0px 1px 1px 0px rgba(46, 47, 66, 0.16),
  0px 1px 6px 0px rgba(46, 47, 66, 0.08);
}
