/* ==========================================================================
   Mali 123 - Terms & Conditions Stylesheet
   Corporate Cloud Accounting Design System (Navy #0B2630, Turquoise #00766F / #2DD4BF)
   ========================================================================== */

body.page-template-page-terms-conditions,
body.page-template-page-terms-conditions-php {
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  background-color: #F5F8F8 !important;
  color: #263F49;
}

.mali-terms-shell {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #F5F8F8;
  direction: rtl;
  isolation: isolate;
}

.mali-terms-shell,
.mali-terms-shell *,
.mali-terms-shell *::before,
.mali-terms-shell *::after {
  box-sizing: border-box;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.mali-terms-container {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
  padding: 28px 0 64px;
}

/* ── Hero Banner ── */
.mali-terms-hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid #D5E1E2;
  border-radius: 24px;
  background: #0B2630;
  box-shadow: 0 16px 40px rgba(11, 38, 48, 0.12);
}

.mali-terms-hero img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: left center;
}

.mali-terms-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(11, 38, 48, 0.94) 0%, rgba(11, 38, 48, 0.85) 45%, rgba(11, 38, 48, 0.3) 80%, rgba(11, 38, 48, 0.05) 100%);
  pointer-events: none;
}

.mali-terms-hero-copy {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 5%;
  width: min(580px, 60%);
  transform: translateY(-50%);
  color: #FFFFFF;
}

.mali-terms-kicker,
.mali-terms-hero-copy span.mali-kicker-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.16);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #2DD4BF;
  font-size: 0.84rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.mali-terms-hero-copy h1 {
  margin: 14px 0 12px;
  color: #FFFFFF;
  font-size: clamp(1.8rem, 3.8vw, 2.7rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.mali-terms-hero-copy h1 .brand-num {
  direction: ltr !important;
  display: inline-block;
  color: #2DD4BF;
}

.mali-terms-hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.98rem;
  line-height: 1.95;
  text-align: justify;
}

/* ── Main Layout (Sidebar + Content) ── */
.mali-terms-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 32px;
}

/* ── Sticky Table of Contents ── */
.mali-terms-toc {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 12px;
  border: 1px solid #D5E1E2;
  border-right: 4px solid #00766F;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 8px 24px rgba(11, 38, 48, 0.05);
}

.mali-terms-toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 12px;
  border-bottom: 1px solid #D5E1E2;
  color: #0B2630;
  font-size: 0.96rem;
  font-weight: 800;
}

.mali-terms-toc-title svg {
  width: 18px;
  height: 18px;
  fill: #00766F;
}

.mali-terms-toc a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #51666E;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mali-terms-toc a span.toc-num {
  font-size: 0.76rem;
  font-weight: 700;
  color: #00766F;
  opacity: 0.85;
}

.mali-terms-toc a:hover,
.mali-terms-toc a.is-active {
  color: #00766F;
  font-weight: 800;
  background: #E5F7F5;
  box-shadow: inset -3px 0 0 #00766F;
  transform: translateX(-3px);
}

.mali-terms-toc a.is-active span.toc-num {
  color: #005F5A;
  font-weight: 900;
}

/* ── Content Card ── */
.mali-terms-content {
  min-width: 0;
  padding: 34px clamp(20px, 3.5vw, 44px);
  border: 1px solid #D5E1E2;
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow: 0 10px 30px rgba(11, 38, 48, 0.05);
}

/* ── Intro Callout ── */
.mali-terms-intro {
  margin-bottom: 28px;
  padding: 22px 24px;
  border: 1px solid #D5E1E2;
  border-right: 5px solid #00766F;
  border-radius: 16px;
  background: linear-gradient(135deg, #F5F8F8 0%, #E5F7F5 100%);
  box-shadow: 0 6px 18px rgba(0, 118, 111, 0.05);
}

.mali-terms-intro-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.mali-terms-intro-meta .mali-update-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #D5E1E2;
  color: #00766F;
  font-size: 0.82rem;
  font-weight: 700;
}

.mali-terms-intro-meta .mali-version-tag {
  font-size: 0.82rem;
  color: #51666E;
  font-weight: 600;
}

.mali-terms-intro p {
  margin: 0;
  color: #263F49;
  font-size: 0.98rem;
  line-height: 2.1;
  text-align: justify;
}

/* ── Content Sections ── */
.mali-terms-content section {
  scroll-margin-top: 32px;
  margin: 22px 0;
  padding: 26px 26px;
  border: 1px solid #E2EAEA;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(11, 38, 48, 0.03);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.mali-terms-content section:hover,
.mali-terms-content section.is-active {
  border-color: #A3D8D2;
  box-shadow: 0 8px 24px rgba(0, 118, 111, 0.08);
}

.mali-terms-content section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 8px 14px 8px 18px;
  color: #0B2630;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.5;
  border: 1px solid #D5E1E2;
  border-right: 4px solid #00766F;
  border-radius: 12px;
  background: linear-gradient(135deg, #F5F8F8 0%, #E5F7F5 100%);
  box-shadow: 0 4px 12px rgba(0, 118, 111, 0.06);
  transition: all 0.25s ease;
}

.mali-terms-content section.is-active h2 {
  color: #005F5A;
  background: #E5F7F5;
  border-color: #2DD4BF;
  box-shadow: 0 6px 18px rgba(0, 118, 111, 0.14);
  transform: translateX(-3px);
}

.mali-terms-content section h2 span.sec-badge {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #0B2630 0%, #00766F 100%);
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 118, 111, 0.25);
}

.mali-terms-content section.is-active h2 span.sec-badge {
  background: linear-gradient(135deg, #00766F 0%, #2DD4BF 100%);
  color: #0B2630;
}

.mali-terms-content p,
.mali-terms-content li {
  color: #263F49;
  font-size: 0.96rem;
  line-height: 2.15;
  text-align: justify;
}

.mali-terms-content p {
  margin: 0 0 14px;
}

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

.mali-terms-content ul {
  margin: 10px 0 14px;
  padding: 0 20px 0 0;
  list-style: none;
}

.mali-terms-content li {
  position: relative;
  margin: 8px 0;
  padding-right: 22px;
}

.mali-terms-content li::before {
  content: "";
  position: absolute;
  right: 4px;
  top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00766F;
}

/* ── Feature Highlight Boxes ── */
.mali-terms-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: #F5F8F8;
  border: 1px solid #D5E1E2;
}

.mali-terms-callout.highlight-security {
  background: linear-gradient(135deg, #F0FDF4 0%, #E5F7F5 100%);
  border-color: #A3D8D2;
  border-right: 4px solid #00766F;
}

.mali-terms-callout.highlight-warning {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF9C3 100%);
  border-color: #FDE68A;
  border-right: 4px solid #D97706;
}

.mali-terms-callout-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 3px;
  fill: #00766F;
}

.mali-terms-callout.highlight-warning .mali-terms-callout-icon {
  fill: #D97706;
}

.mali-terms-callout-body strong {
  display: block;
  color: #0B2630;
  font-size: 0.94rem;
  margin-bottom: 4px;
}

.mali-terms-callout-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.85;
}

/* ── Footer Contact Note ── */
.mali-terms-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding: 22px 24px;
  border: 1px solid #D5E1E2;
  border-right: 5px solid #00766F;
  border-radius: 16px;
  color: #263F49;
  background: linear-gradient(135deg, #FFFFFF 0%, #E5F7F5 100%);
  box-shadow: 0 8px 24px rgba(0, 118, 111, 0.06);
  font-size: 0.94rem;
}

.mali-terms-note strong {
  color: #0B2630;
  white-space: nowrap;
  font-size: 1rem;
}

.mali-terms-note span {
  flex: 1;
  line-height: 1.95;
  text-align: justify;
}

.mali-terms-note a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #00766F 0%, #005F5A 100%);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 118, 111, 0.25);
  transition: all 0.2s ease;
}

.mali-terms-note a:hover {
  background: linear-gradient(135deg, #005F5A 0%, #004A46 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 118, 111, 0.35);
}

/* ── Responsive Mobile Rules ── */
@media (max-width: 900px) {
  .mali-terms-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .mali-terms-toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mali-terms-toc-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .mali-terms-container {
    width: min(100% - 24px, 680px);
    padding: 16px 0 48px;
  }

  .mali-terms-hero {
    min-height: 380px;
    border-radius: 18px;
  }

  .mali-terms-hero img {
    height: 380px;
    object-position: center;
  }

  .mali-terms-hero::after {
    background: linear-gradient(0deg, rgba(11, 38, 48, 0.97) 0%, rgba(11, 38, 48, 0.75) 60%, rgba(11, 38, 48, 0.25) 100%);
  }

  .mali-terms-hero-copy {
    top: auto;
    right: 18px;
    bottom: 22px;
    width: calc(100% - 36px);
    transform: none;
  }

  .mali-terms-hero-copy h1 {
    font-size: 1.65rem;
  }

  .mali-terms-toc {
    grid-template-columns: 1fr;
  }

  .mali-terms-content {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .mali-terms-content section {
    margin: 14px 0;
    padding: 18px 14px;
    border-radius: 14px;
  }

  .mali-terms-content section h2 {
    font-size: 1.12rem;
    padding: 7px 10px 7px 14px;
  }

  .mali-terms-content p,
  .mali-terms-content li {
    font-size: 0.91rem;
    line-height: 2;
  }

  .mali-terms-note {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 16px;
  }

  .mali-terms-note a {
    text-align: center;
    justify-content: center;
  }
}
