*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Цвета по умолчанию (светлая тема) */
  --color-bg: #ffffff;
  --color-text: #161616;
  --color-border: #161616;
  --color-link: #424242;
  --color-overlay: rgba(0, 0, 0, 0.7);
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --padding: 5px;
  --gap: 5px;
  --border: 1px solid var(--color-border);
  --border-radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 18px;
  overflow-x: hidden; /* предотвращает горизонтальный скролл */
  background-image: url(../images/mathematic-background.jpg);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  position: relative;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.button {
  padding: var(--padding);
  border-radius: var(--border-radius);
  border: 2px solid #3B5998;
  background-color: #3B5998;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: .3s;
}

.button:hover {
  border: 2px solid #3B5998;
  background-color: #fff;
  color: #3B5998;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--padding);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  left: 0;
  background: var(--color-bg); /* обязательно для z-index */
  z-index: 2; /* ↑ выше, чем у мобильного меню */
}

.logo {
  font-size: 18px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--padding);
}

.section {
  padding: var(--padding);
}

/* Главная секция - 1 */
.section-present {
  display: flex;
  flex-direction: row;
  /* justify-content: center;
  align-items: center; */
  gap: calc(var(--gap) * 4);
  width: 1200px;
  margin: 0 auto;
}

.author-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 300px;
  min-width: 300px;
  margin: 0 auto;
  padding: calc(var(--padding) * 2);
  background-color: #ffffff;
  border: var(--border);
  border-radius: var(--border-radius);
  background-image: url(../images/tetrad-v-kletochku.avif);
  background-repeat: no-repeat;
  background-size: cover;

}

.author-block__author-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--border-radius) * 2);
  border: var(--border);
}

.author-block__author-data-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.author-block__author-about-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.author-block__box {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 10px 5px;
  background-color: #fff;
  border: var(--border);
  border-radius: var(--border-radius);
}

.author-block__box_only-mobile {
  display: none;
}

.author-block__box_only-pc {
  display: block;
}

.author-block__author-name {
  font-size: 38px;
  line-height: 48px;
  font-weight: 800;
  text-align: center;
}

.author-block__author-title {
  text-align: center;
  font-size: 17px;
  line-height: 17px;
  font-weight: 500;
}

.author-block__bonus {
  text-align: center;
  font-size: 17px;
  line-height: 17px;
  font-weight: 500;
  color: red;
}

.author-block__author-contacts-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.author-block__author-contacts-block_width-660px {
  display: none;
}

.author-block__tel-link {
  text-decoration: none;
  display: block;
  padding: var(--padding);
  border: var(--border);
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 600;
  background-color: rgb(136, 249, 136);
}

.author-block__button-contact {

}

/* 2-й блок где перечислены курсы и услуги ----------- */
.service-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  background-color: #fff;
  padding: calc(var(--padding) * 2);
  border: var(--border);
  border-radius: var(--border-radius);
  background-image: url(../images/tetrad-v-kletochku.avif);
}

.service-block__title {
  text-transform: uppercase;
  text-align: center;
}

.service-block__under-title-box {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap) * 2);
  padding: calc(var(--padding) * 2);
  border: var(--border);
  border-radius: var(--border-radius);
  background-color: #fff;
}

.service-block__under-title {
  display: flex;
  flex-direction: row;
  gap: var(--gap);
  align-items: center;
  padding: 0 0 0 20px;
  font-size: 22px;
  line-height: 22px;
}

.service-block__under-title-emoji {
  padding: 2px 0 0 0;
  font-size: 14px;
}

.service-block__list {
  list-style-type: none;
  display: flex;
  flex-direction: row;
  gap: calc(var(--gap) * 2);
}

.servise-block-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: auto;
  padding: var(--padding);
  border: var(--border);
  border-radius: var(--border-radius);
  background-color: #fff;
}

.servise-block-item__title {
  text-align: center;
}

.servise-block-item__description {

}

.servise-block-item__button {
  margin: 10px 0 0 0;
}

/* course-block -----------------------------------------*/
.course-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.course-block__title {

}

.course-block__list {
  flex: 1;
  /* list-style-type: none; */
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.course-block__item {
  margin: 0 0 0 30px;
  font-size: 14px;
}

.screen {
  display: none;
}

.screen_active {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: #efefefa6;
  position: fixed;
}

.screen__content {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 400px;
  padding: calc(var(--padding) * 2);
  border-radius: var(--border-radius);
  border: var(--border);
  background-color: #fff;
}

.screen__header {
  display: flex;
  flex-direction: row;
  justify-content: end;
}

.screen__header-button-close {
  text-transform: uppercase;
  font-weight: 500;
  border: none;
  background-color: transparent;
  color: #3B5998;
  cursor: pointer;
  transition: .3s;
}

.screen__header-button-close:hover {
  color: red;
}

.screen-body {

}

.screen-form {
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap) * 1);
}

.screen-form__title {
  padding: 20px 0;
  text-align: center;
  text-transform: uppercase;
  font-size: 20px;
  line-height: 20px;
}

.screen-form__input-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.screen-form__input {
  padding: calc(var(--padding) * 2);
  border-radius: var(--border-radius);
  border: var(--border);
}

.screen-form__input-error {
  visibility: hidden;
}

.screen-form__input-error_active {
  visibility: visible;
  padding: 0 0 0 5px;
  font-size: 14px;
  line-height: 14px;
  color: red;
}

/* Блок с согласием */
.screen-form__agreement {
  margin-top: 20px;
  width: 100%;
}

/* Кастомный чекбокс */
.agreement-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  line-height: 1.4;
}

.agreement-checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.agreement-checkbox__custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
  background: white;
  transition: all 0.2s ease;
  position: relative;
  margin-top: 1px;
}

.agreement-checkbox__input:checked + .agreement-checkbox__custom {
  background: #4CAF50;
  border-color: #4CAF50;
}

.agreement-checkbox__input:checked + .agreement-checkbox__custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agreement-checkbox__text {
  color: #666;
  font-size: 12px;
}

.agreement-link {
  color: #4CAF50;
  text-decoration: none;
  border-bottom: 1px dashed #4CAF50;
  transition: all 0.2s ease;
}

.agreement-link:hover {
  color: #45a049;
  border-bottom-style: solid;
}

/* Валидация при отправке (опционально) */
.screen-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.screen__footer {

}

.footer {
  padding: var(--padding);
  border-top: var(--border);
  text-align: center;
  color: var(--color-text);
  background-color: #fff;
}

/* ===== Адаптивность ===== */
@media screen and (max-width: 1220px) {
  .section-present {
    flex-direction: column;
    gap: var(--gap);
    width: 100%;
  }

  .author-block {
    flex-direction: row;
    width: 100%;
  }

  .author-block__author-photo {
    align-self: flex-start;
    width: 25%;
    min-width: 216px;
    /* max-height: 216px; */
  }

  .author-block__author-data-block {
    flex: 1;
    justify-content: space-between;
  }

  .author-block__author-contacts-block {
    flex-direction: row;
    justify-content: end;
  }
}

@media screen and (max-width: 764px) {
  .service-block__under-title-emoji {
    /* padding: 0 0 5px 0; */
    align-self: flex-start;
    font-size: 20px;
  }
}

@media screen and (max-width: 660px) {
  .author-block__author-photo-block {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    justify-content: space-between;
  }

  .author-block__author-photo {
    width: 100%;
  }
  .author-block__author-contacts-block {
    display: none;
  }

  .author-block__author-contacts-block_width-660px {
    display: flex;
    flex-direction: column;
  }
}

@media screen and (max-width: 540px) {
  .author-block {
    flex-direction: column;
    width: 100%;
  }

  .author-block__box_only-mobile {
    display: block;
  }

  .author-block__box_only-pc {
    display: none;
  }

  .author-block__author-photo {
    width: 100%;
    max-height: auto;
  }

  .author-block__author-contacts-block {
    flex-direction: column;
    justify-content: center
  }

  .author-block__tel-link {
    flex: 1;
  }

  .service-block__list {
    flex-direction: column;
  }
}