/* css/auth.css
   Styles for js/auth.js: the full-screen sign-in gate, the access-denied
   gate, avatar dropdown, and the amber read-only badge. Dark theme only.
   Uses ONLY the CSS custom properties defined in css/admin.css (:root in
   that file must load first / be present in the cascade).
*/

/* ---- Full-screen gate wrapper (#view; sign-in AND access-denied) -------- */
/* The site has no anonymous read access: js/app.js renders one of these two
   gates into #view, centered in the space below the 56px top bar, instead
   of any dashboard/search content. */

.auth-gate {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ---- Sign-in card (full-screen gate, anonymous) -------------------------- */

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.auth-modal-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-bright);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}

.auth-modal-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  margin: 0 0 1.5rem;
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-input {
  font-family: "Inter", sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.auth-input:focus {
  border-color: var(--accent);
}

.auth-alert {
  font-size: 0.8125rem;
  color: var(--red);
  background: var(--red-tint);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.auth-submit-btn {
  font-family: "Inter", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.auth-submit-btn:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-modal-footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--dim);
}

/* ---- Access-denied card (full-screen gate, signed in / not manager) ----- */

.auth-denied-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.auth-denied-icon {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  background: var(--red-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-denied-icon-bar {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--red);
}

.auth-denied-title {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1.3125rem;
  color: var(--text);
}

.auth-denied-desc {
  margin: 0;
  font-size: 0.84375rem;
  line-height: 1.6;
  color: var(--muted);
}

.auth-denied-email {
  font-size: 0.75rem;
  color: var(--dim);
}

.auth-denied-email b {
  color: var(--muted);
  font-weight: 600;
}

.auth-denied-actions {
  margin-top: 0.375rem;
}

.auth-denied-signout-btn {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-denied-signout-btn:hover {
  background: var(--surface2);
  border-color: var(--dim);
}

/* ---- Avatar menu (top bar, signed-in) ------------------------------------ */

.auth-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-badge-readonly {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-tint);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  white-space: nowrap;
}

.auth-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
}

.auth-avatar-btn:hover {
  background: var(--surface2);
}

.auth-avatar-circle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--navy);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
}

.auth-chevron {
  color: var(--muted);
  font-size: 0.6875rem;
}

.auth-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
}

.auth-dropdown-email {
  padding: 0.75rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--muted);
  border-bottom: 1px solid var(--outline);
  word-break: break-all;
}

.auth-dropdown-signout {
  display: block;
  width: 100%;
  text-align: left;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
}

.auth-dropdown-signout:hover {
  background: var(--surface2);
}
