/* MediTrack — site vitrine
   Un seul fichier pour le français (LTR) et la darija (RTL) :
   uniquement des propriétés logiques (inline/block), pas de left/right. */

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #536074;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f6f8f7;
  --brand: #047857;
  --brand-strong: #065f46;
  --brand-tint: #e7f6ef;
  --brand-vivid: #10b981;
  --urgent: #b91c1c;
  --urgent-tint: #fee2e2;
  --warn: #92400e;
  --warn-tint: #fef3c7;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.07);
  --max: 1120px;
  --font-latin: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-latin);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body { font-family: var(--font-arabic); line-height: 1.85; }

img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }

:focus-visible {
  outline: 3px solid var(--brand-vivid);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 100;
  text-decoration: none;
}
.skip:focus { top: 12px; }
[dir="rtl"] .skip { left: auto; right: 16px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; margin-inline-end: 10px; }

.nav-links {
  display: none;
  align-items: center;
}
.nav-links a + a { margin-inline-start: 28px; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--brand); }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
}
.lang-switch a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.4;
}
.lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: #fff;
}
.lang-switch a:not([aria-current="true"]):hover { color: var(--brand); }

/* ---------- Boutons / badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.store-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  line-height: 1.2;
  cursor: default;
}
.store-badge svg { width: 26px; height: 26px; flex: none; margin-inline-end: 12px; }
.store-badge small { display: block; font-size: 0.6875rem; opacity: 0.75; letter-spacing: 0.02em; }
.store-badge strong { display: block; font-size: 1rem; font-weight: 600; }

/* ---------- Hero ---------- */
.hero { padding-top: 56px; padding-bottom: 72px; }

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 16px;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.9375rem; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.4; }

h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }

.lead {
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 34em;
  margin: 20px 0 32px;
}

.cta-row { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: -12px; }
.cta-row > * { margin-inline-end: 14px; margin-bottom: 12px; }
.cta-row > *:last-child { margin-inline-end: 0; }

.hero-visual {
  position: relative;
  min-height: 460px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--brand-tint);
}
.hero-visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, 0.35) 100%);
}

.mock {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  gap: 10px;
}
.mock-label {
  justify-self: start;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px 10px;
  border-radius: 999px;
}
html[lang="ar"] .mock-label { letter-spacing: 0; text-transform: none; font-size: 0.75rem; }

.alert-card {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-inline-start: 4px solid var(--warn-tint);
}
.alert-card.urgent { border-inline-start-color: #ef4444; }
.alert-card.soon { border-inline-start-color: #f59e0b; }

.alert-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  margin-inline-end: 12px;
}
.urgent .alert-dot { background: var(--urgent-tint); color: var(--urgent); }
.soon .alert-dot { background: var(--warn-tint); color: var(--warn); }
.alert-dot svg { width: 20px; height: 20px; }

.alert-body { flex: 1; min-width: 0; }
.alert-body strong { display: block; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.alert-body span { display: block; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.alert-body .state { font-weight: 600; }
.urgent .state { color: var(--urgent); }
.soon .state { color: var(--warn); }

.call {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-vivid);
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  margin-inline-start: 12px;
}
.call svg { width: 18px; height: 18px; }

/* ---------- Chiffres ---------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.stat {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.stat:last-child { border-bottom: 0; }
.stat b {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.stat span { color: var(--ink-soft); font-size: 0.9375rem; }

/* ---------- Sections ---------- */
section { scroll-margin-top: 80px; }
.section { padding-top: 80px; padding-bottom: 80px; }
.section.soft { background: var(--bg-soft); }
.section-head { max-width: 40em; margin-bottom: 48px; }
.section-head p { color: var(--ink-soft); font-size: 1.0625rem; margin: 16px 0 0; }

/* Étapes */
.steps { display: grid; gap: 20px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
.step {
  position: relative;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 18px;
}
.step p { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.9688rem; }

/* Fonctionnalités */
.features { display: grid; gap: 20px; }
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.feature img { width: 64px; height: 64px; margin-bottom: 16px; }
.feature p { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.9688rem; }

/* Deux colonnes (données, à propos) */
.split { display: grid; gap: 40px; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.checklist li {
  display: flex;
  align-items: flex-start;
  color: var(--ink-soft);
}
.checklist svg { width: 22px; height: 22px; flex: none; margin-inline-end: 12px; color: var(--brand); margin-top: 2px; }

.note {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 0.9375rem;
}

.card-plain {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.card-plain p { margin: 0 0 14px; color: var(--ink-soft); }
.card-plain p:last-child { margin-bottom: 0; }

.people { display: grid; gap: 16px; margin-top: 28px; }
.person {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
  margin-inline-end: 16px;
  font-family: var(--font-latin);
}
.person strong { display: block; font-weight: 600; line-height: 1.3; }
.person span { color: var(--muted); font-size: 0.875rem; }

/* Bandeau final */
.band {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px 28px;
  text-align: center;
  isolation: isolate;
}
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/pills.webp") center / cover;
  opacity: 0.18;
  z-index: -1;
}
.band h2 { color: #fff; max-width: 18em; margin-left: auto; margin-right: auto; }
.band p { color: #cbd5e1; margin: 16px auto 28px; max-width: 34em; }
.band .cta-row { justify-content: center; }
.band .store-badge { background: #fff; color: var(--ink); }

/* Pied de page */
.site-footer {
  padding-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
}
.foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
  font-size: 0.875rem;
}
.foot a { color: var(--ink-soft); }

/* ---------- Tablette et plus ---------- */
@media (min-width: 720px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
  .nav-links { display: flex; }
  .hero { padding-top: 80px; padding-bottom: 96px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stat { border-bottom: 0; padding: 36px 28px; border-inline-end: 1px solid var(--line); }
  .stat:first-child { padding-inline-start: 0; }
  .stat:last-child { border-inline-end: 0; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .foot { flex-direction: row; justify-content: space-between; align-items: center; }
  .band { padding: 72px 48px; }
}

@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 72px; }
  .hero-visual { min-height: 580px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1fr 1fr; gap: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- Pages de texte (politique de confidentialité) ---------- */
.doc { padding-top: 56px; padding-bottom: 24px; }
.doc .wrap { max-width: 800px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-bottom: 12px; }
.doc .meta { color: var(--muted); font-size: 0.9375rem; margin: 0 0 32px; }
.doc h2 { font-size: 1.375rem; margin: 44px 0 14px; letter-spacing: -0.01em; }
.doc h3 { font-size: 1.0625rem; margin: 24px 0 8px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { padding-inline-start: 22px; margin: 0 0 14px; }
.doc li { margin-bottom: 8px; }
.doc .summary {
  background: var(--brand-tint);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--brand-strong);
  margin-bottom: 8px;
}
.doc .summary p { color: inherit; margin: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 0.9375rem; }
.doc th, .doc td { text-align: start; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.doc th { color: var(--ink); font-weight: 600; background: var(--bg-soft); }
.table-scroll { overflow-x: auto; }
.back { display: inline-block; margin-bottom: 20px; font-size: 0.9375rem; text-decoration: none; font-weight: 500; }

.foot-links { display: flex; flex-wrap: wrap; }
.foot-links a { margin-inline-end: 20px; }
.foot-links a:last-child { margin-inline-end: 0; }
.contact-line { margin: 16px 0 0; color: var(--ink-soft); }

/* ---------- Téléchargement ---------- */
.btn-download svg { margin-inline-end: 10px; flex: none; }
.dl-note { margin: 14px 0 0; font-size: 0.8125rem; color: var(--muted); }
.band .dl-note { color: #cbd5e1; text-align: center; }
.band .btn-download { background: #fff; color: var(--ink); }
.band .btn-download:hover { background: var(--brand-tint); color: var(--ink); }
.hero .cta-row > .btn { margin-bottom: 12px; }

.install { list-style: none; counter-reset: inst; padding: 0; margin: 0; }
.install li {
  position: relative;
  counter-increment: inst;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 16px 62px;
  margin-bottom: 12px;
  color: var(--ink-soft);
}
.install li::before {
  content: counter(inst);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--font-latin);
}
.install li strong { color: var(--ink); }

[dir="rtl"] .install li { padding: 16px 62px 16px 18px; }
[dir="rtl"] .install li::before { left: auto; right: 18px; }

/* Liens du pied de page : marges physiques (les liens dir="ltr" dans une page RTL inversent les marges logiques) */
.foot-links a { margin-inline-end: 0; margin-right: 20px; }
.foot-links a:last-child { margin-right: 0; }
[dir="rtl"] .foot-links a { margin-right: 0; margin-left: 20px; }
[dir="rtl"] .foot-links a:last-child { margin-left: 0; }

/* L'attribut hidden doit toujours gagner, meme sur .btn (display: inline-flex) */
[hidden] { display: none !important; }
