/**
 * هوية الملصق التراثي — مطابقة المرجع البصري (أشكال فقط، بدون خط نجدي)
 * أخضر ملكي #1B4332 · كريمي #F8F6F0 · ذهبي #C4A574 · بيج الرسوم #E8DCC8
 */
:root {
  --poster-green: #1b4332;
  --poster-green-deep: #0d2818;
  --poster-cream: #f8f6f0;
  --poster-ink: #e8dcc8;
  --poster-gold: #c4a574;
  --poster-mint: #8fb89e;
}

/* ——— خلفية الملصق على كل الصفحات التراثية ——— */
body.page-heritage {
  background-color: var(--poster-green) !important;
  color: var(--poster-cream);
  position: relative;
  min-height: 100dvh;
}

body.page-heritage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 0% 0%, rgba(143, 184, 158, 0.22), transparent 62%),
    radial-gradient(ellipse 50% 42% at 100% 0%, rgba(143, 184, 158, 0.18), transparent 58%),
    radial-gradient(ellipse 48% 40% at 100% 100%, rgba(143, 184, 158, 0.2), transparent 60%),
    radial-gradient(ellipse 52% 44% at 0% 100%, rgba(143, 184, 158, 0.16), transparent 58%),
    linear-gradient(165deg, var(--poster-green) 0%, #163a2c 48%, var(--poster-green-deep) 100%);
}

body.page-heritage::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("../heritage/sadu-tile.svg");
  background-size: 280px 280px;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 15%, transparent 72%);
}

/* زوايا زخرفية كالملصق */
.saad-heritage-patterns {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.saad-heritage-patterns__corner {
  position: absolute;
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  background: url("../heritage/pattern.svg") center / contain no-repeat;
  color: var(--poster-mint);
  opacity: 0.28;
  filter: saturate(0.85);
}

.saad-heritage-patterns__corner--tl {
  top: -4%;
  left: -6%;
  transform: rotate(-8deg);
}

.saad-heritage-patterns__corner--tr {
  top: -2%;
  right: -8%;
  transform: rotate(12deg);
}

.saad-heritage-patterns__corner--bl {
  bottom: -6%;
  left: -10%;
  transform: rotate(6deg);
  opacity: 0.22;
}

.saad-heritage-patterns__corner--br {
  bottom: -8%;
  right: -6%;
  transform: rotate(-14deg);
  opacity: 0.26;
}

/* شعار هندسي (مثلثان) — زوايا */
.saad-heritage-mark {
  position: fixed;
  z-index: 0;
  width: 56px;
  height: 56px;
  opacity: 0.14;
  pointer-events: none;
  color: var(--poster-cream);
}

.saad-heritage-mark--tl {
  top: 1.25rem;
  left: 1.25rem;
}

.saad-heritage-mark--br {
  bottom: 1.25rem;
  right: 1.25rem;
  transform: rotate(180deg);
}

/* محتوى فوق الخلفية */
body.page-heritage > *:not(.saad-heritage-deco):not(.saad-heritage-patterns):not(.saad-heritage-mark):not(.bg-mesh):not(.bg-grid):not(.saad-chat-aurora) {
  position: relative;
  z-index: 1;
}

body.page-heritage .bg-mesh,
body.page-heritage .bg-grid {
  opacity: 0.12 !important;
  z-index: 0;
}

body.page-heritage .saad-chat-aurora {
  display: none !important;
}

/* بطاقات زجاجية ذهبية */
body.page-heritage .auth-card,
body.page-heritage .gate-card,
body.page-heritage .dash-card,
body.page-heritage .dash-gate__card,
body.page-heritage .saad-chat-window,
body.page-heritage .pricing-card,
body.page-heritage .gate-hero--soon .gate-actions {
  border: 1px solid rgba(196, 165, 116, 0.38) !important;
  background: rgba(8, 24, 16, 0.82) !important;
  backdrop-filter: blur(16px);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
}

body.page-heritage .dash-btn--primary,
body.page-heritage .auth-btn--primary,
body.page-heritage .gate-btn--primary {
  background: linear-gradient(135deg, var(--poster-gold), #d4af37) !important;
  color: var(--poster-green-deep) !important;
  border: none !important;
  font-weight: 700;
}

body.page-heritage .dash-btn--ghost,
body.page-heritage .auth-btn--ghost,
body.page-heritage .gate-btn--ghost,
body.page-heritage .saad-home-toplinks a {
  border: 1px solid rgba(248, 246, 240, 0.2) !important;
  background: rgba(248, 246, 240, 0.06) !important;
  color: var(--poster-cream) !important;
}

body.page-heritage input,
body.page-heritage textarea,
body.page-heritage select {
  background: rgba(13, 40, 24, 0.65) !important;
  border: 1px solid rgba(196, 165, 116, 0.28) !important;
  color: var(--poster-cream) !important;
}

body.page-heritage input:focus,
body.page-heritage textarea:focus {
  border-color: var(--poster-gold) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.2);
}

/* لوحة التحكم */
body.page-heritage.saad-premium-dash {
  --dash-bg: var(--poster-green);
  --dash-text: var(--poster-cream);
  --dash-border: rgba(248, 246, 240, 0.14);
  --dash-accent: var(--poster-gold);
  --dash-surface: rgba(248, 246, 240, 0.06);
}

body.page-heritage.saad-premium-dash::before {
  display: none;
}

body.page-heritage.saad-premium-dash .dash-topbar {
  border-bottom: 1px solid rgba(196, 165, 116, 0.25);
  background: rgba(8, 24, 16, 0.75);
  backdrop-filter: blur(12px);
}

body.page-heritage.saad-premium-dash .dash-nav {
  background: rgba(8, 24, 16, 0.55);
  border-inline-end: 1px solid rgba(248, 246, 240, 0.1);
}

body.page-heritage.saad-premium-dash .dash-nav__btn.is-active {
  background: rgba(196, 165, 116, 0.18);
  border-color: var(--poster-gold);
  color: var(--poster-cream);
}

/* صفحة الدخول */
body.page-heritage.page-auth-gate::before,
body.page-heritage.page-auth-gate::after {
  display: none;
}

body.page-heritage.gate-body::before {
  display: none;
}

/* محادثة */
body.page-heritage.saad-chat-theme-heritage .saad-chat-bar {
  border: 1px solid rgba(196, 165, 116, 0.32);
  background: rgba(8, 24, 16, 0.78);
}

body.page-heritage .saad-credits-mini,
body.page-heritage .saad-chat-profile-chip {
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(8, 24, 16, 0.7);
}

@media (max-width: 720px) {
  .saad-heritage-patterns__corner {
    width: min(55vw, 200px);
    height: min(55vw, 200px);
    opacity: 0.2;
  }
  .saad-heritage-mark {
    width: 40px;
    height: 40px;
    opacity: 0.1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .saad-sticker {
    animation: none !important;
  }
}
