:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --border: #e2e8f0;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-light: #1e293b;
    --border: #334155;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.8;
  font-size: 16px;
  direction: rtl;
}

.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.legal-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.legal-brand svg {
  stroke: var(--accent);
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--accent-light);
  transition: all 0.2s ease;
}

.back-link:hover {
  filter: brightness(0.95);
}

.legal-content {
  padding: 40px 20px;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.legal-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}

section {
  margin-bottom: 30px;
}

h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--accent);
}

p {
  color: var(--text-main);
  margin-bottom: 14px;
}

ul {
  margin: 12px 24px 20px;
}

li {
  margin-bottom: 8px;
  color: var(--text-main);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.highlight-box {
  background: var(--accent-light);
  border-right: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.contact-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.contact-info h3 {
  margin: 0 0 6px 0;
  color: var(--text-main);
}

.contact-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.contact-value {
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-all;
}

.legal-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .legal-card {
    padding: 24px 18px;
  }
  h1 {
    font-size: 1.6rem;
  }
  .contact-methods {
    grid-template-columns: 1fr;
  }
}
