:root {
  --nav-v2-sapphire: #0F52BA;
  --nav-v2-sapphire-dark: #0b3f90;
  --nav-v2-sapphire-light: #2a6fe0;
  --nav-v2-link: #ffffff;
  --nav-v2-link-soft: rgba(255, 255, 255, .82);
  --nav-v2-border: rgba(255, 255, 255, .18);
  --nav-v2-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  --nav-v2-header-h: 84px;
  --nav-v2-radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

main {
  padding-top: calc(var(--nav-v2-header-h) + 1rem);
}

/* Header */
.main-header-v2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1100;
  background: linear-gradient(
    180deg,
    var(--nav-v2-sapphire-light) 0%,
    var(--nav-v2-sapphire) 55%,
    var(--nav-v2-sapphire-dark) 100%
  );
  box-shadow: var(--nav-v2-shadow);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.main-header-v2__nav {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Common links */
.main-header-v2 a,
.main-header-v2 button {
  font-weight: 700;
  text-decoration: none;
  transition: .22s ease;
}

.main-header-v2 a {
  color: var(--nav-v2-link-soft);
}

.main-header-v2 a:hover {
  color: var(--nav-v2-link);
}

.main-header-v2 a.active {
  color: #fff;
}

/* Desktop / tablet large */
.nav-v2-desktop-tablet {
  min-height: var(--nav-v2-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.nav-v2__links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(.75rem, 1.6vw, 2rem);
  min-width: 0;
  flex: 1 1 auto;
}

.nav-v2__links a {
  white-space: nowrap;
  padding: .65rem .85rem;
  border-radius: 12px;
  font-size: 1.06rem;
  line-height: 1;
}

.nav-v2__links a:hover,
.nav-v2__links a.active {
  background: rgba(255, 255, 255, .12);
}

.nav-v2__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex: 0 0 auto;
}

.nav-v2__actions > a {
  white-space: nowrap;
  padding: .7rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--nav-v2-border);
  background: rgba(255, 255, 255, .08);
}

.nav-v2__actions > a:hover,
.nav-v2__actions > a.active {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.nav-v2__user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .7rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .10);
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset;
}

.nav-v2__logout-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-v2__logout-btn {
  min-height: 46px;
  padding: .7rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: .22s ease;
}

.nav-v2__logout-btn:hover {
  background: rgba(255, 255, 255, .18);
}

/* Mobile block hidden by default */
.nav-v2-mobile {
  display: none;
  position: relative;
}

.nav-v2-mobile__logout {
  display: none;
}

.nav-v2-mobile__logout--legacy-hidden {
  display: none !important;
}

/* Desktop only */
@media (min-width: 1200px) {
  :root {
    --nav-v2-header-h: 88px;
  }

  .nav-v2-desktop-tablet {
    display: flex;
  }

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

  .nav-v2__links a {
    font-size: 1.12rem;
  }
}

/* Tablet + mobile */
@media (max-width: 1199px) {
  :root {
    --nav-v2-header-h: 72px;
  }

  .main-header-v2__nav {
    width: min(100%, calc(100% - 1.5rem));
  }

  .nav-v2-desktop-tablet {
    display: none;
  }

  .nav-v2-mobile {
    min-height: var(--nav-v2-header-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
  }

  .nav-v2-mobile__left,
  .nav-v2-mobile__right {
    position: relative;
  }

  .nav-v2-mobile__center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
  }

  .nav-v2-mobile__brand {
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .02em;
    text-align: center;
  }

  .nav-v2-mobile__toggle,
  .nav-v2-mobile__account-toggle {
    min-height: 42px;
    padding: .65rem .85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .10);
    color: #fff;
    cursor: pointer;
  }

  .nav-v2-mobile__toggle:hover,
  .nav-v2-mobile__account-toggle:hover {
    background: rgba(255, 255, 255, .18);
  }

  .nav-v2-mobile__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    min-width: 220px;
    padding: .6rem;
    border-radius: 14px;
    background: linear-gradient(
      180deg,
      rgba(42, 111, 224, .98),
      rgba(15, 82, 186, .98)
    );
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .22);
  }

  .nav-v2-mobile__dropdown--right {
    left: auto;
    right: 0;
  }

  .nav-v2-mobile__dropdown.open {
    display: flex;
    flex-direction: column;
    gap: .35rem;
  }

  .nav-v2-mobile__dropdown a {
    display: block;
    padding: .8rem .9rem;
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
  }

  .nav-v2-mobile__dropdown a:hover,
  .nav-v2-mobile__dropdown a.active {
    background: rgba(255, 255, 255, .18);
  }

  .nav-v2-mobile__dropdown-form {
    margin: 0;
  }

  .nav-v2-mobile__dropdown-btn {
    width: 100%;
    display: block;
    padding: .8rem .9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .nav-v2-mobile__dropdown-btn:hover {
    background: rgba(255, 255, 255, .18);
  }
}