/* قوانین و مقررات — پالت کارنو پلاس */
.page-terms {
  --terms-ink: #062e2c;
  --terms-body: #3d5653;
  --terms-teal: #0a7a72;
  --terms-deep: #003d3d;
  --terms-line: rgba(6, 46, 44, 0.12);
  --terms-soft: #f3faf8;
  --terms-accent: #e8920a;
  background: #f7fbfa;
  color: var(--terms-body);
}

.page-terms,
.page-terms .terms-hero,
.page-terms .terms-shell,
.page-terms .terms-article,
.page-terms .terms-card,
.page-terms .terms-toc {
  min-width: 0;
  max-width: 100%;
}

.terms-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h, calc(var(--nav-h) + var(--vote-bar-h, 0px))) + env(safe-area-inset-top, 0px) + 1.6rem) 0 2.4rem;
  color: #f7fffc;
  background:
    radial-gradient(ellipse 80% 60% at 8% 20%, rgba(85, 201, 195, 0.24), transparent 58%),
    radial-gradient(ellipse 55% 50% at 92% 8%, rgba(232, 146, 10, 0.18), transparent 52%),
    linear-gradient(155deg, #001f1f 0%, #003838 46%, #0a5a53 100%);
}

.terms-hero__copy {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin-inline-start: 0;
  margin-inline-end: auto;
  text-align: right;
}

.terms-hero .about-kicker,
.terms-hero .about-hero__eyebrow {
  margin: 0 0 0.85rem;
  color: #f0b45a;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.terms-hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 900;
  line-height: 1.45;
  color: #fff;
}

.terms-hero__lead {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.9;
  color: rgba(247, 255, 252, 0.88);
  text-align: right;
}

.terms-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.terms-hero__meta li {
  max-width: 100%;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.55;
  color: #d9f6f2;
  border: 1px solid rgba(127, 224, 216, 0.35);
  border-radius: 999px;
  white-space: normal;
}

.terms-shell {
  display: grid;
  grid-template-columns: minmax(200px, 0.72fr) minmax(0, 1.55fr);
  gap: 1.75rem;
  padding: 2.25rem 0 3.75rem;
  align-items: start;
}

.terms-toc {
  position: sticky;
  top: calc(var(--header-h, calc(var(--nav-h) + var(--vote-bar-h, 0px))) + 0.85rem);
  padding: 1.15rem 1.1rem;
  background: #fff;
  border: 1px solid var(--terms-line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 45, 45, 0.05);
}

.terms-toc h2 {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--terms-teal);
}

.terms-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: terms-toc;
}

.terms-toc li {
  counter-increment: terms-toc;
}

.terms-toc a {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.38rem 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--terms-ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(6, 46, 44, 0.06);
}

.terms-toc a::before {
  content: counter(terms-toc, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--terms-teal);
  font-variant-numeric: tabular-nums;
}

.terms-toc a:hover {
  color: var(--terms-teal);
}

.terms-notice {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 1.35rem;
  padding: 1rem 1.1rem;
  background: #fff6e4;
  border: 1px solid rgba(232, 146, 10, 0.28);
  border-right: 4px solid var(--terms-accent);
  border-radius: 16px;
  color: #3b2a08;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.terms-notice strong {
  color: #1f1402;
}

.terms-article {
  display: grid;
  gap: 1.1rem;
}

.terms-card {
  padding: 1.25rem 1.3rem 1.2rem;
  background: #fff;
  border: 1px solid var(--terms-line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 45, 45, 0.04);
}

.terms-card[id] {
  scroll-margin-top: calc(var(--header-h, calc(var(--nav-h) + var(--vote-bar-h, 0px))) + 0.85rem);
}

.terms-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--terms-ink);
  line-height: 1.5;
}

.terms-card h3 {
  margin: 1rem 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--terms-deep);
}

.terms-card p,
.terms-card li {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
  line-height: 1.95;
  text-align: justify;
  text-justify: inter-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.terms-card a {
  overflow-wrap: anywhere;
}

.terms-card ul,
.terms-card ol {
  margin: 0 0 0.4rem;
  padding: 0 1.15rem 0 0;
}

.terms-card li:last-child,
.terms-card p:last-child {
  margin-bottom: 0;
}

.terms-refs {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: var(--terms-soft);
  border-radius: 12px;
  font-size: 0.82rem;
  color: var(--terms-deep);
  line-height: 1.8;
}

.terms-refs strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--terms-teal);
}

.terms-cta {
  margin-top: 0.4rem;
  padding: 1.4rem 1.35rem;
  color: #f7fffc;
  background: linear-gradient(155deg, #002a2a 0%, #004d4d 58%, #0a6363 100%);
  border-radius: 18px;
}

.terms-cta h2 {
  margin: 0 0 0.5rem;
  color: #fff;
}

.terms-cta p {
  color: rgba(247, 255, 252, 0.88);
}

.terms-cta .btn {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .terms-hero {
    padding: calc(var(--header-h, calc(var(--nav-h) + var(--vote-bar-h, 0px))) + env(safe-area-inset-top, 0px) + 1.15rem) 0 1.75rem;
  }

  .terms-hero__copy {
    max-width: none;
    margin-inline: 0;
  }

  .terms-hero h1 {
    font-size: clamp(1.28rem, 5.6vw, 1.7rem);
    line-height: 1.5;
  }

  .terms-hero__lead {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  .terms-hero__meta {
    gap: 0.38rem;
  }

  .terms-hero__meta li {
    font-size: 0.72rem;
    padding: 0.28rem 0.62rem;
  }

  .terms-shell {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 1.25rem 0 2.75rem;
  }

  .terms-toc {
    position: static;
    padding: 0.95rem 0.9rem;
  }

  .terms-toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.65rem;
  }

  .terms-toc a {
    min-height: 44px;
    align-items: center;
    font-size: 0.76rem;
    padding-block: 0.45rem;
  }

  .terms-card p,
  .terms-card li,
  .terms-notice,
  .terms-hero__lead {
    text-align: right;
    text-justify: auto;
  }

  .terms-cta h2 {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  .terms-cta h2 {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  .terms-cta .btn {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    min-height: 44px;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .terms-hero {
    padding-bottom: 1.45rem;
  }

  .terms-hero .about-hero__eyebrow {
    margin-bottom: 0.65rem;
    font-size: 0.74rem;
    letter-spacing: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .terms-hero h1 {
    font-size: 1.28rem;
    margin-bottom: 0.7rem;
  }

  .terms-hero__lead {
    font-size: 0.86rem;
    margin-bottom: 0.85rem;
  }

  .terms-hero__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .terms-card,
  .terms-notice,
  .terms-cta,
  .terms-refs {
    padding: 0.95rem 0.85rem;
    border-radius: 14px;
  }

  .terms-card h2 {
    font-size: 1.02rem;
  }

  .terms-card p,
  .terms-card li {
    font-size: 0.88rem;
    line-height: 1.85;
  }

  .terms-card ul,
  .terms-card ol {
    padding-right: 1rem;
  }

  .page-terms .footer__grid {
    gap: 1.25rem;
  }
}

@media (max-width: 400px) {
  .terms-toc ol {
    grid-template-columns: 1fr;
  }

  .terms-hero h1 {
    font-size: 1.18rem;
  }
}
