/* header.css — Figma 577:8908 desktop + Шапка тел. mobile */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #010212;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid #0e102a;
  padding-top: env(safe-area-inset-top, 0px);
}

.header__inner {
  max-width: 75rem;
  margin: 0 auto;
  padding-left: max(2.5rem, env(safe-area-inset-left, 0px));
  padding-right: max(2.5rem, env(safe-area-inset-right, 0px));
}

.header__line {
  display: none;
}

.header__nav {
  box-sizing: border-box;
}

.header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  min-height: 5.25rem;
  padding: 6px 0 0;
  box-sizing: border-box;
}

.header__bar-main {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0;
}

.header__brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
  padding: 10px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.header__brand-logo {
  display: block;
  width: 11.125rem;
  height: 3rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
}

.header__brand-icon,
.header__brand-name {
  display: none;
}

.header__menu {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 34.75rem;
  max-width: 34.75rem;
  min-height: 3.1875rem;
}

.header__links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.header__link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 3.1875rem;
  padding: 15px 20px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.167;
  color: var(--color-text);
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  filter: drop-shadow(0 0 4px #000000);
  white-space: nowrap;
  transition: opacity var(--transition-base);
}

.header__link:hover { opacity: 0.85; }

.header__link--active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 82px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: #2206c7;
  pointer-events: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-left: auto;
}

.header__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
  width: 7.8125rem;
  height: 3.375rem;
  padding: 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow: 0 0 4px #000000;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.167;
  color: var(--color-text);
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  transition: border-color var(--transition-base), opacity var(--transition-base);
}

.header__login:hover { border-color: rgba(255, 255, 255, 0.65); }

.header__login-icon {
  display: block;
  box-sizing: border-box;
  width: 18px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  align-self: center;
}

.header__logout-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.header__logout {
  cursor: pointer;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.header__register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  box-sizing: border-box;
  width: 13.6875rem;
  height: 3.25rem;
  padding: 15px 16px;
  border: 1px solid #4c44f5;
  border-radius: 18px;
  background: radial-gradient(206.19% 206.19% at 50% 50%, #100cb8 0%, #4f45e5 100%);
  box-shadow: inset 0 0 13px #6152f2;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.167;
  color: var(--color-text);
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  transition:
    background var(--transition-base),
    box-shadow var(--transition-base),
    color var(--transition-base);
}

/* Property 1=Variant2 — hover (лише pointer: fine — без sticky hover на iOS) */
@media (hover: hover) and (pointer: fine) {
  .header__register:hover {
    background: radial-gradient(206.19% 206.19% at 50% 50%, #5a56ff 0%, #1000ff 100%);
    box-shadow: 0 0 40px #2c28d2, inset 0 0 40px #6152f2;
  }
}

.header__register:focus-visible {
  background: radial-gradient(206.19% 206.19% at 50% 50%, #5a56ff 0%, #1000ff 100%);
  box-shadow: 0 0 40px #2c28d2, inset 0 0 40px #6152f2;
}

/* Property 1=Variant3 — pressed */
.header__register:active {
  background: radial-gradient(
    206.19% 206.19% at 50% 50%,
    rgba(90, 86, 255, 0.2) 0%,
    rgba(16, 0, 255, 0.2) 100%
  );
  box-shadow: 0 0 40px #2c28d2;
  color: #7d86b9;
}

.header__register-icon {
  display: block;
  box-sizing: border-box;
  width: 14px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  align-self: center;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}

.header__burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 5px;
  width: 2rem;
  min-width: 2rem;
  height: 3.125rem;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.header__burger-line {
  display: block;
  width: 1.25rem;
  height: 0;
  border-top: 2px solid #ffffff;
  background: transparent;
  border-radius: 0;
  flex-shrink: 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
  pointer-events: none;
}

.header__burger[aria-expanded="true"] .header__burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__burger[aria-expanded="true"] .header__burger-line:nth-child(2) {
  opacity: 0;
}

.header__burger[aria-expanded="true"] .header__burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header__mobile-menu {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.header__mobile-menu[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
}

.header__mobile-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(1, 2, 18, 0.55);
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.header__mobile-menu[aria-hidden="false"] .header__mobile-backdrop {
  opacity: 1;
}

.header__mobile-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 14.375rem;
  max-width: calc(100vw - 2rem);
  background: #0b0e2e;
  border: 1px solid #252a56;
  border-left: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
  border-radius: 0 17px 17px 0;
  transform: translateX(-105%);
  transition: transform var(--transition-base);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.header__mobile-menu[aria-hidden="false"] .header__mobile-panel {
  transform: translateX(0);
}

.header__mobile-head {
  position: relative;
  flex: none;
  height: 5.6875rem;
}

.header__mobile-close {
  position: absolute;
  top: 2.5rem;
  left: 1.3125rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 1.25rem;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header__mobile-close-line {
  display: block;
  width: 1.25rem;
  height: 0;
  border-top: 2px solid #ffffff;
}

.header__mobile-divider {
  display: block;
  flex: none;
  width: 7.1875rem;
  height: 0;
  margin: 0.125rem 0;
  border-top: 1px solid #252a56;
}

.header__mobile-divider--full {
  width: 100%;
}

.header__mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 0.125rem;
  overflow-y: auto;
}

.header__mobile-link {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  flex: none;
  height: 3.5rem;
  padding: 0.9375rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.4375rem;
  font-weight: 700;
  line-height: 1.625rem;
  color: #ffffff;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  filter: drop-shadow(0 0 4px #000000);
  transition: opacity var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.header__mobile-link:hover {
  opacity: 0.88;
}

.header__mobile-link--active {
  color: #ffffff;
}

.header__mobile-footer {
  box-sizing: border-box;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  min-height: 16.1875rem;
  margin-top: auto;
  padding:
    0.75rem 1rem
    calc(1rem + env(safe-area-inset-bottom, 0px));
  background: #020219;
  border-top: 1px solid #252a56;
  border-radius: 0 0 0 17px;
}

.header__mobile-socials {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5625rem;
  width: 12.375rem;
  height: 2.5625rem;
}

.header__mobile-social-link {
  display: block;
  flex: none;
  width: 2.5625rem;
  height: 2.5625rem;
  border-radius: 8px;
  transition: opacity var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.header__mobile-social-link:hover {
  opacity: 0.88;
}

.header__mobile-social-link img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.header__mobile-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4375rem;
  width: 11.125rem;
  height: 3rem;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.header__mobile-brand-icon {
  display: block;
  flex: none;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

.header__mobile-brand-name {
  display: block;
  flex: none;
  font-family: var(--font-display);
  font-size: 1.6875rem;
  font-weight: 800;
  line-height: 2.0625rem;
  color: #ffffff;
  text-align: center;
}

.header__mobile-brand-accent {
  color: var(--color-accent);
}

.header__mobile-write-btn {
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 11.875rem;
  height: 3.1875rem;
  padding: 0.9375rem 1.25rem;
  border: 1px solid #4c44f5;
  border-radius: 15px;
  background: radial-gradient(206.19% 206.19% at 50% 50%, #100cb8 0%, #4f45e5 100%);
  box-shadow: inset 0 0 13px #6152f2;
  text-decoration: none;
  transition:
    background var(--transition-base),
    box-shadow var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

/* Property 1=Variant2 — hover (лише pointer: fine — без sticky hover на iOS) */
@media (hover: hover) and (pointer: fine) {
  .header__mobile-write-btn:hover {
    background: radial-gradient(206.19% 206.19% at 50% 50%, #5a56ff 0%, #1000ff 100%);
    box-shadow: 0 0 40px #2c28d2, inset 0 0 40px #6152f2;
  }

  .header__mobile-write-btn:hover .header__mobile-write-label {
    color: #ffffff;
    -webkit-text-stroke: 0 transparent;
    paint-order: normal;
  }
}

.header__mobile-write-btn:focus-visible {
  background: radial-gradient(206.19% 206.19% at 50% 50%, #5a56ff 0%, #1000ff 100%);
  box-shadow: 0 0 40px #2c28d2, inset 0 0 40px #6152f2;
}

.header__mobile-write-btn:focus-visible .header__mobile-write-label {
  color: #ffffff;
  -webkit-text-stroke: 0 transparent;
  paint-order: normal;
}

/* Property 1=Variant3 — pressed */
.header__mobile-write-btn:active {
  background: radial-gradient(
    206.19% 206.19% at 50% 50%,
    rgba(90, 86, 255, 0.2) 0%,
    rgba(16, 0, 255, 0.2) 100%
  );
  box-shadow: 0 0 40px #2c28d2;
}

.header__mobile-write-btn:active .header__mobile-write-label {
  color: #7d86b9;
  -webkit-text-stroke: 0 transparent;
  paint-order: normal;
}

.header__mobile-write-label {
  flex: none;
  width: 7.8125rem;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3125rem;
  text-align: center;
  color: var(--color-btn-label);
  -webkit-text-stroke: 1px #0e0bb3;
  paint-order: stroke fill;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: color var(--transition-base);
}

.header__mobile-write-icon {
  display: block;
  flex: none;
  width: 0.9375rem;
  height: 0.9375rem;
  max-width: none;
  object-fit: contain;
}

.header__mobile-copy {
  width: 12.375rem;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 400;
  line-height: 1.7258;
  color: #b3adae;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

@media (max-width: 1199px) and (min-width: 1024px) {
  .header__inner {
    padding-left: max(var(--space-6), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
  }

  .header__brand {
    flex: 0 0 auto;
    width: auto;
  }

  .header__menu {
    flex: 1 1 auto;
    max-width: none;
  }
}

@media (max-width: 1023px) {
  /* Figma «Шапка тел.» 390×92 → Frame 364 364×74 */
  .header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    min-height: 5.75rem;
    margin: 0;
    padding:
      calc(9px + env(safe-area-inset-top, 0px))
      env(safe-area-inset-right, 0px)
      9px
      max(5px, env(safe-area-inset-left, 0px));
    background: #010212;
    border-bottom: 1px solid #0e102a;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    border-radius: 0 0 17px 17px;
  }

  .header__inner {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .header__nav {
    width: 100%;
  }

  .header__line {
    display: none;
  }

  .header__menu {
    display: none;
  }

  /* Frame 364 — 364×74, gap 11px */
  .header__bar {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    width: 364px;
    max-width: 100%;
    height: 74px;
    min-height: 74px;
    margin: 0;
    padding: 0;
  }

  /* Frame 363 — burger 32×50, padding 21px 6px 19px */
  .header__burger {
    display: flex;
    flex: 0 0 32px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    width: 32px;
    min-width: 32px;
    height: 50px;
    min-height: 50px;
    padding: 21px 6px 19px;
    margin: 0;
  }

  .header__burger-line {
    width: 20px;
  }

  /* Frame 362 — 325×74, gap 7px (364 − 32 − 11 = 321 контентна зона) */
  .header__bar-main {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    box-sizing: border-box;
    width: 325px;
    max-width: calc(100% - 43px);
    height: 74px;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  /* Frame 342 — 163×74, gap 6px */
  .header__actions {
    display: flex;
    flex: 0 0 163px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    width: 163px;
    height: 74px;
    margin: 0;
    padding: 0;
  }

  /* Зареєструватися — 163×34 */
  .header__register {
    gap: 13px;
    width: 163px;
    color: var(--color-btn-label);
    -webkit-text-stroke: 1px #0e0bb3;
    paint-order: stroke fill;
    text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
  }

  .header__register,
  .header__login {
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 10px 20px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    line-height: 14px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }

  /* Увійти — 99×34 */
  .header__login {
    gap: 3px;
    width: 99px;
    background: transparent;
    filter: drop-shadow(0 0 4px #000000);
    text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  }

  .header__register-icon,
  .header__login-icon {
    display: block;
    flex: none;
    object-fit: contain;
    object-position: center;
    align-self: center;
  }

  .header__register-icon {
    width: 11px;
    height: 14px;
    filter: none;
  }

  .header__login-icon {
    width: 14px;
    height: 12px;
  }

  /* Frame 27 — 155×40, gap 6px */
  .header__brand {
    display: flex;
    flex: 0 0 155px;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    width: 155px;
    max-width: 155px;
    min-width: 0;
    height: 40px;
    padding: 0;
  }

  .header__brand-logo {
    display: none;
  }

  .header__brand-icon {
    display: block;
    flex: none;
    width: 40px;
    height: 40px;
    object-fit: contain;
  }

  .header__brand-name {
    display: block;
    flex: none;
    width: 109px;
    max-width: 109px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    line-height: 29px;
    color: #ffffff;
    text-align: center;
  }

  .header__brand-name-accent {
    color: var(--color-accent);
  }
}

@media (max-width: 374px) {
  .header__bar {
    width: 100%;
  }

  .header__bar-main {
    flex: 1 1 auto;
    width: auto;
    max-width: calc(100% - 43px);
    min-width: 0;
  }

  .header__register {
    width: 148px;
    padding-inline: 12px;
    gap: 8px;
    font-size: 11px;
  }

  .header__login {
    width: 88px;
    padding-inline: 12px;
    gap: 3px;
  }

  .header__actions {
    flex: 0 0 auto;
    width: 148px;
  }

  .header__brand {
    flex: 1 1 auto;
    width: auto;
    max-width: 136px;
    min-width: 0;
  }

  .header__brand-name {
    width: auto;
    max-width: none;
    font-size: 20px;
    line-height: 24px;
  }

  .header__brand-icon {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 1024px) {
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }

  .header__mobile-menu {
    display: none;
  }
}
