:root {
  --text: #e8eef8;
  --muted: #9fb0c9;
  --accent: #64b0d1;
  --accent-2: #2e7ea7;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

/* HEADER */

.site-header {
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(7, 17, 31, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
}

.brand-logo {
  max-height: 62px;
  width: auto;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-left: auto;
}

.main-nav a,
.auth-nav-left a,
.header-actions .nav-link {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active,
.auth-nav-left a:hover,
.header-actions .nav-link:hover,
.header-actions .nav-link.active {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* FOOTER */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 17, 31, 0.45);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 28px 0 22px;
}

.footer-column h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.footer-column a {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: 0.2s ease;
}

.footer-column a:hover {
  color: var(--text);
}

.footer-bottom {
  padding: 16px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.minimal-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px 0 8px;
  flex-wrap: wrap;
}

.minimal-footer-inner a {
  color: var(--muted);
  font-size: 14px;
}

.minimal-footer-inner a:hover {
  color: var(--text);
}

/* MOBILE */

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    width: min(var(--max), calc(100% - 20px));
  }

  .site-header {
    position: relative;
    z-index: 70;
  }

  .header-inner {
    min-height: 68px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .brand {
    justify-self: start;
    min-width: 0;
  }

  .brand-logo {
    max-height: 38px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: 0;
    justify-self: end;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  }

  .main-nav,
  .header-actions,
  .auth-nav-left,
  .auth-actions {
    display: none;
    width: 100%;
    margin: 0;
  }

  .site-header.is-open .main-nav,
  .site-header.is-open .header-actions,
  .site-header.is-open .auth-nav-left,
  .site-header.is-open .auth-actions,
  .main-nav.open,
  .header-actions.open,
  .auth-nav-left.open,
  .auth-actions.open {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 8px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(8, 18, 34, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 18px 40px rgba(0,0,0,0.28);
    backdrop-filter: blur(14px);
  }

  .main-nav a,
  .header-actions a,
  .auth-nav-left a,
  .auth-actions a {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    margin: 0;
    text-align: right;
    color: var(--text);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
  }

  .main-nav a:hover,
  .header-actions a:hover,
  .auth-nav-left a:hover,
  .auth-actions a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.10);
  }

  .header-actions .btn,
  .header-actions .nav-link,
  .auth-actions .btn,
  .auth-actions .nav-link {
    width: 100%;
  }

  .header-actions .btn,
  .auth-actions .btn {
    justify-content: center;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .footer-bottom {
    padding-bottom: 18px;
  }
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }
}

/* GLOBAL HEADER LANGUAGE SWITCHER */
/* Hide old page-level language switchers now that the switcher lives in the shared header. */
.lang-switcher-wrap:not(.header-lang-switcher) {
  display: none !important;
}

.site-header .header-lang-switcher.lang-switcher-wrap {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  z-index: 120 !important;
  flex: 0 0 auto !important;
}

.site-header .header-lang-switcher .lang-dropdown {
  position: relative !important;
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
}

.site-header .header-lang-switcher .lang-dropdown-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: auto !important;
  min-width: 48px !important;
  min-height: 38px !important;
  padding: 7px 10px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(157, 230, 255, 0.18) !important;
  border-top: 1px solid rgba(157, 230, 255, 0.18) !important;
  background: rgba(5, 12, 24, 0.72) !important;
  color: #eaf8ff !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  cursor: pointer !important;
}

.site-header .header-lang-switcher .active-lang-label,
.site-header .header-lang-switcher #activeLangLabel {
  font-size: 0.78rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
}

.site-header .header-lang-switcher .caret {
  font-size: 0.68rem !important;
  opacity: 0.78 !important;
  line-height: 1 !important;
}

.site-header .header-lang-switcher .lang-dropdown-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 176px !important;
  min-width: 176px !important;
  padding: 8px !important;
  border-radius: 16px !important;
  background: rgba(7, 17, 31, 0.98) !important;
  border: 1px solid rgba(157, 230, 255, 0.16) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-6px) !important;
  transform-origin: top right !important;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease !important;
  pointer-events: none !important;
  z-index: 260 !important;
}

.site-header .header-lang-switcher .lang-dropdown.is-open .lang-dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.site-header .header-lang-switcher .lang-option {
  width: 100% !important;
  min-height: 40px !important;
  padding: 9px 10px !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: transparent !important;
  color: #dbe7f5 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  text-align: left !important;
}

.site-header .header-lang-switcher .lang-option:hover,
.site-header .header-lang-switcher .lang-option.is-active {
  background: rgba(99, 175, 207, 0.16) !important;
  color: #9fe6ff !important;
}

.site-header .header-lang-switcher .lang-check {
  opacity: 0 !important;
  transform: scale(0.92) !important;
}

.site-header .header-lang-switcher .lang-option.is-active .lang-check {
  opacity: 1 !important;
  transform: scale(1) !important;
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    column-gap: 10px !important;
  }

  .site-header .header-lang-switcher.lang-switcher-wrap {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
  }

  .site-header .menu-toggle {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .site-header .header-lang-switcher .lang-dropdown-toggle {
    min-width: 44px !important;
    min-height: 38px !important;
    padding: 7px 9px !important;
    border-radius: 12px !important;
  }

  .site-header .header-lang-switcher .lang-dropdown-menu {
    right: 0 !important;
    left: auto !important;
    width: 168px !important;
    min-width: 168px !important;
  }
}

/* FINAL SIMPLE MOBILE MENU: classic dark dropdown, no large buttons */
.mobile-menu-panel {
  display: none !important;
}

@media (min-width: 761px) {
  .mobile-menu-panel {
    display: none !important;
  }

  .site-header .main-nav {
    display: flex;
  }

  .site-header .header-actions,
  .site-header .auth-nav-left,
  .site-header .auth-actions {
    display: flex;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: relative !important;
    z-index: 700 !important;
    overflow: visible !important;
  }

  .site-header .header-inner {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    overflow: visible !important;
  }

  .site-header .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .site-header .header-lang-switcher.lang-switcher-wrap {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    z-index: 740 !important;
  }

  .site-header .menu-toggle {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
    display: inline-flex !important;
  }

  /* Hide old mobile groups so they never push the page down */
  .site-header .main-nav,
  .site-header .header-actions,
  .site-header .auth-nav-left,
  .site-header .auth-actions,
  .site-header.is-open .main-nav,
  .site-header.is-open .header-actions,
  .site-header.is-open .auth-nav-left,
  .site-header.is-open .auth-actions,
  .site-header .main-nav.open,
  .site-header .header-actions.open,
  .site-header .auth-nav-left.open,
  .site-header .auth-actions.open {
    display: none !important;
  }

  .mobile-menu-panel {
    display: block !important;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 18px 13px !important;
    border-radius: 18px !important;
    background: rgba(7, 17, 31, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    z-index: 730 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
    transform-origin: top right !important;
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease !important;
  }

  .mobile-menu-panel[hidden] {
    display: none !important;
  }

  .site-header.is-mobile-menu-open .mobile-menu-panel:not([hidden]) {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  .mobile-menu-group,
  .mobile-menu-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .mobile-menu-divider {
    height: 1px !important;
    margin: 9px 0 !important;
    background: rgba(255, 255, 255, 0.10) !important;
  }

  .mobile-menu-item,
  .mobile-menu-panel a,
  .mobile-menu-panel button {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 36px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #eaf2ff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    text-align: left !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .mobile-menu-item:hover,
  .mobile-menu-item:focus-visible,
  .mobile-menu-item.active,
  .mobile-menu-panel a:hover,
  .mobile-menu-panel a:focus-visible,
  .mobile-menu-panel button:hover,
  .mobile-menu-panel button:focus-visible {
    background: transparent !important;
    color: #9fe6ff !important;
    outline: none !important;
    transform: none !important;
  }

  .mobile-menu-item--primary,
  .mobile-menu-panel .btn,
  .mobile-menu-panel .btn-primary,
  .mobile-menu-panel .btn-secondary,
  .mobile-menu-panel .btn-outline,
  .mobile-menu-panel .btn-danger,
  .mobile-menu-panel a[href*="register"],
  .mobile-menu-panel a[href*="dashboard"],
  .mobile-menu-panel a[href*="builder"] {
    justify-content: flex-start !important;
    min-height: 36px !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #eaf2ff !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    text-align: left !important;
  }

  .mobile-menu-item--primary:hover,
  .mobile-menu-panel .btn:hover,
  .mobile-menu-panel .btn-primary:hover,
  .mobile-menu-panel .btn-secondary:hover,
  .mobile-menu-panel .btn-outline:hover,
  .mobile-menu-panel .btn-danger:hover,
  .mobile-menu-panel a[href*="register"]:hover,
  .mobile-menu-panel a[href*="dashboard"]:hover,
  .mobile-menu-panel a[href*="builder"]:hover {
    color: #9fe6ff !important;
    background: transparent !important;
    transform: none !important;
  }

  .mobile-menu-item--logout,
  .mobile-menu-panel #logoutBtn,
  .mobile-menu-panel [data-logout],
  .mobile-menu-panel a[href*="logout"] {
    color: #ffdddd !important;
  }

  .mobile-menu-item--logout:hover,
  .mobile-menu-panel #logoutBtn:hover,
  .mobile-menu-panel [data-logout]:hover,
  .mobile-menu-panel a[href*="logout"]:hover {
    color: #ffffff !important;
    background: transparent !important;
  }

  .mobile-menu-legal {
    margin-top: 13px !important;
    padding-top: 11px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
  }

  .mobile-menu-legal a,
  .mobile-menu-panel .mobile-menu-legal a {
    width: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #8fa7bd !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
  }

  .mobile-menu-legal a:hover,
  .mobile-menu-panel .mobile-menu-legal a:hover {
    color: #cfeeff !important;
  }

  .menu-toggle.open,
  .menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
  }
}

