:root {
  --portal-blue: #1766ac;
  --portal-ink: #172b40;
  --portal-footer: #10253d;
  --timo-header-height: 72px;
}

.portal-shell__container {
  width: min(calc(100% - 48px), 1280px);
  margin-inline: auto;
}

.timo-header.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e7edf2;
  box-shadow: 0 4px 18px rgba(18, 40, 63, 0.05);
  backdrop-filter: none;
}

.portal-shell__container.portal-header__inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 32px;
  min-height: var(--timo-header-height);
  gap: 20px;
}

.portal-header__brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  width: 140px;
}

.portal-header__brand img {
  width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.portal-header__nav {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 20px;
  align-self: stretch;
}

.portal-header__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: #35495c;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.2s ease;
}

.portal-header__link:hover,
.portal-header__link.is-active {
  color: var(--portal-blue);
}

.portal-header__link.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--portal-blue);
}

.portal-header__actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 16px;
  margin-left: auto;
}

.portal-header__search {
  position: relative;
  flex: none;
}

.portal-header__search-form--desktop {
  display: flex;
  align-items: center;
  width: 170px;
  height: 32px;
  border: 1px solid #e2e8ef;
  border-radius: 3px;
  background: #fff;
}

.portal-header__search-form--desktop:focus-within {
  border-color: #3e5ff2;
}

.portal-header__search-form--desktop button {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3e5ff2;
  cursor: pointer;
}

.portal-header__search-form--desktop input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--portal-ink);
  font: inherit;
  font-size: 14px;
}

.portal-header__search-mobile {
  display: none;
  position: relative;
}

.portal-header__search-mobile summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  color: var(--portal-ink);
  cursor: pointer;
  list-style: none;
}

.portal-header__search-mobile summary::-webkit-details-marker {
  display: none;
}

.portal-search-icon {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.portal-search-icon::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.portal-header__search-form--mobile {
  position: absolute;
  top: calc(100% + 14px);
  right: -16px;
  z-index: 60;
  display: flex;
  width: min(340px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid #dce6ef;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(18, 40, 63, 0.16);
}

.portal-header__search-form--mobile input {
  min-width: 0;
  flex: 1;
  padding: 9px 11px;
  border: 1px solid #dce6ef;
  border-radius: 3px 0 0 3px;
  font: inherit;
  font-size: 14px;
}

.portal-header__search-form--mobile button {
  flex: none;
  padding: 0 13px;
  border: 0;
  border-radius: 0 3px 3px 0;
  background: var(--portal-blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.portal-header__phone {
  flex: none;
  color: var(--portal-ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.portal-header__phone:hover {
  color: var(--portal-blue);
}

.portal-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: var(--timo-header-height);
  margin-right: -32px;
  padding: 0 22px;
  background: #3e5ff2;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.portal-header__cta:hover {
  background: #3051e0;
}

.portal-footer__contact-link span {
  font-size: 18px;
  line-height: 1;
}

.portal-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  border: 1px solid #dce6ef;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.portal-header__toggle span {
  width: 20px;
  height: 2px;
  background: var(--portal-ink);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.portal-header__toggle[aria-expanded='true'] span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.portal-header__toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.portal-header__toggle[aria-expanded='true'] span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.portal-mobile-nav {
  display: none;
}

.portal-header a:focus-visible,
.portal-header button:focus-visible,
.portal-header summary:focus-visible,
.portal-header input:focus-visible,
.portal-footer a:focus-visible {
  outline: 2px solid #3d98db;
  outline-offset: 3px;
}

.portal-header .portal-header__search-form--desktop input:focus-visible {
  outline: none;
}

.timo-footer.portal-footer {
  background: linear-gradient(rgba(9, 16, 32, 0.45), rgba(9, 16, 32, 0.56)), url('../images/bg2.jpg') center / cover no-repeat;
  color: #c1cfdb;
}

body[data-page-type='home'] .portal-footer {
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}

.portal-footer__main {
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) repeat(2, minmax(130px, 0.8fr)) minmax(210px, 1.15fr);
  gap: 46px;
  padding: 72px 0 66px;
}

.portal-footer__brand {
  max-width: 310px;
}

.portal-footer__logo {
  display: inline-flex;
  align-items: center;
  width: 174px;
}

.portal-footer__logo img {
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
}

.portal-footer__brand p {
  max-width: 270px;
  margin: 22px 0 0;
  color: #aebecd;
  font-size: 14px;
  line-height: 1.8;
}

.portal-footer__group {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.portal-footer__group h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.portal-footer__group a,
.portal-footer__group p {
  margin: 0;
  color: #b4c3d1;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.portal-footer__group a:hover,
.portal-footer__records a:hover {
  color: #fff;
}

.portal-footer__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px !important;
  color: #8cc8f3 !important;
  font-weight: 600;
}

.portal-footer__contact-link:hover {
  color: #fff !important;
}

.portal-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 30px;
  min-height: 70px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.portal-footer__bottom p,
.portal-footer__records a,
.portal-footer__records span,
.portal-footer__records > div {
  margin: 0;
  color: #90a5b8;
  font-size: 12px;
  line-height: 1.5;
}

.portal-footer__records {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.portal-footer__records > div {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.portal-footer__records a {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  white-space: nowrap;
}

.portal-footer__records img {
  width: 18px;
  height: 18px;
  flex: none;
  object-fit: contain;
}

@media (max-width: 1100px) {
  .portal-shell__container.portal-header__inner {
    gap: 14px;
  }

  .portal-header__nav {
    gap: 13px;
  }

  .portal-header__link {
    font-size: 14px;
  }

  .portal-header__actions {
    gap: 10px;
  }

  .portal-footer__main {
    gap: 28px;
  }
}

@media (max-width: 1000px) {
  .portal-header__nav,
  .portal-header__phone,
  .portal-header__cta {
    display: none;
  }

  .portal-header__search-form--desktop {
    display: none;
  }

  .portal-header__search-mobile {
    display: block;
  }

  .portal-header__actions {
    margin-left: auto;
  }

  .portal-header__toggle {
    display: flex;
    margin-left: 0;
  }

  .portal-mobile-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 12px max(24px, calc((100vw - 1280px) / 2));
    border-top: 1px solid #e7edf2;
    background: #fff;
    box-shadow: 0 14px 18px rgba(18, 40, 63, 0.08);
  }

  .portal-mobile-nav__link {
    display: block;
    padding: 12px 10px;
    color: #35495c;
    font-size: 15px;
    line-height: 1.35;
  }

  .portal-mobile-nav__link:hover,
  .portal-mobile-nav__link.is-active {
    color: var(--portal-blue);
  }

  .portal-mobile-nav__phone,
  .portal-mobile-nav__cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
  }

  .portal-mobile-nav__phone {
    color: var(--portal-ink);
  }

  .portal-mobile-nav__cta {
    justify-content: center;
    gap: 8px;
    border-radius: 4px;
    background: var(--portal-blue);
    color: #fff;
  }
}

@media (max-width: 960px) {
  .portal-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 32px;
    padding-block: 56px;
  }
}

@media (max-width: 640px) {
  :root {
    --timo-header-height: 68px;
  }

  .portal-shell__container {
    width: min(calc(100% - 32px), 1280px);
  }

  .portal-shell__container.portal-header__inner {
    padding-inline: 16px;
  }

  .portal-header__brand {
    width: 132px;
  }

  .portal-header__brand img {
    max-height: 50px;
  }

  .portal-header__search-form--mobile {
    position: fixed;
    top: calc(var(--timo-header-height) + 7px);
    right: 16px;
  }

  .portal-mobile-nav.is-open {
    grid-template-columns: 1fr;
    padding: 8px 16px 16px;
  }

  .portal-mobile-nav__link {
    padding: 11px 0;
    border-bottom: 1px solid #edf1f4;
  }

  .portal-mobile-nav__phone {
    padding-inline: 0;
  }

  .portal-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 20px;
    padding-block: 48px 42px;
  }

  .portal-footer__brand,
  .portal-footer__contact {
    grid-column: 1 / -1;
  }

  .portal-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}
