/* ============================
   LocalsOutpost — Auth Stage
   Full-viewport modern login / signup
   ============================ */

:root {
  --lo-ink: #1a2418;
  --lo-forest: #2f4f2f;
  --lo-leaf: #3d6b3d;
  --lo-moss: #6b8f6b;
  --lo-sand: #f3efe6;
  --lo-cream: #faf7f1;
  --lo-line: rgba(47, 79, 47, 0.18);
  --lo-danger: #9b2c2c;
  --lo-auth-font: var(--lo-body-font, 'Nunito', 'Segoe UI', sans-serif);
  --lo-auth-display: var(--lo-logo-font, 'Nunito', sans-serif);
}

.auth-stage {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-stage.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-stage__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(107, 143, 107, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(47, 79, 47, 0.35), transparent 50%),
    linear-gradient(160deg, #1f3320 0%, #2f4f2f 42%, #445c3a 100%);
}

.auth-stage__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.auth-stage__panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.98) 0%, rgba(243, 239, 230, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--lo-ink);
  font-family: var(--lo-auth-font);
  transform: translateY(28px) scale(0.98);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.auth-stage.is-open .auth-stage__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.auth-stage__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--lo-forest);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-stage__close:hover {
  background: rgba(47, 79, 47, 0.08);
  transform: rotate(90deg);
}

.auth-stage__logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0.15rem 0 0.65rem;
  animation: authRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-stage__logo {
  display: block;
  width: min(220px, 72%);
  height: auto;
  object-fit: contain;
}

.auth-stage__tagline {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: rgba(26, 36, 24, 0.72);
  text-align: center;
  animation: authRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.auth-stage__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: rgba(47, 79, 47, 0.08);
  animation: authRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.auth-stage__tab {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 0.5rem;
  background: transparent;
  color: var(--lo-forest);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.auth-stage__tab:hover {
  background: rgba(255, 255, 255, 0.45);
}

.auth-stage__tab.is-active {
  background: #fff;
  color: var(--lo-ink);
  transform: translateY(-1px);
}

.auth-stage__form {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  animation: authRise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-stage__form.is-active {
  display: flex;
}

.auth-stage__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-stage__field label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(26, 36, 24, 0.7);
}

.auth-stage__field input {
  width: 100%;
  height: 3.1rem;
  padding: 0 0.95rem;
  border: 1px solid var(--lo-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--lo-ink);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.auth-stage__field input:focus {
  outline: none;
  border-color: var(--lo-leaf);
  background: #fff;
  transform: translateY(-1px);
}

.auth-stage__submit {
  margin-top: 0.35rem;
  height: 3.15rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lo-forest) 0%, var(--lo-leaf) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.auth-stage__submit:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.auth-stage__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-stage__hint {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: rgba(26, 36, 24, 0.62);
  text-align: center;
}

.auth-stage__hint button {
  border: 0;
  background: none;
  color: var(--lo-forest);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-stage__error {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lo-danger);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth-stage__error.is-visible {
  opacity: 1;
}

.auth-stage__footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--lo-line);
  font-size: 0.8rem;
  color: rgba(26, 36, 24, 0.55);
  text-align: center;
  animation: authRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.auth-locked {
  overflow: hidden;
}

/* Login trigger polish (site-wide buttons that open auth) */
.lo-login-btn.nav-login-btn {
  font-family: var(--lo-logo-font, 'Nunito', sans-serif);
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.auth-stage__tab,
.auth-stage__submit,
.auth-stage__field label {
  font-family: var(--lo-logo-font, 'Nunito', sans-serif);
  font-style: normal;
}

.auth-stage__tab { font-weight: 700; }
.auth-stage__submit { font-weight: 800; }
.auth-stage__field label { font-weight: 700; }

@media (max-width: 520px) {
  .auth-stage {
    padding: 0;
    place-items: stretch;
  }

  .auth-stage__panel {
    width: 100%;
    max-height: none;
    min-height: 100%;
    border-radius: 0;
    padding: 2.5rem 1.35rem 2rem;
  }

  .auth-stage.is-open .auth-stage__panel {
    transform: translateY(0);
  }
}
