/* ==========================================================================
   Account menu — site-wide, session-aware dropdown injected into the navbar
   (.zkk-navbar-right) for guests and authenticated visitors. Authenticated
   accounts receive "Minha Conta", "Configurações", "Suporte" and "Sair";
   guests receive the same visual shell with "Entrar com Google" and support.

   Mirrors the .theme-switch / .theme-popup interaction pattern already used
   by the theme toggle in this same navbar (see theme.css), so it reuses the
   navbar-wide tokens (--border, --border-soft, --border-hover,
   --text-secondary, --gradient-brand, --ease) defined in theme.css, which
   every page that has a navbar already loads.
   ========================================================================== */

.account-menu {
  position: relative;
}

.zkk-navbar-right a[hidden],
.zkk-mobile-menu a[hidden] {
  display: none !important;
}

.zkk-navbar-right .account-action-button,
.nav-actions .account-action-button,
.zkk-mobile-menu .account-action-button,
.home-menu .account-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--home-border-hover, var(--border-hover, rgba(169, 74, 255, .42)));
  border-radius: 999px;
  background: rgba(155, 50, 255, .14);
  color: var(--home-purple-light, var(--purple-light, #bc5cff));
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.zkk-navbar-right .account-action-button:hover,
.nav-actions .account-action-button:hover,
.zkk-mobile-menu .account-action-button:hover,
.home-menu .account-action-button:hover {
  border-color: var(--home-purple-light, var(--purple-light, #bc5cff));
  background: rgba(155, 50, 255, .25);
  color: #fff;
}

.zkk-navbar-right .account-action-button:focus-visible,
.nav-actions .account-action-button:focus-visible,
.zkk-mobile-menu .account-action-button:focus-visible,
.home-menu .account-action-button:focus-visible {
  outline: 2px solid var(--home-purple-light, var(--purple-light, #bc5cff));
  outline-offset: 3px;
}

html[data-theme="light"] .zkk-navbar-right .account-action-button:hover,
html[data-theme="light"] .nav-actions .account-action-button:hover,
html[data-theme="light"] .zkk-mobile-menu .account-action-button:hover,
html[data-theme="light"] .home-menu .account-action-button:hover {
  color: #5a0f9e;
}

@media (max-width: 900px) {
  .nav-actions .nav-login.account-action-button {
    display: none;
  }

  .zkk-mobile-menu .account-action-button,
  .home-menu .account-action-button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .zkk-navbar-right .zkk-nav-login.account-action-button {
    display: none;
  }
}

.account-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}

.account-menu-trigger:hover,
.account-menu-trigger[aria-expanded="true"] {
  color: #fff;
  border-color: var(--border-hover);
}

.account-menu-trigger svg {
  width: 19px;
  height: 19px;
}

/* Home page context */
.nav-actions .account-menu {
  position: relative;
}

.nav-actions .account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
}

@media (max-width: 900px) {
  .nav-actions .account-menu-trigger {
    display: none;
  }
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  gap: 3px;
  min-width: 260px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.99), rgba(8, 8, 10, 0.99));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.account-menu-panel.open {
  display: flex;
}

.account-menu-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px 12px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border-soft);
}

.account-menu-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-menu-email {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-header-guest {
  align-items: flex-start;
}

.account-menu-session-status {
  padding: 4px 12px 10px;
  color: var(--text-secondary, #a3a3ad);
  font-size: 12px;
  line-height: 1.45;
}

.account-menu-avatar-guest svg {
  width: 17px;
  height: 17px;
}

.account-menu-guest-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-menu-guest-copy strong {
  color: var(--text-primary, #fff);
  font-size: 13.5px;
}

.account-menu-guest-copy small {
  color: var(--text-secondary, #a3a3ad);
  font-size: 12px;
  line-height: 1.45;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary, #fff);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.account-menu-item:not(.account-menu-item-primary):not(.account-menu-item-logout) {
  color: var(--text-secondary);
}

.account-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.account-menu-item-primary {
  background: rgba(155, 50, 255, 0.16);
  color: var(--purple-light, #bc5cff);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(188, 92, 255, 0.35);
}

.account-menu-item-primary:hover {
  background: rgba(155, 50, 255, 0.26);
  color: var(--purple-light, #bc5cff);
}

/* Icon chip: a filled square behind each item's icon so it reads as a
   distinct glyph instead of a thin, same-color-as-text line lost against
   the dark panel. */
.account-menu-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.account-menu-item:hover .account-menu-item-icon {
  background: rgba(255, 255, 255, 0.1);
}

.account-menu-item-primary .account-menu-item-icon {
  background: rgba(255, 255, 255, 0.14);
}

.account-menu-item-logout .account-menu-item-icon {
  background: rgba(255, 77, 79, 0.14);
}

.account-menu-item-logout:hover .account-menu-item-icon {
  background: rgba(255, 77, 79, 0.22);
}

.account-menu-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* The Google "G" is already multi-colored and drawn full-bleed — it doesn't
   want the icon-chip tint or a currentColor stroke sizing. */
.account-menu-item-icon-google {
  background: #fff;
}

.account-menu-item-icon-google svg {
  width: 18px;
  height: 18px;
}

.account-menu-item-logout {
  color: #ff9d9d;
}

.account-menu-item-logout:hover {
  background: rgba(255, 77, 79, 0.12);
  color: #ffb3b3;
}

.account-menu-divider {
  height: 1px;
  margin: 5px 3px;
  background: var(--border-soft);
}

html[data-theme="light"] .account-menu-trigger {
  background: rgba(20, 10, 30, 0.03);
}

html[data-theme="light"] .account-menu-item-icon {
  background: rgba(20, 10, 30, 0.05);
}

html[data-theme="light"] .account-menu-item:hover .account-menu-item-icon {
  background: rgba(20, 10, 30, 0.08);
}

html[data-theme="light"] .account-menu-item-logout .account-menu-item-icon {
  background: rgba(220, 38, 38, 0.1);
}

html[data-theme="light"] .account-menu-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 252, 0.98));
  box-shadow: 0 20px 45px rgba(20, 10, 30, 0.14);
}

html[data-theme="light"] .account-menu-item:hover {
  background: rgba(20, 10, 30, 0.05);
  color: #14101c;
}

html[data-theme="light"] .account-menu-item-logout {
  color: #c0392b;
}

html[data-theme="light"] .account-menu-item-logout:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #a3291a;
}

@media (max-width: 420px) {
  .account-menu-panel {
    right: -4px;
    min-width: min(260px, calc(100vw - 32px));
  }
}
