/* SubTrack website. Colours sampled from the SubTrack logo (navy → violet).
   Layout uses logical properties so Arabic (RTL) mirrors correctly. */

:root {
  --navy: #0a1f46;
  --indigo: #322d70;
  --violet: #7a34b8;
  --violet-strong: #6a2aa6;

  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #efedf7;
  --text: #17142b;
  --muted: #5b5873;
  --border: #e1deee;
  --accent: #6a2aa6;
  --accent-contrast: #ffffff;
  --focus: #7a34b8;
  --hero-grad: linear-gradient(135deg, #0a1f46 0%, #322d70 55%, #7a34b8 100%);
  --shadow: 0 1px 2px rgb(23 20 43 / 6%), 0 8px 24px rgb(23 20 43 / 6%);

  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Geeza Pro", Tahoma, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f24;
    --surface: #141938;
    --surface-2: #1b2147;
    --text: #eeecf8;
    --muted: #aaa6c6;
    --border: #2a3060;
    --accent: #b68cf0;
    --accent-contrast: #140a26;
    --focus: #c9a6ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f24;
  --surface: #141938;
  --surface-2: #1b2147;
  --text: #eeecf8;
  --muted: #aaa6c6;
  --border: #2a3060;
  --accent: #b68cf0;
  --accent-contrast: #140a26;
  --focus: #c9a6ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}
html[lang="ar"] body { line-height: 1.85; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 780px; }
.block { padding-block: clamp(48px, 7vw, 88px); }
.section-title { text-align: center; margin-bottom: 1.4em; }

.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-contrast); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand img { border-radius: 9px; }
.main-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.main-nav a, .mobile-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .97rem;
  padding: 8px 12px; border-radius: 10px;
}
.main-nav a:hover, .mobile-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"], .mobile-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-switch {
  font-weight: 700; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: .92rem;
}
.lang-switch:hover { background: var(--surface-2); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.mobile-nav { display: none; }

@media (max-width: 820px) {
  .main-nav { display: none; }
  .header-tools { margin-inline-start: auto; }
  .mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
  .mobile-nav a { white-space: nowrap; }
}

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.text-link { font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.soon {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 16px; border-radius: 14px; font-weight: 600;
  background: var(--surface); border: 1px dashed var(--border); color: var(--muted);
}
.soon .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--violet); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 22%, transparent); }

/* Icons */
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Hero — charcoal background, gradient headline, phone illustration with
   floating cards. Dark in both themes. */
.hero { position: relative; overflow: hidden; background: #1d1e23; color: #fff; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 55vw; height: 55vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(closest-side, rgb(122 52 184 / 28%), transparent); pointer-events: none;
}
html[dir="rtl"] .hero::before { inset: -30% auto auto -10%; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-block: clamp(56px, 9vw, 120px); position: relative; z-index: 1; }
.hero .eyebrow { display: inline-block; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .82rem; color: #a9b8ff; margin-bottom: 16px; }
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.08; margin-bottom: 24px;
  background: linear-gradient(100deg, #4f86f7 0%, #7d8cff 45%, #a58bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[lang="ar"] .hero h1 { line-height: 1.3; }
.hero .lead { font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: #e4e4ea; max-width: 30em; margin-bottom: 36px; }
.store-row { display: flex; flex-wrap: wrap; gap: 14px; }
.store-pill {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 26px 8px 20px;
  border: 1.5px solid rgb(255 255 255 / 70%); border-radius: 20px; color: #fff; cursor: default;
}
.store-pill .ic { width: 22px; height: 22px; }
.store-pill strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.store-pill small { display: block; font-size: .78rem; color: #b9b9c6; line-height: 1.3; }
.store-note { color: #a9a9b8; font-size: .9rem; margin: 14px 0 0; max-width: 34em; }
.hero .btn-primary { background: #fff; color: #1d1e23; }
.hero .btn-secondary { color: #fff; border-color: rgb(255 255 255 / 60%); }
.hero-points { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: #cfd0da; font-weight: 600; font-size: .93rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .ic { width: 19px; height: 19px; color: #9ea9ff; }

/* Illustration (sample data, not a screenshot) */
.showcase { position: relative; margin: 0; justify-self: center; width: min(100%, 540px); padding-block: 10px 34px; color: #1b1c22; }
.phone { width: 270px; margin-inline: auto; padding: 12px; border-radius: 46px; background: #3b414b; box-shadow: 0 40px 80px rgb(0 0 0 / 45%), inset 0 0 0 2px #535a66; }
.screen { background: #f7f7fa; border-radius: 36px; padding: 14px 16px 12px; min-height: 520px; display: flex; flex-direction: column; }
.ph-status { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; font-weight: 700; color: #1b1c22; padding: 2px 6px 10px; }
.ph-dots { display: inline-flex; gap: 3px; }
.ph-dots i { width: 5px; height: 5px; border-radius: 50%; background: #1b1c22; }
.ph-title { font-weight: 800; font-size: 1.05rem; margin: 4px 2px 12px; }
.ph-total { background: #e9e4fb; border-radius: 18px; padding: 14px; display: grid; gap: 2px; }
.ph-total span, .ph-total small { font-size: .72rem; color: #4a4560; }
.ph-total strong { font-size: 1.55rem; line-height: 1.2; color: #2a2060; }
.ph-section { font-size: .75rem; font-weight: 700; margin: 16px 2px 8px; color: #3a3850; }
.ph-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-head { display: flex; justify-content: space-between; font-size: .7rem; color: #3a3850; margin-bottom: 4px; }
.bar { display: block; height: 7px; border-radius: 4px; background: #e3e1ee; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; }
.bar .c1 { background: #e5484d; } .bar .c2 { background: #8e4ec6; } .bar .c3 { background: #3e63dd; }
.s62 { width: 62%; } .s25 { width: 25%; } .s14 { width: 14%; }
.ph-nav { margin-top: auto; display: flex; justify-content: space-around; padding-top: 14px; border-top: 1px solid #e6e5ee; color: #8a889c; }
.ph-nav .ic { width: 20px; height: 20px; }
.ph-nav .ic:first-child { color: #6a2aa6; }

.float { position: absolute; background: #fff; color: #1b1c22; border-radius: 18px; box-shadow: 0 18px 44px rgb(0 0 0 / 35%); padding: 14px 16px; }
.float-upcoming { top: 200px; inset-inline-start: 0; width: 236px; }
.float-notif { bottom: 92px; inset-inline-end: 0; width: 246px; display: grid; gap: 4px; font-size: .8rem; color: #45435a; }
.float-notif strong { color: #1b1c22; font-size: .86rem; }
.notif-app { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; color: #6b6880; }
.notif-app img { border-radius: 5px; }
.float-title { font-size: .72rem; font-weight: 700; color: #6b6880; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
html[lang="ar"] .float-title { text-transform: none; letter-spacing: 0; }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.svc-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.svc { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; }
.svc .ic { width: 18px; height: 18px; }
.svc.c1 { background: #e5484d; } .svc.c2 { background: #8e4ec6; } .svc.c3 { background: #3e63dd; }
.svc-name { font-weight: 700; font-size: .84rem; line-height: 1.25; }
.svc-name small { display: block; font-weight: 500; font-size: .72rem; color: #6b6880; }
.amt { font-weight: 700; font-size: .82rem; }
.showcase figcaption { position: absolute; bottom: 0; inset-inline: 0; text-align: center; font-size: .78rem; color: #9b9bab; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 520px) {
  .showcase { width: 100%; }
  .phone { width: 236px; }
  .screen { min-height: 470px; }
  .float-upcoming { top: 186px; width: 196px; padding: 12px; }
  .float-notif { bottom: 60px; width: 210px; padding: 12px; }
  .svc { width: 30px; height: 30px; }
}

/* Sections */
.problem { max-width: 820px; margin-inline: auto; text-align: center; }
.problem p { color: var(--muted); font-size: 1.12rem; }
.band { background: var(--surface-2); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card .ic { width: 40px; height: 40px; padding: 8px; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); margin-bottom: 14px; }
.card p { color: var(--muted); margin: 0; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: relative; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--hero-grad); color: #fff; font-weight: 800; margin-bottom: 14px;
}
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 900px; margin-inline: auto; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.plan-premium { border: 2px solid var(--accent); position: relative; }
.plan h2, .plan h3 { margin-bottom: .4em; }
.price { font-size: 2rem; font-weight: 800; margin: 0 0 16px; }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.price-grid p { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .ic { width: 20px; height: 20px; color: var(--accent); margin-top: 3px; stroke-width: 2.4; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent); flex: none; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 20px 18px; color: var(--muted); }

/* Inner pages */
.page-head { padding-block: clamp(40px, 6vw, 72px) 0; max-width: 820px; }
.page-head .lead { color: var(--muted); font-size: 1.15rem; }
.feature-list { display: grid; gap: 16px; padding-top: 32px; }
.feature { display: grid; grid-template-columns: auto 1fr; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature > .ic { width: 44px; height: 44px; padding: 9px; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.feature h2 { font-size: 1.3rem; }
.feature p, .feature li { color: var(--muted); }
.feature ul { margin: 0 0 1em; padding-inline-start: 1.2em; }
.feature .note { font-size: .92rem; }
.feature > div > :last-child { margin-bottom: 0; }
@media (max-width: 560px) { .feature { grid-template-columns: 1fr; } }

.callout { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 900px; margin-inline: auto; }
.callout p { margin: 0; color: var(--muted); }

.prose h2 { font-size: 1.35rem; margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .45em; }
.legal h1 { margin-bottom: .2em; }
.legal > p, .legal li { color: var(--text); }

.cta { text-align: center; }
.cta .cta-row, .cta .soon, .cta .store-row { justify-content: center; }
.cta .store-pill { border-color: var(--border); color: var(--text); background: var(--surface); }
.cta .store-pill small { color: var(--muted); }
.cta .store-note { margin-inline: auto; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; }
.footer-grid .brand { margin-bottom: 10px; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 36px; align-content: start; justify-content: end; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid var(--border); margin-top: 28px; padding-block: 18px; }
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: start; }
}

/* 404 */
.notfound { display: grid; justify-items: center; text-align: center; gap: 8px; padding-block: 80px; max-width: 640px; }
.notfound .code { font-size: clamp(4rem, 14vw, 7rem); font-weight: 900; line-height: 1; margin: 8px 0; background: var(--hero-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound section { margin-top: 16px; }
.notfound img { border-radius: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .skip { display: none; }
  body { background: #fff; color: #000; }
}
