/**
 * بوابات الدخول والتسجيل — تراث نجدي + شعار سعد محفور
 */
body.page-auth-gate {
  min-height: 100dvh;
  margin: 0;
  font-family: "IBM Plex Sans Arabic", "Almarai", system-ui, sans-serif;
  color: #f8f6f0;
  background-color: #0d2818;
  position: relative;
  overflow-x: hidden;
}

/* الخلفية من saad-heritage-poster.css عند page-heritage */
body.page-auth-gate:not(.page-heritage)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(165deg, #1b4332, #0d2818);
  pointer-events: none;
}

body.page-auth-gate .saad-heritage-deco {
  z-index: 0;
}

body.page-auth-gate .auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
}

.auth-card {
  width: min(100%, 440px);
  padding: clamp(1.35rem, 4vw, 2rem);
  border-radius: 22px;
  border: 1px solid rgba(196, 165, 116, 0.32);
  background: rgba(8, 24, 16, 0.88);
  backdrop-filter: blur(14px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.auth-card__brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(196, 165, 116, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.auth-card__brand strong {
  display: block;
  font-size: 1.15rem;
  color: #e8dcc8;
}

.auth-card__brand small {
  display: block;
  font-size: 0.78rem;
  color: rgba(248, 246, 240, 0.62);
  margin-top: 0.15rem;
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 4vw, 1.45rem);
  color: #d4af37;
  font-weight: 800;
}

.auth-card__lead {
  margin: 0 0 1.15rem;
  font-size: 0.86rem;
  line-height: 1.65;
  color: rgba(248, 246, 240, 0.72);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.auth-field span {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(232, 220, 200, 0.85);
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: rgba(4, 12, 8, 0.75);
  color: #f8f6f0;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(82, 183, 136, 0.75);
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.45);
}

.auth-field input::placeholder {
  color: rgba(248, 246, 240, 0.35);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.78rem 1rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.auth-btn--primary {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #f8f6f0;
  margin-top: 0.25rem;
}

.auth-btn--ghost {
  background: transparent;
  color: #e8dcc8;
  border: 1px solid rgba(196, 165, 116, 0.35);
  width: auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
}

.auth-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-status {
  min-height: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: rgba(248, 246, 240, 0.7);
  text-align: center;
}

.auth-status.is-error {
  color: #f4a6a6;
}

.auth-status.is-ok {
  color: #95d5b2;
}

.auth-foot {
  margin-top: 1.15rem;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.8;
}

.auth-foot a {
  color: #d4af37;
  text-decoration: none;
}

.auth-foot a:hover {
  text-decoration: underline;
}

.auth-details {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(196, 165, 116, 0.22);
  background: rgba(4, 12, 8, 0.45);
}

.auth-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: #e8dcc8;
}

.auth-details .auth-form {
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  .auth-card {
    border-radius: 18px;
    padding: 1.15rem;
  }
}
