.header-main {
  position: fixed;
  top: 0;
  width: 100svw;
  z-index: 100;
  background: none;
  padding: 16px 24px;
  display: block;
  box-sizing: border-box;
}


input {
  background: var(--input-color) !important;
  color: var(--input-text) !important;
}

input::placeholder {
  color: var(--input-text) !important;
}

input:focus {
  color: var(--text-color) !important;
  background: linear-gradient(to right,
      rgba(78, 70, 229, 0.15),
      rgba(79, 70, 229, 0.15)) !important;
}

input:focus::placeholder {
  color: var(--text-color) !important;
}

.header__buttons-popup-btn {
  background: linear-gradient(90deg,
      rgba(79, 70, 229) 0%,
      rgba(40, 148, 236) 100%);
  will-change: opacity;
  padding: 16px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  line-height: normal;
}

/* Хэдер для главной страницы — стиль ЛК (gradient-12, frame-radius 20, blur) */
.header-main__container {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  z-index: 90;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.12) 0%, rgba(40, 148, 236, 0.12) 100%);
  border: 1px solid rgba(225, 241, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .6s ease;
}
.header-main__container.scrolled {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.20) 0%, rgba(40, 148, 236, 0.20) 100%) !important;
}

.header__container-nav {
  display: flex;
  align-items: center;
  gap: 44px;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__links {
  display: flex;
  gap: 30px;
  align-items: center;
  position: relative;
}

.header__links-link {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: normal;
  cursor: pointer;
  color: var(--text-color);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.header__links-link:hover {
  color: #2894EC;
}

.header_container-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo {
  width: 43px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.header__user-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user__dropdown {
  position: relative;
  display: inline-block;
}

.user__dropdown-content {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 240px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  border: 1px solid rgba(225, 241, 255, 0.08);
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.18), rgba(40, 148, 236, 0.18)), #131317;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}

.user__dropdown-content.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user__profile-section {
  display: flex;
  align-items: center;
  padding: 4px 8px 12px;
  flex-direction: row;
  gap: 10px;
  border-bottom: 1px solid rgba(225, 241, 255, 0.08);
  margin-bottom: 6px;
}

.user__profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.user__profile-name {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user__profile-plan {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  color: rgba(225, 241, 255, 0.55);
}

.user__dropdown-item {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-color);
  padding: 10px 12px;
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.user__dropdown-item:hover {
  background: rgba(225, 241, 255, 0.06);
}

.user__dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.7;
  color: currentColor;
  transition: opacity 0.2s ease;
}

.user__dropdown-item:hover .user__dropdown-icon {
  opacity: 1;
}

.user__dropdown-divider {
  height: 1px;
  margin: 6px 4px;
  background: rgba(225, 241, 255, 0.08);
}

.user__dropdown-item--danger {
  color: #ff3b5c;
}

.user__dropdown-item--danger:hover {
  background: rgba(255, 59, 92, 0.1);
  color: #ff3b5c;
}

body.logged-in .header__buttons .header__buttons-popup-btn {
  display: none;
}

/* Burger Menu Styles */
.burger__toggle {
  display: none;
  --burger_width: 32px;
  --burger_height: 20px;
  width: var(--burger_width);
  height: var(--burger_height);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.burger__toggle svg {
  width: var(--burger_width);
  height: var(--burger_height);
}

.burger__path {
  fill: none;
  stroke: white;
  stroke-width: 8;
  stroke-linecap: round;
}


.burger__menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 8px);
  left: 16px;
  right: 16px;
  width: auto;
  max-width: none;
  border: 1px solid rgba(225, 241, 255, 0.08);
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.18), rgba(40, 148, 236, 0.18)), #131317;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px;
  z-index: 92;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.burger__menu.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu__img-container {
  display: none;
}

.burger__links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
}

.burger__menu-item {
  display: block;
  text-align: center;
  color: var(--text-color);
  text-decoration: none;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.burger__menu-item:hover {
  background: rgba(225, 241, 255, 0.06);
}

.burger__divider {
  width: calc(100% - 8px);
  height: 1px;
  margin: 4px 0;
  background: rgba(225, 241, 255, 0.08);
}

.burger__overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100svw;
  height: 100svh;
  background: transparent;
  z-index: 88;
}

.burger__overlay.active {
  display: block;
  z-index: 91;
  background: rgba(19, 19, 23, 0.5);
  backdrop-filter: blur(4px);
}

.burger__overlay.active::after {
  position: absolute;
}

body.burger-open {
  overflow: hidden;
}

.templatePopup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: scroll;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.8);
}

.templatePopup__wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  gap: 40px;
  transform: translate(-50%, -50%);
  background-color: var(--background-color);
  width: 914px;
  height: max-content;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 4px 2px rgba(187, 187, 187, 0.25);
}

.templatePopup__title {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.templatePopup-popup__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.templatePopup__templates {
  text-align: center;
  display: flex;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 35px;
  row-gap: 15px;
}

.template-btn,
.template-btn.empty {
  background-color: var(--background-color);
  outline: 2px solid #555;
  border-radius: 16px;
  padding: 10px 30px;
  cursor: pointer;
  width: 191px;
  height: 180px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  transition: all 0.3s ease;
  gap: 15px;
  border: none;
  text-align: start;
}

.template-btn:hover,
.template-btn.empty:hover {
  background: linear-gradient(to right,
      rgba(79, 70, 229, 0.2),
      rgba(40, 148, 236, 0.2));
  outline: none;
  box-shadow: 0px 0px 10px 3px rgba(79, 70, 229, 1);
}

.template-btn__img {
  align-self: flex-start;
}

.template-btn.empty {
  text-align: center;
}

.template-btn.active {
  background: linear-gradient(to right,
      rgba(79, 70, 229, 0.2),
      rgba(40, 148, 236, 0.2));
  outline: none;
  box-shadow: 0px 0px 10px 3px rgba(79, 70, 229, 1);
}

.project-name {
  width: 100% !important;
}

.submit-button {
  width: 100% !important;
}

.flag {
  display: flex;
  height: max-content;
}

.burger__lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(225, 241, 255, 0.04);
  border: 1px solid rgba(225, 241, 255, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.burger__lang img {
  width: 20px;
  height: 20px;
}

.burger__lang:hover {
  background: rgba(225, 241, 255, 0.08);
  border-color: rgba(225, 241, 255, 0.18);
}

.title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

@media (max-width: 1440px) {
  .main__popup {
    left: 9%;
  }
}

@media (max-width: 1024px) {
  .header__links {
    gap: 24px;
  }

  .header__container-nav {
    display: flex;
    gap: 24px;
  }

  .header__buttons-popup-btn {
    font-size: 16px;
    padding: 16px 16px;
  }

}

@media (max-width: 768px) {

  .header__links {
    display: none;
  }

  .title-wrapper .button-big {
    align-items: center;
    display: flex;
    justify-content: center;
  }

  .header__flag {
    display: none;
  }

  .burger__toggle {
    display: flex;
  }

  .templatePopup__wrapper {
    width: 90%;
    top: 50%;
    height: 80%;
  }

  .header_container-logo {
    display: flex;
    justify-self: center;
  }
}

@media (max-width: 425px) {
  .header__buttons-popup-btn {
    font-size: 12px;
    padding: 16px 12px;
  }

  .templatePopup__templates {
    align-items: center;
    justify-content: center;
  }

  .template-btn,
  .template-btn.empty {
    width: 100%;
  }

  .templatePopup__title .title {
    max-width: 160px;
  }

  .title {
    font-size: 30px !important;
  }
}

@media (max-width: 320px) {
  .templatePopup__title {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: start;
    align-items: center;
  }

  .templatePopup__title .button-big {
    width: 100%;
  }

  .templatePopup__title .title {
    max-width: 100%;
    width: 100%;
    text-align: center;
  }
}

/* === MEGAMENU «Интеграции» (desktop) === */

.header__links-group {
    position: relative;
}

.header__links-link--has-menu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header__links-arrow {
    transition: transform 0.2s;
    color: rgba(225, 241, 255, 0.6);
}

.header__links-group:hover .header__links-arrow {
    transform: rotate(180deg);
    color: #fff;
}

.header__megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    transform: translateY(-8px);
    width: 720px;
    max-width: calc(100vw - 40px);
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    padding: 12px;
    background: rgba(13, 16, 25, 0.96);
    border: 1px solid rgba(225, 241, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    z-index: 200;
}

/* Bridge: невидимая зона между триггером и панелью, чтобы hover не пропадал */
.header__megamenu::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}

.header__links-group:hover .header__megamenu,
.header__links-group:focus-within .header__megamenu {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.header__megamenu-cats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 8px;
    border-right: 1px solid rgba(225, 241, 255, 0.06);
}

.header__megamenu-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    color: rgba(225, 241, 255, 0.7);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.header__megamenu-cat:hover,
.header__megamenu-cat.is-active {
    background: rgba(124, 106, 255, 0.12);
    border-color: rgba(124, 106, 255, 0.3);
    color: #fff;
}

.header__megamenu-cat-name {
    flex: 1;
}

.header__megamenu-cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 6px;
    height: 18px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.header__megamenu-cat-arrow {
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.15s, transform 0.15s;
}

.header__megamenu-cat.is-active .header__megamenu-cat-arrow {
    color: #fff;
    transform: translateX(2px);
}

.header__megamenu-items {
    position: relative;
    padding-left: 12px;
    min-height: 280px;
}

.header__megamenu-list {
    display: none;
    flex-direction: column;
    gap: 2px;
    max-height: 400px;
    overflow-y: auto;
}

.header__megamenu-list.is-active {
    display: flex;
}

.header__megamenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: rgba(225, 241, 255, 0.85);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.header__megamenu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.header__megamenu-item-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px;
}

.header__megamenu-item-name {
    flex: 1;
    font-size: 13px;
}

.header__megamenu-item-status {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 6px;
}

.header__megamenu-item-status--ready {
    background: rgba(74, 222, 128, 0.12);
    color: rgba(190, 242, 200, 0.95);
}

.header__megamenu-item-status--in-progress {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

/* Скрыть megamenu на мобиле */
@media (max-width: 1024px) {
    .header__megamenu {
        display: none !important;
    }
    .header__links-arrow {
        display: none;
    }
}

/* === BURGER ACCORDION (mobile) === */

.burger__menu-group {
    width: 100%;
}

.burger__menu-item--toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    font: inherit;
    padding: 12px 0;
}

.burger__menu-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
    color: rgba(225, 241, 255, 0.5);
}

.burger__menu-item--toggle[aria-expanded="true"] .burger__menu-arrow {
    transform: rotate(180deg);
}

.burger__submenu {
    display: none;
    padding: 4px 0 8px 12px;
    border-left: 1px solid rgba(225, 241, 255, 0.08);
    margin-left: 6px;
}

.burger__menu-item--toggle[aria-expanded="true"] + .burger__submenu {
    display: block;
}

.burger__subgroup {
    margin-bottom: 4px;
}

.burger__subgroup-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(225, 241, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.burger__subgroup-toggle:hover,
.burger__subgroup-toggle[aria-expanded="true"] {
    background: rgba(124, 106, 255, 0.08);
    color: #fff;
}

.burger__subgroup-count {
    margin-left: auto;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.burger__subgroup-toggle .burger__menu-arrow {
    width: 10px;
    height: 6px;
}

.burger__subgroup-toggle[aria-expanded="true"] .burger__menu-arrow {
    transform: rotate(180deg);
}

.burger__subgroup-list {
    display: none;
    padding: 4px 0 4px 12px;
}

.burger__subgroup-toggle[aria-expanded="true"] + .burger__subgroup-list {
    display: block;
}

.burger__sub-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    color: rgba(225, 241, 255, 0.75);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.burger__sub-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.burger__sub-item-status {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 5px;
}

.burger__sub-item-status--ready {
    background: rgba(74, 222, 128, 0.12);
    color: rgba(190, 242, 200, 0.95);
}

.burger__sub-item-status--in-progress {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
}

.burger__sub-item--all {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #2894EC;
    font-weight: 500;
}