/* Shared homepage and client portal language selector. */
.header-language {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.header-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 0;
  padding: 6px 4px;
  color: #1a2533;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s ease;
}

.header-lang-btn:hover,
.header-language.open .header-lang-btn,
.header-language:hover .header-lang-btn {
  color: var(--brand, var(--client-brand, #0a68ac));
}

.lang-dropdown-panel {
  position: absolute;
  top: calc(100% - 2px);
  right: -16px;
  z-index: 1050;
  width: 460px;
  max-width: 92vw;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(15, 36, 54, .12), 0 2px 6px rgba(0, 0, 0, .04);
  padding: 24px 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.header-language.open .lang-dropdown-panel,
.header-language:hover .lang-dropdown-panel,
.header-language:focus-within .lang-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-dropdown-arrow {
  position: absolute;
  top: -6px;
  right: 32px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  transform: rotate(45deg);
  z-index: 2;
}

.lang-grid {
  display: flex;
  gap: 36px;
}

.lang-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  color: #1a2533;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}

.lang-item:hover {
  color: #0b63b8;
  background: #f8fafc;
}

.lang-item.active {
  color: #0b63b8;
  font-weight: 700;
}

.lang-flag-svg {
  width: 22px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, .35);
  display: block;
}

.lang-icon-globe {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: #1a2533;
}

.lang-item:hover .lang-icon-globe,
.lang-item.active .lang-icon-globe {
  color: var(--brand, var(--client-brand, #0a68ac));
}

.mobile-language-selector,
.mobile-menu-tools {
  display: none;
}

.header-currency .currency-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  color: #1a2533;
  font-size: 14px;
  list-style: none;
  cursor: pointer;
}

.currency-toggle::-webkit-details-marker {
  display: none;
}

.currency-toggle strong {
  font-weight: 500;
}

.currency-label {
  display: none;
}

.header-currency > .currency-options {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  min-width: 140px;
  display: grid;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 36, 54, .12);
}

.header-currency:not([open]) > .currency-options {
  display: none;
}

.header-currency .currency-option {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 4px;
  color: #1a2533;
  text-decoration: none;
}

.header-currency .currency-option:hover,
.header-currency .currency-option.active {
  color: #0a68ac;
  background: #f0f7ff;
}

@media (max-width: 991.98px) {
  .mobile-menu-tools {
    display: block;
  }

  .mobile-menu-tools .header-currency {
    display: block;
    width: 100%;
  }

  .mobile-menu-tools .header-currency .currency-toggle {
    min-height: 44px;
    padding: 10px 6px;
  }

  .mobile-menu-tools .currency-label {
    display: inline;
    margin-right: auto;
  }

  .mobile-menu-tools .header-currency > .currency-options {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px 6px 8px;
    border: 0;
    box-shadow: none;
  }

  .mobile-auth-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 6px 0;
  }

  .mobile-auth-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #0a68ac;
    border-radius: 4px;
    color: #0a68ac;
    font-weight: 600;
    text-decoration: none;
  }

  .mobile-auth-links .mobile-sign-up {
    background: #0a68ac;
    color: #fff;
  }

  .mobile-language-selector {
    display: block;
    padding-top: 8px;
  }

  .mobile-language-selector .header-language {
    display: block;
    height: auto;
  }

  .mobile-language-selector .header-lang-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 6px;
  }

  .mobile-language-selector .lang-dropdown-panel {
    position: static;
    display: none;
    width: 100%;
    max-width: none;
    padding: 12px 6px;
    border: 0;
    box-shadow: none;
    transform: none;
  }

  .mobile-language-selector .header-language.open .lang-dropdown-panel {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-language-selector .lang-dropdown-arrow {
    display: none;
  }

  .mobile-language-selector .lang-grid {
    gap: 12px;
  }

  .mobile-language-selector .lang-col {
    min-width: 0;
    gap: 4px;
  }

  .mobile-language-selector .lang-item {
    min-height: 44px;
    gap: 8px;
    white-space: normal;
  }
}

