/* =========================================================
   صفحات قانونی - استایل مشترک
   ========================================================= */

/* ===== محتوای قانونی ===== */
.legal-content {
  color: #2c4149;
  font-size: 0.95rem;
  line-height: 2.1;
}

.legal-content h2 {
  position: relative;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-right: 1.25rem;
  color: #10272e;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.6;
  scroll-margin-top: 100px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h2::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 4px;
  background: #b96835;
}

.legal-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  color: #17343c;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.7;
  scroll-margin-top: 100px;
}

.legal-content p {
  margin-bottom: 1.25rem;
}

.legal-content ul,
.legal-content ol {
  margin: 1.25rem 0;
  padding-right: 1.5rem;
}

.legal-content ul {
  list-style: none;
}

.legal-content ul li {
  position: relative;
  margin-bottom: 0.65rem;
  padding-right: 1.5rem;
}

.legal-content ul li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  background: #b96835;
  border-radius: 50%;
}

.legal-content ol {
  list-style: none;
  counter-reset: legal-counter;
}

.legal-content ol li {
  position: relative;
  margin-bottom: 0.65rem;
  padding-right: 2rem;
  counter-increment: legal-counter;
}

.legal-content ol li::before {
  content: counter(legal-counter, persian) "";
  position: absolute;
  right: 0;
  top: 0;
  color: #b96835;
  font-weight: 900;
  font-size: 0.9rem;
}

.legal-content strong {
  color: #10272e;
  font-weight: 800;
}

.legal-content a {
  color: #b96835;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgb(185 104 53 / 40%);
  transition: border-color 0.2s ease;
}

.legal-content a:hover {
  border-bottom-color: #b96835;
}

/* ===== باکس هشدار و نکته ===== */
.legal-content .info-box {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  background: rgb(185 104 53 / 6%);
  border-right: 4px solid #b96835;
  color: #17343c;
}

.legal-content .info-box strong {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #b96835;
  font-size: 0.9rem;
  font-weight: 800;
}

.legal-content .info-box p {
  margin-bottom: 0;
  font-size: 0.85rem;
  line-height: 1.9;
}

.legal-content .warning-box {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  background: rgb(220 100 50 / 6%);
  border-right: 4px solid #dc6432;
  color: #17343c;
}

.legal-content .warning-box strong {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #b3421a;
  font-size: 0.9rem;
  font-weight: 800;
}

.legal-content .warning-box p {
  margin-bottom: 0;
  font-size: 0.85rem;
  line-height: 1.9;
}

/* ===== جدول ===== */
.legal-content table {
  width: 100%;
  margin: 1.75rem 0;
  border-collapse: collapse;
  border: 1px solid rgb(23 52 60 / 12%);
  font-size: 0.85rem;
}

.legal-content table th {
  padding: 0.85rem 1rem;
  background: #f8f6f0;
  color: #10272e;
  font-weight: 800;
  text-align: right;
  border-bottom: 2px solid rgb(23 52 60 / 12%);
}

.legal-content table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgb(23 52 60 / 8%);
  color: #40575e;
}

.legal-content table tr:last-child td {
  border-bottom: none;
}

/* ===== فهرست مطالب (TOC) ===== */
#legal-toc {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.legal-toc-link {
  display: block;
  position: relative;
  padding: 0.6rem 1rem 0.6rem 0.5rem;
  color: #607177;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  border-right: 2px solid transparent;
  margin-right: -2px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.legal-toc-link:hover {
  color: #b96835;
  background: rgb(185 104 53 / 4%);
}

.legal-toc-link.active {
  color: #b96835;
  border-right-color: #b96835;
  background: rgb(185 104 53 / 6%);
  font-weight: 800;
}

/* ===== کارت‌های ناوبری قانونی ===== */
.legal-nav-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
  text-decoration: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.legal-nav-card:hover {
  border-color: rgb(185 104 53 / 30%);
  box-shadow: 0 8px 20px rgb(12 31 38 / 5%);
  transform: translateY(-2px);
}

.legal-nav-card.active {
  border-color: #b96835;
  background: rgb(185 104 53 / 5%);
}

.legal-nav-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: rgb(185 104 53 / 10%);
  color: #b96835;
  font-size: 0.95rem;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.legal-nav-card:hover .legal-nav-card-icon,
.legal-nav-card.active .legal-nav-card-icon {
  background: #b96835;
  color: #fff;
}

.legal-nav-card-content {
  flex: 1;
  min-width: 0;
}

.legal-nav-card-title {
  color: #10272e;
  font-size: 0.85rem;
  font-weight: 800;
}

.legal-nav-card-desc {
  margin-top: 0.15rem;
  color: #748288;
  font-size: 0.7rem;
  font-weight: 500;
}

.legal-nav-card-arrow {
  color: rgb(23 52 60 / 30%);
  font-size: 0.75rem;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.legal-nav-card:hover .legal-nav-card-arrow {
  color: #b96835;
  transform: translateX(-3px);
}

/* ===== کارت متادیتای صفحه ===== */
.legal-meta-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
  margin-bottom: 1.5rem;
}

.legal-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgb(23 52 60 / 8%);
  font-size: 0.75rem;
}

.legal-meta-item:last-child {
  border-bottom: none;
}

.legal-meta-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #748288;
  font-weight: 600;
}

.legal-meta-value {
  color: #17343c;
  font-weight: 800;
}

/* ===== دکمه چاپ ===== */
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: 1px solid rgb(23 52 60 / 20%);
  color: #17343c;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.print-btn:hover {
  background: #17343c;
  border-color: #17343c;
  color: #fff;
}

/* ===== دکمه بازگشت به بالا ===== */
#scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 640px) {
  .legal-content {
    font-size: 0.9rem;
    line-height: 2;
  }

  .legal-content h2 {
    font-size: 1.35rem;
  }

  .legal-content h3 {
    font-size: 1.05rem;
  }

  .legal-content table {
    font-size: 0.75rem;
  }

  .legal-content table th,
  .legal-content table td {
    padding: 0.65rem 0.75rem;
  }
}

/* ===== استایل چاپ ===== */
@media print {
  header,
  footer,
  #mobile-menu,
  #scroll-top-btn,
  .no-print,
  aside {
    display: none !important;
  }

  main {
    padding: 0 !important;
  }

  .legal-content {
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.7;
  }

  .legal-content h2,
  .legal-content h3 {
    color: #000 !important;
    page-break-after: avoid;
  }

  .legal-content a {
    color: #000 !important;
    text-decoration: underline;
    border-bottom: none !important;
  }

  .legal-content .info-box,
  .legal-content .warning-box {
    border: 1px solid #999 !important;
    background: none !important;
    page-break-inside: avoid;
  }
}

/* ===== کاهش حرکت ===== */
@media (prefers-reduced-motion: reduce) {
  .legal-nav-card,
  .legal-nav-card-icon {
    transition: none;
    transform: none;
  }
}