/* Homepage v3 header — visual from aifo_new_portal_web Header.module.css */

.hv3-header {
  --hv3-brand: #f98715;
  --hv3-brand-hover: #f9a215;
  --hv3-elevated: #231f20;
  --hv3-page-pad: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  isolation: isolate;
  background: transparent;
}

.hv3-header a {
  color: inherit;
  text-decoration: none;
}

.hv3-header button {
  font-family: inherit;
}

.hv3-header.is-open {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgba(7, 4, 0, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hv3-header.is-open.is-scrolled::before {
  display: none;
}

.hv3-header.is-scrolled::before {
  content: "";
  position: absolute;
  inset: 0 0 -40px;
  pointer-events: none;
  background: rgba(7, 4, 0, 0.14);
  -webkit-backdrop-filter: blur(60px);
  backdrop-filter: blur(60px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
}

.hv3-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 6px 12px;
  min-height: 54px;
  flex-shrink: 0;
  width: 100%;
}

.hv3-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.hv3-logo img {
  width: 88px;
  height: 22px;
}

.hv3-desktop,
.hv3-actions,
.hv3-cta-desktop,
.hv3-login,
.hv3-divider {
  display: none;
}

.hv3-mobile-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hv3-menu-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  line-height: 0;
}

.hv3-menu-btn svg {
  display: block;
}

.hv3-overlay {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
  z-index: 40;
}

.hv3-header.is-open .hv3-overlay {
  display: flex;
}

.hv3-overlay-list {
  display: flex;
  flex-direction: column;
}

.hv3-acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.16);
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.hv3-acc.is-expanded .hv3-chevron {
  transform: rotate(180deg);
}

.hv3-acc-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px 16px;
  background: rgba(35, 31, 32, 0.85);
}

.hv3-acc.is-expanded .hv3-acc-panel {
  display: flex;
}

.hv3-acc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
}

.hv3-acc-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.hv3-overlay-ctas {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.hv3-full-btn {
  width: 100%;
  min-height: 56px;
  font-size: 20px;
}

.hv3-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9.5px;
  background: #231f20;
  border: 1.188px solid rgba(255, 255, 255, 0.16);
  color: var(--hv3-brand);
  flex-shrink: 0;
}

.hv3-icon-box .iconfont {
  font-size: 24px;
  line-height: 1;
  color: #f98715;
}

.hv3-icon-box img {
  display: block;
  width: 24px;
  height: 24px;
}

.hv3-dropdown,
.hv3-lang-menu {
  display: none;
}

.hv3-chevron {
  display: block;
  opacity: 0.85;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.hv3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  color: #f9f9f9;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hv3-btn:hover,
.hv3-btn:focus-visible {
  color: #f9f9f9;
  text-decoration: none;
}

.hv3-btn--primary {
  background: var(--hv3-brand, var(--brand, #f98715));
  color: #f9f9f9;
}

.hv3-btn--primary:hover,
.hv3-btn--primary:focus-visible,
.hv3-btn--nav:hover,
.hv3-btn--nav:focus-visible {
  background: var(--hv3-brand-hover, var(--brand-hover, #f9a215));
  color: #f9f9f9;
  box-shadow:
    inset 0 5px 10px rgba(249, 135, 21, 0.6),
    0 5px 10px rgba(249, 135, 21, 0.6);
}

.hv3-btn--ghost {
  background: rgba(15, 15, 15, 0.5);
  color: #f9f9f9;
  border: 0.657px solid #666;
  box-shadow: none;
}

.hv3-btn--ghost:hover,
.hv3-btn--ghost:focus-visible {
  background: rgba(249, 135, 21, 0.08);
  border-color: var(--hv3-brand);
  box-shadow: none;
  color: #f9f9f9;
}

.hv3-btn--nav {
  background: var(--hv3-brand, var(--brand, #f98715));
  color: #fff;
  border-radius: 8px;
  font-weight: 500;
  min-height: 42px;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 20px;
}

.hv3-btn--sm {
  min-height: 32px;
  padding: 8px 12px;
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
}

.hv3-header .fi {
  width: 20px !important;
  height: 20px !important;
  margin-right: 0;
  border-radius: 50%;
  object-fit: cover;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: 50%;
  flex-shrink: 0;
}

.hv3-header .fi::before {
  content: none !important;
}

@media (min-width: 1024px) {
  .hv3-header {
    --hv3-page-pad: 40px;
  }

  .hv3-bar {
    min-height: 80px;
    padding: 16px var(--hv3-page-pad);
  }

  .hv3-logo img {
    width: 127px;
    height: 32px;
  }

  .hv3-mobile-tools,
  .hv3-overlay {
    display: none !important;
  }

  .hv3-header.is-open {
    position: sticky;
    inset: auto;
    display: block;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .hv3-desktop {
    display: flex;
    align-items: center;
    /* Temporary: few items — match legacy nav.css spacing (~0.25rem + 1rem pad-x) */
    gap: 4px;
    margin-right: auto;
    margin-left: 24px;
  }

  .hv3-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hv3-cta-desktop,
  .hv3-login,
  .hv3-divider {
    display: inline-flex;
  }

  .hv3-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
  }

  .hv3-link:hover {
    color: #fff;
  }

  .hv3-item {
    position: relative;
  }

  /* Lift open menu above sibling nav items and page content hit targets. */
  .hv3-item:hover,
  .hv3-item:focus-within,
  .hv3-item.is-open {
    z-index: 60;
  }

  .hv3-item:hover .hv3-chevron,
  .hv3-item:focus-within .hv3-chevron {
    transform: rotate(180deg);
  }

  .hv3-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    min-width: 230px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #231f20;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 20;
  }

  .hv3-dropdown::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
  }

  .hv3-item:hover .hv3-dropdown,
  .hv3-item:focus-within .hv3-dropdown,
  .hv3-item.is-open .hv3-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .hv3-drop-link {
    display: block;
    border-radius: 8px;
    text-decoration: none;
  }

  .hv3-drop-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    border-radius: 8px;
    overflow: hidden;
    isolation: isolate;
  }

  .hv3-drop-item::before {
    content: "";
    position: absolute;
    left: 31px;
    top: 2px;
    z-index: 0;
    width: 84px;
    height: 13px;
    border-radius: 999px;
    background: #f9a215;
    opacity: 0;
    filter: blur(20px);
    transform: translateX(-12px) scale(2.8, 5.5);
    transition: opacity 0.22s ease;
  }

  .hv3-drop-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    opacity: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02) 52%, transparent);
    transition: opacity 0.22s ease;
  }

  .hv3-drop-item > * {
    position: relative;
    z-index: 1;
  }

  .hv3-drop-link:hover .hv3-drop-item::before {
    opacity: 0.4;
  }

  .hv3-drop-link:hover .hv3-drop-item::after {
    opacity: 1;
  }

  .hv3-drop-link:hover .hv3-icon-box {
    border-color: #353132;
  }

  .hv3-lang {
    position: relative;
  }

  .hv3-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
  }

  .hv3-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 8rem;
    padding: 8px;
    display: flex;
    flex-direction: column;
    background: #231f20;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
  }

  /* Bridge the 8px visual gap so hover doesn't drop between button and menu. */
  .hv3-lang-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    height: 8px;
  }

  .hv3-lang:hover .hv3-lang-menu,
  .hv3-lang.is-open .hv3-lang-menu {
    opacity: 1;
    pointer-events: auto;
  }

  .hv3-lang-option {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 9px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
  }

  .hv3-lang-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .hv3-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
  }

  .hv3-login {
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
  }

  .hv3-login:hover {
    background: #353132;
    color: #fff;
  }

  .hv3-user-name {
    max-width: 148px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hv3-user .hv3-dropdown {
    min-width: 248px;
  }

  .hv3-user .hv3-drop-item {
    white-space: nowrap;
  }
}

@media (min-width: 1440px) {
  .hv3-header {
    --hv3-page-pad: 120px;
  }

  .hv3-bar {
    min-height: 102px;
    padding: 30px var(--hv3-page-pad);
  }

  .hv3-desktop {
    gap: 4px;
    margin-left: 40px;
  }

  .hv3-link {
    padding: 8px 16px;
    font-size: 16px;
  }
}
