.header {
  --public-header-height: 80px;
  position: relative;
  z-index: 1100;
  padding: 11px 0;
  border-bottom: 1px solid #d9e5ef;
  background: #fff;
  box-shadow: 0 5px 18px rgba(26, 59, 92, .06);
}

.header .container {
  display: flex;
  max-width: 1320px;
  align-items: center;
  gap: 20px;
  padding-right: 24px;
  padding-left: 24px;
}

.header .logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #1e3147;
  text-decoration: none;
}

.header .logo img {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.header .logo p {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .015em;
  line-height: 1.12;
}

.header .header-nav {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.header .menu {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header .menu > li {
  width: auto;
  flex: 0 0 auto;
  align-items: stretch;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.header .menu > li > a,
.header .menu .dropdown-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #40556b;
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}

.header .menu > li > a:hover,
.header .menu > li > a:focus,
.header .menu .dropdown-toggle:hover,
.header .menu .dropdown-toggle:focus,
.header .menu .dropdown-toggle[aria-expanded="true"] {
  background: #edf5fc;
  color: #1f6eb6;
  text-decoration: none;
}

.header .menu .dropdown-toggle::after {
  width: 7px;
  height: 7px;
  margin: -3px 1px 0 8px;
  border: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: none;
  content: "";
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.header .menu .dropdown-toggle[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

.header .dropdown {
  position: relative;
}

.header .dropdown::after {
  display: none;
}

@media (min-width: 1200px) {
  .header .dropdown::after {
    position: absolute;
    top: 100%;
    left: 0;
    display: block;
    width: 100%;
    height: 8px;
    content: "";
  }
}

.header .dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: block;
  min-width: 225px;
  max-height: min(68vh, 520px);
  margin: 0;
  padding: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(22, 55, 88, .16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: none;
}

.header .dropdown:last-of-type .dropdown-menu {
  right: 0;
  left: auto;
  min-width: 245px;
}

.header .dropdown .dropdown-menu.show,
.header .dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.header .dropdown .dropdown-menu li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.35;
}

.header .dropdown .dropdown-menu a,
.header .dropdown .dropdown-menu .dropdown-item {
  display: flex;
  min-height: 39px;
  align-items: center;
  margin: 0 !important;
  padding: 8px 11px 8px 14px !important;
  border-left: 3px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #30475e;
  font-weight: 600;
  white-space: normal;
}

.header .dropdown .dropdown-menu li:hover > a,
.header .dropdown .dropdown-menu li:focus-within > a,
.header .dropdown .dropdown-menu a:hover,
.header .dropdown .dropdown-menu a:focus {
  border-left-color: #2f7cc1 !important;
  background: #e3f0fb !important;
  color: #175f9e !important;
  outline: none;
}

.header .buttons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 14px;
}

.header .buttons .btn {
  display: inline-flex;
  min-width: 92px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 9px 16px;
  border-radius: 9px;
  box-shadow: none;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.2;
}

.header .menu-btn,
.header .menu-backdrop {
  display: none;
}

.header .menu-btn:focus-visible,
.header .menu .dropdown-toggle:focus-visible,
.header .menu a:focus-visible,
.header .buttons .btn:focus-visible {
  outline: 3px solid rgba(47, 124, 193, .36);
  outline-offset: 2px;
}

@media (min-width: 1200px) and (max-width: 1320px) {
  .header .container {
    gap: 12px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .header .logo img {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .header .logo p {
    font-size: 11px;
  }

  .header .menu > li {
    font-size: 14px;
  }

  .header .menu > li > a,
  .header .menu .dropdown-toggle {
    padding-right: 8px;
    padding-left: 8px;
  }

  .header .buttons {
    gap: 6px;
    margin-left: 8px;
  }

  .header .buttons .btn {
    min-width: 82px;
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 1199px) {
  .header {
    --public-header-height: 76px;
    min-height: var(--public-header-height);
    padding: 10px 0;
  }

  .header .container {
    max-width: none;
    gap: 12px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .header .logo {
    position: relative;
    z-index: 1103;
  }

  .header .logo img {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .header .logo p {
    font-size: 11px;
  }

  .header .menu-btn {
    position: relative;
    z-index: 1103;
    display: block;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin: 0 0 0 auto;
    padding: 0;
    border: 1px solid #cbddeb;
    border-radius: 11px;
    background: #edf5fc;
    box-shadow: none;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease;
  }

  .header .menu-btn:hover,
  .header .menu-btn:focus,
  .header .menu-btn.active {
    border-color: #82b2da;
    background: #dcecf9;
  }

  .header .menu-btn span,
  .header .menu-btn.active span {
    position: absolute;
    left: 11px;
    display: block;
    width: 20px;
    height: 2px;
    margin: 0;
    border-radius: 999px;
    background: #174d7d;
    opacity: 1;
    transform: none;
    transition: top .18s ease, transform .18s ease, opacity .18s ease;
  }

  .header .menu-btn span:nth-child(1) {
    top: 14px;
  }

  .header .menu-btn span:nth-child(2) {
    top: 21px;
  }

  .header .menu-btn span:nth-child(3) {
    top: 28px;
  }

  .header .menu-btn.active span:nth-child(1),
  .header .menu-btn.active span:nth-child(3) {
    top: 21px;
  }

  .header .menu-btn.active span:nth-child(1) {
    transform: rotate(45deg);
  }

  .header .menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .header .menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg);
  }

  .header .menu-backdrop {
    position: fixed;
    z-index: 1100;
    top: var(--public-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(17, 43, 68, .32);
    opacity: 0;
    visibility: hidden;
    cursor: default;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .header .header-nav {
    position: fixed;
    z-index: 1102;
    top: var(--public-header-height);
    right: 0;
    bottom: 0;
    left: auto;
    display: flex;
    width: min(430px, 100vw);
    min-width: 0;
    height: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    border-left: 1px solid #d4e2ed;
    background: #f5f9fd;
    box-shadow: -16px 0 34px rgba(18, 49, 78, .14);
    opacity: 0;
    visibility: hidden;
    overscroll-behavior: contain;
    transform: translateX(102%);
    transition: transform .22s ease, opacity .18s ease, visibility .22s ease;
  }

  .header.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .header.menu-open .header-nav {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }

  .header .menu {
    order: 2;
    display: flex;
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    margin: 0;
  }

  .header .menu > li {
    display: block;
    width: 100%;
    font-size: 15px;
    line-height: 1.3;
  }

  .header .menu > li > a,
  .header .menu .dropdown-toggle {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border: 1px solid #d8e5ef;
    border-radius: 10px;
    background: #fff;
    color: #29435c;
    box-shadow: 0 2px 7px rgba(29, 63, 95, .035);
    font-weight: 700;
  }

  .header .menu > li > a:hover,
  .header .menu > li > a:focus,
  .header .menu .dropdown-toggle:hover,
  .header .menu .dropdown-toggle:focus,
  .header .menu .dropdown-toggle[aria-expanded="true"] {
    border-color: #9bc1df;
    background: #eaf4fc;
    color: #1e68a7;
  }

  .header .menu .dropdown-toggle::after {
    display: block;
    flex: 0 0 8px;
    margin-right: 3px;
  }

  .header .dropdown .dropdown-menu {
    position: static;
    display: block;
    width: 100%;
    min-width: 0;
    max-height: 0;
    margin: 0;
    padding: 0 6px;
    overflow: hidden;
    border-color: transparent;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    transition: max-height .2s ease, margin .2s ease, padding .2s ease, opacity .16s ease;
  }

  .header .dropdown .dropdown-menu.show,
  .header .dropdown:hover .dropdown-menu.show {
    max-height: 560px;
    margin: 5px 0 1px;
    padding: 6px;
    overflow-y: auto;
    border-color: #d8e5ef;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .header .dropdown:hover .dropdown-menu:not(.show) {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .header .dropdown .dropdown-menu li,
  .header .dropdown .dropdown-menu li:last-child {
    margin: 0;
    font-size: 14px;
  }

  .header .dropdown .dropdown-menu a,
  .header .dropdown .dropdown-menu .dropdown-item {
    min-height: 40px;
    padding: 8px 11px !important;
  }

  .header .buttons {
    order: 1;
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d9e5ef;
  }

  .header .buttons .btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
  }
}

@media (max-width: 575px) {
  .header {
    --public-header-height: 64px;
    min-height: var(--public-header-height);
    padding: 9px 0;
  }

  .header .container {
    padding-right: 14px;
    padding-left: 14px;
  }

  .header .logo {
    gap: 5px;
  }

  .header .logo img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .header .logo p {
    font-size: 9px;
    line-height: 1.08;
  }

  .header .menu-btn {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 10px;
  }

  .header .menu-btn span,
  .header .menu-btn.active span {
    left: 10px;
  }

  .header .header-nav {
    width: 100vw;
    padding: 12px;
    border-left: 0;
    box-shadow: none;
  }

  .header .menu {
    gap: 5px;
  }

  .header .menu > li > a,
  .header .menu .dropdown-toggle {
    min-height: 46px;
    padding: 10px 12px;
  }

  .header .buttons {
    margin-bottom: 11px;
    padding-bottom: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header *,
  .header *::before,
  .header *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.modal-open .header {
  z-index: 1;
}
