/*!
 * site-auth.css — sagecipher.com auth slot + modal.
 * House palette: bg #0b0e0a · panel #12160f · hairline #232b1f · ink #e8ece3
 * dim #9aa594 · sage #a3b18a · bright #c2d5aa
 * One extra token: --scauth-alert (muted clay) is used only for error text.
 */

.scauth-backdrop {
  --scauth-bg: #0b0e0a;
  --scauth-panel: #12160f;
  --scauth-line: #232b1f;
  --scauth-ink: #e8ece3;
  --scauth-dim: #a8b3a1;
  --scauth-sage: #a3b18a;
  --scauth-bright: #c2d5aa;
  --scauth-alert: #d08a7d;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 14, 10, 0.62);
}

.scauth-backdrop[hidden] {
  display: none;
}

/* ---------- nav slot ---------- */

.scauth-slot {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}

.scauth-slot--pill {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9000;
  padding: 8px 12px;
  background: var(--scauth-panel, #12160f);
  border: 1px solid var(--scauth-line, #232b1f);
}

.scauth-handle {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--scauth-dim, #9aa594);
}

/* ---------- buttons ---------- */

.scauth-btn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0b0e0a;
  background: #a3b18a;
  border: 1px solid #a3b18a;
  border-radius: 2px;
  padding: 8px 14px;
  cursor: pointer;
  line-height: 1.2;
}

.scauth-btn:hover {
  background: #c2d5aa;
  border-color: #c2d5aa;
}

.scauth-btn:focus-visible {
  outline: 2px solid #c2d5aa;
  outline-offset: 2px;
}

.scauth-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.scauth-btn--ghost {
  background: transparent;
  color: #9aa594;
  border-color: #232b1f;
  padding: 6px 10px;
}

.scauth-btn--ghost:hover {
  background: transparent;
  color: #e8ece3;
  border-color: #a3b18a;
}

/* ---------- sheet ---------- */

.scauth-sheet {
  width: 420px;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #171d14;
  border: 1px solid #33402d;
  border-radius: 2px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.scauth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.scauth-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 300;
  font-size: 26px;
  line-height: 1.2;
  color: #e8ece3;
}

.scauth-close {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9aa594;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.scauth-close:hover {
  color: #e8ece3;
}

.scauth-close:focus-visible {
  outline: 2px solid #c2d5aa;
  outline-offset: 2px;
}

.scauth-reason {
  margin: 8px 0 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: #9aa594;
}

.scauth-reason[hidden] {
  display: none;
}

/* ---------- tabs ---------- */

.scauth-tabs {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  border-bottom: 1px solid #232b1f;
}

.scauth-tab {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9aa594;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 0;
  cursor: pointer;
}

.scauth-tab:hover {
  color: #e8ece3;
}

.scauth-tab[aria-selected="true"] {
  color: #c2d5aa;
  border-bottom-color: #a3b18a;
}

.scauth-tab:focus-visible {
  outline: 2px solid #c2d5aa;
  outline-offset: 2px;
}

/* ---------- form ---------- */

.scauth-panel {
  margin-top: 18px;
}

.scauth-panel[hidden] {
  display: none;
}

.scauth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scauth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scauth-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9aa594;
}

.scauth-input {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: #e8ece3;
  background: #0b0e0a;
  border: 1px solid #232b1f;
  border-radius: 2px;
  padding: 10px 12px;
}

.scauth-input:focus {
  outline: none;
  border-color: #a3b18a;
}

.scauth-input::placeholder {
  color: #5f6a58;
}

.scauth-help {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #9aa594;
}

.scauth-error {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #d08a7d;
  border-left: 2px solid #d08a7d;
  padding-left: 10px;
}

.scauth-error[hidden] {
  display: none;
}

/* ---------- submit + spinner ---------- */

.scauth-submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
}

.scauth-spin {
  display: none;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(11, 14, 10, 0.35);
  border-top-color: #0b0e0a;
  border-radius: 50%;
  animation: scauth-spin 0.7s linear infinite;
}

.scauth-btn.is-busy .scauth-spin {
  display: inline-block;
}

@keyframes scauth-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- phones: full-width sheet (tested at 390px) ---------- */

@media (max-width: 480px) {
  .scauth-backdrop {
    align-items: flex-end;
  }

  .scauth-sheet {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 20px 16px 24px;
  }

  .scauth-submit {
    align-self: stretch;
    justify-content: center;
  }

  .scauth-slot--pill {
    top: auto;
    bottom: 14px;
    right: 14px;
  }
}

/* Forum-specific placement for inline post errors and the logged-out hint. */
.forum-post-error {
  margin: 10px 0 0; font-size: 13px; color: #e2a3a3;
  border-left: 2px solid rgba(226,163,163,0.5); padding-left: 10px;
}
.forum-auth-hint {
  margin: 0 0 18px; font-size: 13px; color: #9fb0a0;
  border: 1px solid rgba(163,177,138,0.22); border-radius: 8px;
  background: rgba(163,177,138,0.06); padding: 10px 14px;
}
