/* =============================================================================
   Siraj Legal Pages (Privacy Policy & Terms of Service) - Unified Design System
   Matches the luxury aesthetic of the main landing page with sticky TOC,
   reading progress bar, AMOLED true black mode, and bilingual RTL/LTR typography.
   ============================================================================= */

@import "tokens.css";


/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.68;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* RTL Typography & Alignment */
html[dir="rtl"] {
  font-family: var(--font-arabic), var(--font-body);
  text-align: right;
}

html[dir="rtl"] body {
  direction: rtl;
}

/* Reading Progress Bar */
.legal-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Container */
.wrap {
  width: min(100% - 40px, 1200px);
  margin-inline: auto;
}

/* Luxury Header & Navbar */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(248, 247, 244, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

html[data-theme="dark"] .legal-header {
  background: rgba(16, 20, 19, 0.88);
}
html[data-theme="black"] .legal-header {
  background: rgba(0, 0, 0, 0.92);
}

.legal-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s var(--easing);
}

.nav-home-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Language & Theme Controls */
.lang-dropdown-wrap {
  position: relative;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  z-index: 950;
}

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

.lang-menu.active {
  display: flex;
}

.lang-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

html[dir="rtl"] .lang-menu-item {
  text-align: right;
}

.lang-menu-item:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

.lang-menu-item.active {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
}

/* Legal Hero Section */
.legal-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 12px;
}

.legal-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 800px;
  margin-bottom: 24px;
}

.guarantee-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--secondary-tint);
  color: var(--secondary-ink);
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--secondary-ink) 25%, transparent);
}
html[data-theme="dark"] .guarantee-badge-pill,
html[data-theme="black"] .guarantee-badge-pill,
html[data-amoled="true"] .guarantee-badge-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.28);
}

/* Legal Layout Grid */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 64px;
}

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Sticky Table of Contents (TOC) */
.toc-sidebar {
  position: sticky;
  top: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

@media (max-width: 900px) {
  .toc-sidebar {
    position: static;
    max-height: none;
  }
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

html[dir="rtl"] .toc-link {
  border-left: none;
  border-right: 2px solid transparent;
}

.toc-link:hover {
  color: var(--ink);
  background: var(--bg-alt);
}

.toc-link.active {
  color: var(--primary);
  background: var(--primary-tint);
  font-weight: 700;
  border-left-color: var(--primary);
}

html[dir="rtl"] .toc-link.active {
  border-right-color: var(--primary);
}

/* Legal Content Area */
.legal-content {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.legal-section {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 100px;
}

.legal-section h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-section h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--primary);
  border-radius: 2px;
}

.legal-section p {
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.75;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 12px 0 16px 24px;
  color: var(--ink-soft);
  line-height: 1.75;
}

html[dir="rtl"] .legal-section ul {
  margin: 12px 24px 16px 0;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-section strong {
  color: var(--ink);
  font-weight: 700;
}

.legal-callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  border: 1px solid rgba(147, 105, 37, 0.25);
  margin: 20px 0;
}

.legal-callout p {
  color: var(--ink);
  font-size: 0.95rem;
  margin: 0;
}

/* Unified Footer */
.legal-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 36px 0;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-copy {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}
