/* Header styles based on 1920 design, using % and vw */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header {
  position: relative;
  width: 100%;
  height: 5.625vw; /* 108px / 1920 */
  min-height: 60px;
  background: #0B1D36;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw; /* ~96px */
}

.header__logo {
  width: 3.958vw; /* 76px */
  height: 3.958vw;
  min-width: 40px;
  min-height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  background: transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s;
}

.header__logo:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(232, 240, 254, 0.35);
  opacity: 0.95;
}

.header__logo:active {
  transform: scale(0.96);
}

.header__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2.76vw;
  margin-left: 3.385vw;
}

.header__nav-link {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.25vw; /* 24px */
  line-height: 1.51vw; /* 29px */
  color: #F8FAFC;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s, color 0.2s;
}

.header__nav-link:hover {
  opacity: 0.85;
}

.header__nav-link--active,
.header__nav-link.is-active {
  color: rgba(248, 250, 252, 0.5);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.78vw;
  margin-left: auto;
}

.header__lang {
  display: flex;
  width: 4.583vw; /* 88px */
  height: 1.927vw; /* 37px */
  min-width: 70px;
  min-height: 28px;
  background: #1D4E90;
  border-radius: 0.417vw;
  overflow: hidden;
}

.header__lang-btn {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.833vw; /* 16px */
  line-height: 150%;
  color: #E8F0FE;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.header__lang-btn--active {
  background: #E8F0FE;
  color: #0B1D36;
  border-radius: 0.417vw;
}

.header__user {
  width: 3.385vw; /* 65px */
  height: 3.385vw;
  min-width: 36px;
  min-height: 36px;
  background: #1D4E90;
  border-radius: 0.417vw;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s;
}

.header__user:hover {
  background: #2563A8;
}

.header__user svg {
  width: 2.292vw; /* 44px */
  height: 2.292vw;
  min-width: 24px;
  min-height: 24px;
}

/* Optional login button variant (for main page) */
.header__login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.083vw;
  height: 2.448vw;
  min-width: 80px;
  min-height: 36px;
  background: #1D4E90;
  border-radius: 0.417vw;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 1.25vw;
  line-height: 1.51vw;
  color: #F7F9FC;
  text-decoration: none;
  transition: background 0.2s;
}

.header__login:hover {
  background: #2563A8;
}

@media (max-width: 1200px) {
  .header__nav-link {
    font-size: 14px;
  }
  .header__lang-btn {
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 3vw;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .header__nav {
    display: none;
  }
  .header__logo {
    width: 40px;
    height: 40px;
  }
  .header__user {
    width: 36px;
    height: 36px;
  }
  .header__user svg {
    width: 24px;
    height: 24px;
  }
}

.header__auth {
  display: flex;
  align-items: center;
  gap: 0.6vw;
}
.header__logout {
  background: transparent;
  border: 1px solid rgba(232, 240, 254, 0.35);
  color: #E8F0FE;
  border-radius: 8px;
  padding: 0.35vw 0.75vw;
  font-family: inherit;
  font-size: 0.85vw;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.header__logout:hover {
  background: rgba(232, 240, 254, 0.12);
  border-color: rgba(232, 240, 254, 0.6);
}
.header__login--user {
  max-width: 8vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .header__logout { font-size: 12px; padding: 6px 10px; }
  .header__login--user { max-width: 100px; }
}

/* Burger — tablet & mobile */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-right: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 60;
}
.header__burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #E8F0FE;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.header.is-menu-open .header__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header.is-menu-open .header__burger span:nth-child(2) {
  opacity: 0;
}
.header.is-menu-open .header__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .header {
    height: auto;
    min-height: 56px;
    padding: 8px 16px;
    flex-wrap: wrap;
  }
  .header__burger { display: flex; order: 1; }
  .header__logo { order: 2; width: 40px; height: 40px; min-width: 40px; }
  .header__actions { order: 3; margin-left: auto; }
  .header__nav {
    order: 4;
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 12px 0 8px;
    gap: 0;
    background: #0f2744;
    border-radius: 10px;
    padding: 8px;
  }
  .header.is-menu-open .header__nav {
    display: flex;
  }
  .header__nav-link {
    font-size: 16px;
    line-height: 1.4;
    padding: 12px 14px;
    border-radius: 8px;
  }
  .header__nav-link:hover {
    background: rgba(255,255,255,0.06);
  }
  .header__lang {
    min-width: 64px;
    height: 32px;
  }
  .header__lang-btn { font-size: 12px; }
  .header__login { font-size: 13px; padding: 8px 12px; }
}
