/* Shared navigation for the public website, console, login and payment pages. */
:root {
  --site-nav-max-width: 1200px;
  --site-nav-radius: 18px;
  --site-nav-primary: #2563eb;
  --site-logo-width: 80px;
  --site-logo-height: 36px;
}

.top-nav-wrap {
  width: 100%;
  padding: 12px 12px 8px;
  box-sizing: border-box;
}

.top-nav-wrap * { box-sizing: border-box; }
.site-header { position: sticky; top: 0; z-index: 50; }

.top-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--site-nav-max-width);
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 18px;
  border: 1px solid #e5e7eb;
  border-radius: var(--site-nav-radius);
  background: #fff;
  color: #111827;
  font: 13px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.top-nav .brand {
  display: inline-flex;
  flex: none;
  width: var(--site-logo-width);
  height: var(--site-logo-height);
  overflow: hidden;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  text-decoration: none;
}

/* Fit the entire source inside the shared frame, regardless of its aspect
   ratio or transparent padding. Replacing the asset must not crop the mark. */
.top-nav .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.top-nav-actions, .top-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-nav .nav-links {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.top-nav .nav-link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #4b5563;
  background: transparent;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .12s ease-out, color .12s ease-out;
}

.top-nav .nav-link-pill:hover { color: #1d4ed8; background: #eff6ff; }
.top-nav .nav-link-pill.active,
.top-nav .nav-link-pill[aria-current="page"],
.top-nav .nav-cta {
  border-color: var(--site-nav-primary);
  color: #fff;
  background: var(--site-nav-primary);
  font-weight: 600;
}

.top-nav .nav-link-pill.active:hover,
.top-nav .nav-link-pill[aria-current="page"]:hover,
.top-nav .nav-cta:hover { color: #fff; background: #1d4ed8; }

.top-nav .icon-btn, .top-nav .nav-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #111827;
  background: #fff;
  font: inherit;
  box-shadow: none;
  cursor: pointer;
}

.top-nav .icon-btn svg { width: 18px; height: 18px; }
.top-nav .nav-toggle { display: none; font-size: 20px; }
.top-nav .icon-btn:hover, .top-nav .nav-toggle:hover { background: #f3f4f6; filter: none; }
.top-nav :is(a, button):focus-visible { outline: 2px solid var(--site-nav-primary); outline-offset: 3px; }

/* Login keeps its form centered below the same shared header. */
.site-login-page { display: flex; flex-direction: column; }
.site-login-page .login-main { display: grid; flex: 1; place-items: center; width: 100%; padding: 24px 12px; }

@media (max-width: 960px) {
  .top-nav { flex-wrap: wrap; gap: 8px 12px; }
  .top-nav .nav-toggle { display: inline-flex; }
  .top-nav > .nav-links, .top-nav > .top-nav-actions { display: none; }
  .top-nav[data-menu-open="true"] > .nav-links,
  .top-nav[data-menu-open="true"] > .top-nav-actions { display: flex; }
  .top-nav > .nav-links, .top-nav > .top-nav-actions {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
  }
  .top-nav .nav-links, .top-nav-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .top-nav-actions .nav-links { width: 100%; }
  .top-nav .nav-link-pill { justify-content: flex-start; white-space: normal; }
  .top-nav .icon-btn { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .top-nav .nav-link-pill { transition: none; }
}
