/* ============================================================
   Portail des résultats — Pôle Santé (UPM)
   Palette et typographie dérivées de l'identité sante.upm.ac.ma
   ============================================================ */

:root {
  --ink: #1b2226;
  --body: #3d474b;
  --muted: #74807f;
  --teal: #4abac4;
  --teal-deep: #1f7a83;
  --teal-pale: #e7f5f6;
  --blue: #1863dc;
  --paper: #fafbfb;
  --surface: #ffffff;
  --border: #e1e8ea;
  --shadow: 0 1px 2px rgba(27, 34, 38, 0.04), 0 8px 24px -12px rgba(27, 34, 38, 0.12);
  --radius: 10px;
  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-stretch: 125%; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------- slash motif -------------------- */
.slashes {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 1em;
  vertical-align: -0.05em;
}
.slashes i {
  display: block;
  width: 3px;
  height: 100%;
  background: currentColor;
  transform: skewX(-22deg);
  border-radius: 1px;
}
.rail {
  height: 2px;
  border-radius: 5px;
  background-image: repeating-linear-gradient(-24deg, var(--teal) 0 4px, transparent 4px 11px);
  opacity: 0.55;
}

/* -------------------- nav -------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 251, 251, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 74px; width: auto; }
.brand-label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}
.brand-label strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: uppercase;
}
.brand-label span {
  font-size: 11px;
  color: var(--muted);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.nav-link:hover { border-color: var(--teal); background: var(--teal-pale); }

/* -------------------- hero -------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}
.hero-bars { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bars span {
  position: absolute;
  top: -30%;
  height: 180%;
  width: 12%;
  background: var(--teal);
  opacity: 0.07;
  transform: skewX(-24deg);
}
.hero-bars span:nth-child(1) { right: 4%; }
.hero-bars span:nth-child(2) { right: 13%; }
.hero-bars span:nth-child(3) { right: 22%; }
.hero .container { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 800;
  line-height: 1.04;
  max-width: 16ch;
}
.hero-sub {
  margin-top: 18px;
  max-width: 52ch;
  font-size: 17px;
  color: var(--body);
}
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}
.stat span {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -------------------- filière sections -------------------- */
.filiere-section { padding: 52px 0; border-bottom: 1px solid var(--border); }
.filiere-section:last-of-type { border-bottom: none; }
.filiere-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.filiere-head h2 {
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
.filiere-head h2 .slashes { color: var(--teal); font-size: 20px; }
.filiere-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.track {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}
.step {
  flex: 1 1 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }
.step-badges { display: flex; gap: 6px; }
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal-pale);
  color: var(--teal-deep);
}
.pill.alt { background: #eef1f5; color: var(--muted); }
.step h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  font-family: var(--font-body);
}
.step-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-deep);
  letter-spacing: 0.03em;
}
.step-cta svg { transition: transform 0.15s ease; }
.step:hover .step-cta svg { transform: translateX(3px); }

/* -------------------- footer -------------------- */
.site-footer { padding: 40px 0 56px; }
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.site-footer p { font-size: 13px; color: var(--muted); }
.site-footer a.nav-link { padding: 6px 12px; }

/* -------------------- note (embed) page -------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.back-link:hover { color: var(--teal-deep); }

.note-header { padding: 40px 0 28px; border-bottom: 1px solid var(--border); }
.note-header .eyebrow { margin-bottom: 14px; }
.note-header h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  max-width: 26ch;
}

/* -------------------- visionneuse PDF (PDF.js, sans bouton de téléchargement) -------------------- */
.viewer {
  margin: 32px 0 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.viewer-zoom { display: flex; align-items: center; gap: 8px; }
.vbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.vbtn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-deep); background: var(--teal-pale); }
.vbtn:disabled { opacity: 0.35; cursor: default; }
.viewer-page, .viewer-zoom-level {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  min-width: 3.4em;
  text-align: center;
}
.viewer-stage {
  height: min(78vh, 980px);
  overflow: auto;
  background: #eef2f3;
  display: flex;
  justify-content: center;
  padding: 20px;
}
.viewer-stage:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.viewer-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.viewer-canvas { display: block; box-shadow: 0 2px 10px rgba(27, 34, 38, 0.16); background: #fff; }
.viewer-loading {
  margin: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.viewer-fallback {
  margin: 0;
  padding: 56px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.viewer-fallback a { color: var(--teal-deep); font-weight: 600; }

/* -------------------- responsive -------------------- */
@media (max-width: 720px) {
  .hero { padding: 52px 0 36px; }
  .brand-label { display: none; }
  .filiere-section { padding: 40px 0; }
  .track { flex-direction: column; }
  .step { flex: 1 1 auto; }
  .viewer-stage { height: min(70vh, 720px); padding: 12px; }
}

/* -------------------- a11y -------------------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
