/* ON Track — Public Support Pages
   Tokens are copied from design_system/tokens.json (brand red theme).
   Vanilla CSS only — no preprocessor or framework. */

:root {
  color-scheme: light;
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Brand */
  --brand-red: #C1121F;
  --brand-red-dark: #AA1A25;
  --brand-red-soft: #FBEAEC;
  --brand-gold: #C9A227;
  --brand-black: #0B0B0C;

  /* Semantic */
  --bg: #F6F7FA;
  --surface: #FFFFFF;
  --surface-alt: #F0F2F6;
  --text: #111217;
  --text-muted: #535662;
  --text-on-brand: #FFFFFF;
  --border: #D7D9E0;
  --success: #1C8A4A;
  --success-soft: #E6F4EC;
  --warning: #B87807;
  --danger: #C1121F;
  --focus-ring: #AA1A25;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-xxl: 32px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Type */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-red); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

[hidden] { display: none !important; }

/* Layout */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.brand-logo .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand-red);
  display: inline-block;
}

/* Breadcrumb */
.breadcrumb {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover { color: var(--brand-red); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }

/* Language switcher — locked to LTR so [Arabic | English] order is stable. */
.lang-bar {
  display: flex;
  gap: var(--sp-sm);
}
.lang-btn {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.lang-btn:hover { border-color: var(--brand-red); color: var(--brand-red); }
.lang-btn[aria-pressed="true"] {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: var(--text-on-brand);
}

/* Status banner */
.status-banner {
  background: var(--success-soft);
  border: 1px solid #BFE2CB;
  color: #0F5A30;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.status-banner .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
}

/* Hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  margin-bottom: var(--sp-xl);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}
.hero p {
  margin: 0 0 var(--sp-md);
  color: var(--text-muted);
  font-size: var(--fs-md);
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}
.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.quick-links a:hover { background: #F4D0D5; }

/* Sections */
.section {
  margin-bottom: var(--sp-xxl);
}
.section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: 0 0 var(--sp-lg);
  color: var(--text);
}
.section-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin: -10px 0 var(--sp-lg);
}

/* Audience picker (index page) */
.picker-grid {
  display: grid;
  gap: var(--sp-lg);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .picker-grid { grid-template-columns: 1fr 1fr; }
}
.picker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.picker-card:hover {
  border-color: var(--brand-red);
  box-shadow: 0 8px 24px rgba(193, 18, 31, 0.10);
  transform: translateY(-2px);
}
.picker-card .icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.picker-card h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
}
.picker-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.picker-card .cta {
  margin-top: auto;
  font-weight: 700;
  color: var(--brand-red);
  font-size: var(--fs-sm);
}

/* Contact cards grid */
.contact-grid {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 880px) {
  .contact-grid { grid-template-columns: repeat(3, 1fr); }
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.contact-card.is-link:hover {
  border-color: var(--brand-red);
  transform: translateY(-1px);
}
.contact-card .ic {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: var(--sp-xs);
}
.contact-card .label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contact-card .value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  /* Force LTR for emails / phone numbers / URLs */
  direction: ltr;
  text-align: start;
  unicode-bidi: isolate;
}
.contact-card.is-link .value { color: var(--brand-red); }

/* Form */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: grid;
  gap: var(--sp-md);
  max-width: 720px;
}
.form-row {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .form-row.split { grid-template-columns: 1fr 1fr; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}
.field .req { color: var(--brand-red); margin-inline-start: 4px; }
.field input,
.field textarea {
  appearance: none;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12);
}
.field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}
.field .hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.field.has-error input,
.field.has-error textarea {
  border-color: var(--danger);
}
.field .err-msg {
  color: var(--danger);
  font-size: var(--fs-xs);
  font-weight: 600;
}
/* Honeypot — hidden visually + from screen readers, but kept in tab order
   removed so a real user never lands on it. Uses the standard sr-only clip
   pattern (NOT off-screen `left: -10000px`) because in RTL documents
   negative-left positioning creates a giant horizontal scroll area. */
.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-md);
  margin-top: var(--sp-sm);
}
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, opacity 0.12s ease, transform 0.05s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: var(--brand-red);
  color: var(--text-on-brand);
}
.btn-primary:hover:not([disabled]) { background: var(--brand-red-dark); }
.btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface);
  border-color: var(--brand-red);
  color: var(--brand-red);
}
.btn-secondary:hover { background: var(--brand-red-soft); }
.btn .spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-msg {
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.form-msg.success {
  background: var(--success-soft);
  border: 1px solid #BFE2CB;
  color: #0F5A30;
}
.form-msg.error {
  background: #FCEBED;
  border: 1px solid #F4C4CA;
  color: var(--danger);
}

/* FAQ */
.faq-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.faq-search {
  flex: 1;
  min-width: 220px;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.faq-search:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12);
}
.faq-category {
  margin-top: var(--sp-lg);
}
.faq-category-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--sp-sm);
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-weight: 400;
  font-size: 22px;
  color: var(--brand-red);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-answer {
  padding: 14px 18px 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}
.faq-answer p { margin: 0.5em 0; }
.faq-answer p:first-child { margin-top: 0; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a {
  color: var(--brand-red);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.faq-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* Apps section */
.apps-grid {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .apps-grid { grid-template-columns: 1fr 1fr; }
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.app-card.is-current {
  border-color: var(--brand-red);
  box-shadow: 0 4px 16px rgba(193, 18, 31, 0.08);
}
.app-card .badge {
  display: inline-flex;
  align-self: flex-start;
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.app-card h3 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
}
.app-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}
.store-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--brand-black);
  color: #fff;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.store-link:hover { opacity: 0.85; }

/* Legal links */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.legal-links a {
  color: var(--brand-red);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.legal-links a:hover { text-decoration: underline; }

/* Footer */
.foot {
  margin-top: var(--sp-xxl);
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.7;
}
.foot .legal-name {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: var(--fs-md);
}
.foot .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--sp-md);
  margin-top: var(--sp-sm);
}
.foot .meta span { display: inline-block; }
.foot .social {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}
.foot .social a {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}
.foot .social a:hover {
  color: var(--brand-red);
  border-color: var(--brand-red);
}
.foot .copy {
  margin-top: var(--sp-md);
  border-top: 1px solid var(--border);
  padding-top: var(--sp-md);
  font-size: var(--fs-xs);
}

/* Loading skeleton */
.skeleton {
  background: var(--surface-alt);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-line { height: 14px; margin: 6px 0; }

/* Density tweaks for very small screens */
@media (max-width: 380px) {
  .page { padding: 16px 14px 48px; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 22px; }
  .contact-form { padding: 18px; }
  .picker-card { padding: 22px 18px; }
}
