/* The account pill (shared/account-link.js): "Inloggen", or avatar + nickname / "Mijn zaak" / "Beheer".
   Works on both style families: the plain pages (shared/page.css: --page-text) and the home-style pages
   (home.css, voor-zaken.css: --ink, --card, --line). Light and dark follow those tokens. */

/* The row above a plain page (ladder, prijzen, prijs, legal pages) that keeps the pill top right. */
.account-bar {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 16px 0;
  display: flex;
  justify-content: flex-end;
}

/* Same width as the text column of the legal pages. */
.account-bar--prose { max-width: calc(40em + 32px); }

/* Reserves the pill's height so the page does not jump when it appears. */
.account-link-host {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  max-width: 100%;
}

/* Right-hand group of a nav: pill next to the nav's own button. */
.nav-end {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-link {
  --al-ink: var(--page-text, var(--ink, #1d1a16));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid color-mix(in srgb, var(--al-ink) 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--al-ink) 6%, transparent);
  color: var(--al-ink);
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.account-link.has-avatar { padding-left: 8px; }

.account-link__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-link .av-img { display: inline-flex; flex: none; border-radius: 50%; line-height: 0; }
.account-link .av-img svg { display: block; width: 100%; height: 100%; }

@media (hover: hover) {
  .account-link:hover { background: color-mix(in srgb, var(--al-ink) 13%, transparent); }
}

.account-link:focus-visible {
  outline: 3px solid var(--al-ink);
  outline-offset: 3px;
}

/* Home style (bold edge and offset shadow, as the .btn of those pages): set data-style="bold" on the mount point. */
.account-link-host[data-style="bold"] .account-link {
  border: 3px solid var(--line, var(--al-ink));
  background: var(--card, transparent);
  box-shadow: 3px 3px 0 var(--line, var(--al-ink));
  transition: transform .12s, box-shadow .12s;
}

@media (hover: hover) {
  .account-link-host[data-style="bold"] .account-link:hover {
    background: var(--card, transparent);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--line, var(--al-ink));
  }
}

.account-link-host[data-style="bold"] .account-link:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line, var(--al-ink));
}

/* A long nickname is cut off instead of pushing the header apart. */
.account-link__label { max-width: 11em; }

@media (max-width: 520px) {
  .account-link { padding: 0 12px; }
  .account-link.has-avatar { padding-left: 8px; }
  .account-link__label { max-width: 7.5em; }
  /* The nav's own button (a second link to a section further down) makes room for the pill. */
  .nav-end > .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .account-link-host[data-style="bold"] .account-link { transition: none; }
}
