/**
 * صفحات قوانین و حریم خصوصی — هدر و فوتر هماهنگ با قالب اصلی سایت
 */

* {
  box-sizing: border-box;
}

body.legal-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f6f9fc;
  text-align: right !important;
  direction: rtl !important;
  font-size: 18px;
  line-height: 1.75;
}

/* ========== هدر — ترکیب رنگ پررنگ و غنی ========== */
.legal-page .legal-header-bar,
.legal-page header.header_area.legal-header-bar {
  position: relative;
  width: 100%;
  background: linear-gradient(120deg, #0d0c1a 0%, #1a1840 25%, #162058 50%, #1a1840 75%, #0d0c1a 100%) !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 18px 0;
  border-bottom: 4px solid #4f95ff !important;
  overflow: hidden;
}

.legal-page .legal-header-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(79, 149, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.legal-page .legal-header-bar .logo a,
.legal-page .legal-header-bar .legal-logo-text {
  color: #fff !important;
  font-weight: 700;
  font-size: 28px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: color 0.3s, text-shadow 0.3s;
}

.legal-page .legal-header-bar .logo a:hover .legal-logo-text {
  color: #7ec8ff !important;
  text-shadow: 0 0 20px rgba(126, 200, 255, 0.4);
}

.legal-page .legal-header-bar .main_menu ul {
  margin: 0;
  padding: 0;
}

.legal-page .legal-header-bar .main_menu ul li {
  list-style: none;
  display: inline-block;
  margin-left: 5px;
  margin-right: 5px;
}

.legal-page .legal-header-bar .main_menu ul li a {
  padding: 10px 18px;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 17px;
  font-weight: 500;
  transition: all 0.3s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.legal-page .legal-header-bar .main_menu ul li a:hover {
  color: #7ec8ff !important;
}

.legal-page .legal-header-bar .main_menu ul li a.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(79, 149, 255, 0.4) 0%, rgba(0, 212, 170, 0.25) 100%);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(79, 149, 255, 0.3);
}

.legal-page .legal-header-bar .action_btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #00d4aa 0%, #4f95ff 50%, #0f6eff 100%) !important;
  background-size: 200% 100%;
  border: none;
  box-shadow: 0 4px 18px rgba(79, 149, 255, 0.5), 0 2px 8px rgba(0, 212, 170, 0.3);
  transition: all 0.3s;
}

.legal-page .legal-header-bar .action_btn:hover {
  box-shadow: 0 6px 24px rgba(79, 149, 255, 0.6), 0 3px 12px rgba(0, 212, 170, 0.4) !important;
  filter: brightness(1.08);
}

/* منوی موبایل */
.legal-mobile-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.legal-mobile-nav a {
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  text-decoration: none;
  padding: 6px 10px;
}

.legal-mobile-nav a:hover,
.legal-mobile-nav a.active {
  color: #7ec8ff;
}

.legal-mobile-nav .action_btn {
  padding: 8px 14px;
  font-size: 14px;
}

/* ========== نوار عنوان صفحه (مانند welcome_area کوچک) ========== */
.legal-hero {
  background: linear-gradient(135deg, #1c1b2e 0%, #2d2b45 100%);
  padding: 50px 0 55px;
  text-align: center;
}

.legal-hero-title {
  color: #fff !important;
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
}

.legal-hero-lead {
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  margin: 0;
  line-height: 1.6;
}

/* ========== محتوای اصلی — راست‌چین و قالب جمع با فاصله مناسب ========== */
.legal-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.75rem 20px 2.5rem;
  text-align: right !important;
  direction: rtl !important;
}

.legal-content {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  box-shadow: 0 4px 24px rgba(97, 105, 140, 0.08);
  font-size: 16px;
  line-height: 1.8;
  text-align: right !important;
  direction: rtl !important;
  max-width: 100%;
}

.legal-content > p:has(> strong:only-child) {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1c1b2e;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(97, 105, 140, 0.15);
}

.legal-content > p:has(> strong:only-child):first-of-type {
  margin-top: 0;
}

.legal-content p {
  margin: 0 0 1rem;
  color: #6d859e;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content ol,
.legal-content ul {
  margin: 0 0 1rem 0;
  padding-right: 2rem;
  padding-left: 0.5rem;
  color: #6d859e;
  text-align: right !important;
  direction: rtl !important;
}

.legal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
  text-align: right !important;
}

.legal-content ol ol {
  list-style-type: lower-alpha;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-right: 1.5rem;
}

.legal-content strong {
  font-weight: 700;
  color: #1c1b2e;
}

.legal-content a {
  color: #0f6eff;
  text-decoration: none;
  transition: color 0.3s;
}

.legal-content a:hover {
  color: #2095f3;
}

.legal-content > ol:not([type]) {
  list-style-position: outside;
}

.legal-content p,
.legal-content h1,
.legal-content h2,
.legal-content h3 {
  text-align: right !important;
  direction: rtl !important;
}

/* ========== فوتر — دقیقاً مثل هدر (همان ظاهر) ========== */
.legal-page .legal-footer-bar,
.legal-page footer.legal-footer-bar {
  position: relative;
  width: 100%;
  background: linear-gradient(120deg, #0d0c1a 0%, #1a1840 25%, #162058 50%, #1a1840 75%, #0d0c1a 100%) !important;
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  padding: 18px 0;
  border-top: 4px solid #4f95ff !important;
  margin-top: auto;
  overflow: hidden;
}

.legal-page .legal-footer-bar .logo .legal-logo-text,
.legal-page .legal-footer-bar .main_menu ul li a {
  color: #fff !important;
  font-weight: 500;
  font-size: 17px;
}

.legal-page .legal-footer-bar .main_menu ul li a:hover,
.legal-page .legal-footer-bar .main_menu ul li a.active {
  color: #7ec8ff !important;
}

.legal-page .legal-footer-bar .action_btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #00d4aa 0%, #4f95ff 50%, #0f6eff 100%) !important;
  border: none;
  box-shadow: 0 4px 18px rgba(79, 149, 255, 0.5);
}

.legal-page .legal-footer-bar .main_menu ul {
  margin: 0;
  padding: 0;
}

.legal-page .legal-footer-bar .main_menu ul li {
  list-style: none;
  display: inline-block;
  margin-left: 5px;
  margin-right: 5px;
}

.legal-page .legal-footer-bar .main_menu ul li a {
  padding: 10px 18px;
}

/* موبایل */
@media (max-width: 991px) {
  .legal-hero-title {
    font-size: 28px;
  }
  .legal-hero-lead {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .legal-hero {
    padding: 35px 15px 40px;
  }
  .legal-hero-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  body.legal-page {
    font-size: 16px;
  }
  .legal-main {
    padding: 1.5rem 12px 2rem;
  }
  .legal-content {
    padding: 1.5rem 1.25rem;
    font-size: 16px;
  }
  .legal-content > p:has(> strong:only-child) {
    font-size: 1.05rem;
  }
}
