/* Shared header nav (help button + user dropdown) and help modal styles.
 * Assumes the page defines CSS variables --brand-primary, --brand-primary-hover,
 * --surface, --surface-alt, --border, --text, --text-muted, --text-subtle. */

.nav-action { display: inline-flex; align-items: center; gap: 0.375rem; background: transparent; border: none; color: rgba(255,255,255,0.85); font: inherit; font-size: 0.875rem; text-decoration: none; cursor: pointer; padding: 0.375rem 0.625rem; border-radius: 6px; transition: background 0.15s, color 0.15s; }
.nav-action:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-action svg { width: 16px; height: 16px; }

.nav-help-btn { background: transparent; border: none; color: rgba(255,255,255,0.85); cursor: pointer; padding: 0.375rem; border-radius: 50%; transition: color 0.15s, background 0.15s; display: flex; align-items: center; justify-content: center; }
.nav-help-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

.nav-user { position: relative; font-size: 0.875rem; }
.nav-user-btn { display: inline-flex; align-items: center; gap: 0.5rem; background: transparent; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 0.375rem 0.875rem 0.375rem 0.625rem; color: rgba(255,255,255,0.9); font: inherit; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.nav-user-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.32); }
.nav-user-btn .icon-user { width: 16px; height: 16px; }
.nav-user-btn .icon-menu { width: 20px; height: 20px; display: none; }
.nav-user-btn .chev-down { width: 12px; height: 12px; opacity: 0.7; }
.nav-user-menu { position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 200px; white-space: nowrap; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); padding: 0.375rem; display: none; z-index: 200; }
.nav-user.open .nav-user-menu { display: block; }
.nav-user-menu-header { padding: 0.5rem 0.625rem 0.625rem; border-bottom: 1px solid var(--border); margin-bottom: 0.375rem; font-size: 0.75rem; color: var(--text-subtle); word-break: break-all; }
.nav-user-menu-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; background: transparent; border: none; font: inherit; font-size: 0.875rem; color: var(--text); text-align: left; padding: 0.5rem 0.625rem; border-radius: 4px; cursor: pointer; text-decoration: none; box-sizing: border-box; }
.nav-user-menu-item:hover { background: var(--surface-alt); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: siteNavFadeIn 0.15s ease-out; overscroll-behavior: contain; }
.modal-backdrop.closing { animation: siteNavFadeOut 0.14s ease-in forwards; }
body:has(> .modal-backdrop) { overflow: hidden; }
.modal { background: #fff; border-radius: 8px; padding: 1.5rem; max-width: 420px; width: calc(100% - 2rem); box-shadow: 0 10px 40px rgba(0,0,0,0.15); animation: siteNavPopIn 0.15s ease-out; }
.modal-backdrop.closing .modal { animation: siteNavPopOut 0.14s ease-in forwards; }
.modal label { display: block; font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.modal input[type="text"], .modal input[type="email"] { width: 100%; padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9375rem; font-family: inherit; margin-bottom: 0.875rem; background: var(--surface); color: var(--text); box-sizing: border-box; }
.modal input:focus { outline: none; border-color: var(--brand-primary); }
.modal textarea { width: 100%; padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9375rem; font-family: inherit; margin-bottom: 0.875rem; background: var(--surface); color: var(--text); box-sizing: border-box; resize: vertical; min-height: 80px; }
.modal textarea:focus { outline: none; border-color: var(--brand-primary); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }

.help-options { display: flex; flex-direction: column; gap: 0; margin-bottom: 0.875rem; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.help-option { display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 0.75rem; cursor: pointer; font-size: 0.9375rem; color: var(--text); transition: background 0.15s; }
.help-option:hover { background: rgba(74,124,89,0.04); }
.help-option.selected { background: rgba(74,124,89,0.08); }
.help-option .help-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s; }
.help-option.selected .help-radio { border-color: var(--brand-primary); }
.help-option.selected .help-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); }
.help-success { color: var(--text-muted); font-size: 0.9375rem; text-align: center; padding: 1rem 0; }

@keyframes siteNavFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes siteNavFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes siteNavPopIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes siteNavPopOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.98); } }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal, .modal-backdrop.closing, .modal-backdrop.closing .modal { animation: none; }
}

@media (max-width: 600px) {
  .nav-user-btn { padding: 0.375rem 0.5rem; border-color: transparent; }
  .nav-user-btn .email, .nav-user-btn .chev-down, .nav-user-btn .icon-user { display: none; }
  .nav-user-btn .icon-menu { display: block; }
  .modal { padding: 1.25rem; }
  .modal-backdrop:has(#help-form) .modal, .modal-backdrop:has(.help-success) .modal { max-width: none; width: 100%; height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-backdrop:has(#help-form) #help-form { flex: 1; display: flex; flex-direction: column; }
  .modal-backdrop:has(#help-form) #help-desc { flex: 1; }
  .modal-backdrop:has(#help-form) .modal-actions { margin-top: auto; }
}
