/* Global auth widget: an upper-right control on every page + a sign-in /
   create-account modal. Self-contained so it works on pages that don't load
   camps.css. Backed by the shared HSAuth session (auth.js). */

.site-auth { position: absolute; top: 0.9rem; right: 1rem; z-index: 60; }
/* The global widget replaces the camps page's in-header "My account" link. */
#nav-account-link { display: none !important; }
.site-auth-btn {
  font-family: inherit; font-size: 0.9rem; font-weight: 700;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem; cursor: pointer; line-height: 1.1;
  background: rgba(255, 255, 255, 0.92); color: var(--color-navy, #12233b);
}
.site-auth-btn:hover { background: #fff; }
.site-auth-cta { background: var(--color-accent, #0a92dd); color: #fff; border-color: transparent; }
/* Explicit hover background so the more-specific .site-auth-btn:hover (white)
   can't win and leave white text on a white button. */
.site-auth-cta:hover { background: #0879ba; color: #fff; }

.site-auth-menu { position: relative; }
#sa-account { display: inline-flex; align-items: center; gap: 0.5rem; }
.sa-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--color-accent, #e8730c); color: #fff; font-size: 0.8rem;
}
.sa-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-auth-dropdown {
  position: absolute; right: 0; top: calc(100% + 0.4rem);
  background: #fff; border: 1px solid #e3e8ec; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); min-width: 12rem; padding: 0.4rem;
  display: flex; flex-direction: column;
}
/* The `display:flex` above is an author style that otherwise overrides the
   browser's [hidden] { display:none }, leaving the menu permanently open. This
   makes the `hidden` attribute (toggled by the JS) actually hide it. */
.site-auth-dropdown[hidden] { display: none; }
.site-auth-dropdown a, .site-auth-dropdown button {
  text-align: left; background: none; border: none; padding: 0.6rem 0.8rem;
  font: inherit; color: var(--color-navy, #12233b); text-decoration: none;
  border-radius: 6px; cursor: pointer;
}
.site-auth-dropdown a:hover, .site-auth-dropdown button:hover { background: #f4f7f9; }

/* Modal */
.sa-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 1rem 1rem; overflow-y: auto;
}
.sa-modal {
  position: relative; background: #fff; width: 100%; max-width: 420px;
  border-radius: 14px; padding: 1.6rem 1.5rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.sa-close {
  position: absolute; top: 0.6rem; right: 0.8rem; background: none; border: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: #667;
}
.sa-h { margin: 0 0 1rem; color: var(--color-navy, #12233b); font-size: 1.4rem; }
.sa-field { margin-bottom: 0.8rem; display: flex; flex-direction: column; }
.sa-field label { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--color-navy, #12233b); }
.sa-field input { padding: 0.6rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.sa-hint { font-size: 0.8rem; color: #667; margin: -0.4rem 0 0.6rem; }
.sa-error { color: #b3261e; font-size: 0.9rem; min-height: 1em; margin: 0 0 0.4rem; }
.sa-submit { width: 100%; padding: 0.7rem; font-size: 1rem; margin-top: 0.2rem; }
.sa-link { background: none; border: none; color: var(--color-accent, #e8730c); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.sa-toggle { text-align: center; font-size: 0.9rem; margin: 0.9rem 0 0; color: #445; }
.sa-or { text-align: center; color: #889; font-size: 0.85rem; margin: 1rem 0 0.75rem; }

/* OAuth buttons — scoped to the modal so they never touch camps.css usages. */
.sa-oauth .oauth-btn {
  display: flex; width: 100%; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 0.65rem 1rem; border-radius: 8px; font-family: inherit;
  font-size: 1rem; font-weight: 700; border: 1px solid transparent; cursor: pointer;
}
.sa-oauth .oauth-btn + .oauth-btn { margin-top: 0.6rem; }
.sa-oauth .oauth-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sa-oauth .oauth-google { background: #fff; color: #3c4043; border-color: #dadce0; }
.sa-oauth .oauth-google:hover { background: #f8f9fa; }
.sa-oauth .oauth-apple { background: #000; color: #fff; }
.sa-oauth .oauth-apple:hover { background: #1a1a1a; }
.sa-oauth .oauth-facebook { background: #1877f2; color: #fff; }
.sa-oauth .oauth-facebook:hover { background: #1568d3; }

@media (max-width: 480px) {
  .site-auth { top: 0.6rem; right: 0.6rem; }
  .site-auth-btn { font-size: 0.8rem; padding: 0.45rem 0.7rem; }
  .sa-name { max-width: 6rem; }
}
