/* Figma — страницы 404 / 500 */

.page-404 .page,
.page-500 .page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #00175e;
}

.page-404 .main,
.page-500 .main {
  flex: 0 0 auto;
  display: block;
  padding-top: 0;
}

.error-404 {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 800px;
  margin-top: calc(-1 * var(--header-height));
  overflow: hidden;
  background-color: #00175e;
}

.error-404__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.error-404__bg img {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: 2666px;
  height: 800px;
  max-width: none;
  transform: translateX(-50%);
  object-fit: cover;
  object-position: center;
}

.error-404__content {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 1440px;
  height: 800px;
  margin-inline: auto;
}

.error-404__title {
  position: absolute;
  top: 293px;
  left: 50%;
  box-sizing: border-box;
  width: 891px;
  max-width: calc(100% - var(--container-padding) * 2);
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 60px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
  color: #ffffff;
}

.error-404__text {
  position: absolute;
  top: 379px;
  left: 50%;
  box-sizing: border-box;
  width: 485px;
  max-width: calc(100% - var(--container-padding) * 2);
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
  color: #ffffff;
}

.error-404__btn {
  position: absolute;
  top: 463px;
  left: 50%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  width: 258px;
  height: 50px;
  padding: 0 4px 0 30px;
  transform: translateX(-50%);
  background-color: #ffffff;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.error-404__btn-text {
  flex: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: #0c3eb3;
  white-space: nowrap;
}

.error-404__btn-icon {
  display: block;
  flex: none;
  width: 8px;
  height: 8px;
  background-color: #0c3eb3;
  transition: background-color 0.2s ease;
}

.error-404__btn:hover,
.error-404__btn:focus-visible {
  background-color: #0c3eb3;
}

.error-404__btn:hover .error-404__btn-text,
.error-404__btn:focus-visible .error-404__btn-text {
  color: #ffffff;
}

.error-404__btn:hover .error-404__btn-icon,
.error-404__btn:focus-visible .error-404__btn-icon {
  background-color: #ffffff;
}

.error-404__br {
  display: none;
}

/* 1024 / 768 — Figma */
@media (min-width: 688px) and (max-width: 1024px) {
  .error-404__title {
    top: 290px;
    width: 877px;
    max-width: calc(100% - 148px);
    font-size: 60px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .error-404__text {
    top: 376px;
    width: 485px;
    max-width: calc(100% - 148px);
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .error-404__btn {
    top: 460px;
  }

  /* 500: длинный заголовок переносится на 2 строки */
  .page-500 .error-404__text {
    top: 436px;
  }

  .page-500 .error-404__btn {
    top: 526px;
  }
}

/* 375 — Figma: блок 700px по высоте, фон fon.webp на всю область */
@media (max-width: 687px) {
  .error-404,
  .error-404__content {
    height: 700px;
  }

  .error-404__bg img {
    top: 0;
    left: 50%;
    width: max(700px, calc(100% + 68px));
    height: 700px;
    max-width: none;
    transform: translateX(-50%);
    object-fit: cover;
    object-position: center top;
  }

  .error-404__title {
    top: 270px;
    width: 344px;
    max-width: calc(100% - 32px);
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .error-404__text {
    top: 313px;
    width: 292px;
    max-width: calc(100% - 84px);
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: 0;
  }

  .error-404__btn {
    top: 373px;
    width: 100%;
    max-width: 258px;
  }

  .error-404__br {
    display: inline;
  }
}
