:root {
  --bg: #0b1020;
  --bg-soft: #121933;
  --card: #161f3d;
  --text: #eef2ff;
  --muted: #9aa6c7;
  --brand: #4f7cff;
  --brand-2: #7aa2ff;
  --border: #24304f;
  --radius: 16px;
  --max: 860px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2650 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

header.site {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(11, 16, 32, 0.72);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max);
  margin: 0 auto;
}

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

.brand img { width: 34px; height: 34px; border-radius: 9px; }

.nav-links { display: flex; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.hero {
  text-align: center;
  padding: 72px 20px 40px;
}

.hero img.logo {
  width: 96px; height: 96px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(79, 124, 255, 0.35);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.hero p.tagline {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.app-store-badge {
  display: inline-block;
  line-height: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.app-store-badge:hover {
  text-decoration: none;
  opacity: 0.92;
  transform: translateY(-1px);
}
.app-store-badge img {
  display: block;
  height: 54px;
  width: auto;
}

.btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(79, 124, 255, 0.4);
}
.btn:hover { text-decoration: none; opacity: 0.95; }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 48px 0;
}

.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 24px 0;
}

.legal h1 { margin-top: 8px; }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }
.legal h2 {
  font-size: 1.2rem;
  margin: 28px 0 8px;
  color: var(--brand-2);
}
.legal p { color: #d7def5; }

.contact-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  margin-top: 8px;
}

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px 20px 48px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

.section-title { text-align: center; margin: 8px 0 4px; font-size: 1.6rem; }
.section-sub { text-align: center; color: var(--muted); margin: 0 0 8px; }

/* ---------- Troubleshooting page ---------- */

.ts-toolbar { margin: 8px 0 24px; }

.ts-search {
  width: 100%;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.ts-search::placeholder { color: var(--muted); }
.ts-search:focus { border-color: var(--brand); }

.ts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.ts-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.ts-chip:hover { color: var(--text); border-color: var(--brand-2); }
.ts-chip.active {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.ts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.ts-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ts-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 12px 32px rgba(79, 124, 255, 0.18);
}
.ts-card h3 { margin: 0; font-size: 1.05rem; }
.ts-card p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }

.ts-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 124, 255, 0.14);
  color: var(--brand-2);
  margin-bottom: 4px;
}
.ts-card-icon svg { width: 24px; height: 24px; }

.ts-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-2);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 6px;
}
.ts-card-cta svg { width: 18px; height: 18px; }

.ts-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

.ts-contact { margin-top: 40px; }

/* Modal */
.ts-modal { position: fixed; inset: 0; z-index: 50; }
.ts-modal[hidden] { display: none; }
.ts-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 18, 0.78);
  backdrop-filter: blur(6px);
}
.ts-modal-card {
  position: relative;
  max-width: 640px;
  margin: 6vh auto;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.ts-modal-card h2 { margin: 0 44px 16px 0; color: var(--text); font-size: 1.25rem; }
.ts-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.ts-modal-close:hover { border-color: var(--brand-2); }

.ts-video-wrap { margin-bottom: 18px; }
.ts-video-wrap video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 9 / 16;
  max-height: 52vh;
}
.ts-video-missing {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}
.ts-video-missing p { margin: 0; }

.ts-steps { margin: 0; padding-left: 22px; color: #d7def5; }
.ts-steps li { margin: 10px 0; }

@media (max-width: 560px) {
  .ts-modal-card { margin: 0; max-height: 100vh; border-radius: 0; min-height: 100vh; }
}

/* ---------- RTL (Arabic) ---------- */

[dir="rtl"] body,
body[dir="rtl"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Roboto, Helvetica, Arial, sans-serif;
}
[dir="rtl"] .ts-card { text-align: right; }
[dir="rtl"] .ts-steps { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .ts-modal-close { right: auto; left: 16px; }
[dir="rtl"] .ts-modal-card h2 { margin: 0 0 16px 44px; }
[dir="rtl"] .ts-card-cta svg { transform: scaleX(-1); }

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px !important;
  color: var(--text) !important;
  font-weight: 600;
}
.lang-switch:hover { border-color: var(--brand-2); text-decoration: none; }
