.nav-auth-item {
  position: relative;
}

.nav-auth-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0.5rem 0.75rem;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}

.nav-auth-trigger:hover,
.nav-auth-trigger:focus-visible {
  color: var(--accent, #b5422c);
}

.nav-auth-trigger--user {
  font-weight: 600;
  color: var(--accent-secondary, #2f5d50);
}

.nav-auth-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  min-width: 280px;
  max-width: min(92vw, 320px);
  padding: 16px;
  background: var(--surface, #faf7f2);
  border: 1px solid var(--border, #d6d0c4);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.nav-auth-panel.hidden {
  display: none !important;
}

.nav-auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.nav-auth-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-alt, #edebe4);
  font-size: 0.85rem;
  cursor: pointer;
}

.nav-auth-tab.active {
  background: var(--accent-secondary, #2f5d50);
  color: #fff;
  border-color: var(--accent-secondary, #2f5d50);
}

.nav-auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-auth-form.hidden {
  display: none !important;
}

.nav-auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: var(--surface, #faf7f2);
}

.nav-auth-submit {
  margin-top: 4px;
  padding: 10px 14px;
  background: var(--accent-secondary, #2f5d50);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.nav-auth-submit:hover {
  opacity: 0.92;
}

.nav-auth-error {
  margin: 0;
  font-size: 0.82rem;
  color: #b42318;
}

.nav-auth-error.hidden {
  display: none !important;
}

.nav-auth-user-line {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted, #6b665c);
}

.nav-auth-menu-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  text-align: left;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-secondary, #2f5d50);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.nav-auth-menu-link:hover {
  background: var(--surface-alt, #edebe4);
}

.nav-auth-logout {
  color: #b42318;
}

[data-theme='dark'] .nav-auth-panel {
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
  .nav-auth-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    border-radius: 12px 12px 0 0;
  }
}
