
/* Transition douce entre thèmes auto */
body {
  transition: background-color 1.2s ease;
}
body.has-results::before {
  transition: background-image 1.4s ease, opacity 1.2s ease, filter 1.2s ease;
}
.page-content .field-btn,
button,
.admin-link,
.loading-indicator,
.stage-footer-tel,
.rohi-theme-swatch,
.courier-info h3,
.liens-utiles-card h3,
.liens-utiles-list a {
  transition: background-color 1s ease, color 1s ease, border-color 1s ease, box-shadow 1s ease !important;
}
:root, body[data-theme="ocean"] {
  /* Contraste : fond sombre → texte clair ; fond clair → texte sombre */
  --ink-on-dark: #f1f5f9;
  --ink-muted-on-dark: #cbd5e1;
  --ink-soft-on-dark: #94a3b8;
  --surface-dark: #252525;
  --surface-dark-header: rgba(0, 0, 0, 0.28);
  --ink-on-light: #0f172a;
  --ink-muted-on-light: #1e293b;
  --ink-soft-on-light: #334155;
  --surface-light: rgba(255, 255, 255, 0.88);
  --surface-light-header: rgba(15, 23, 42, 0.06);
  --rohi-accent: #0ea5e9;
  --rohi-accent-bright: #38bdf8;
  --rohi-accent-soft: #7dd3fc;
  --rohi-accent-glow: rgba(56, 189, 248, 0.35);
  --rohi-accent-bg: rgba(56, 189, 248, 0.12);
  --rohi-accent-bg-strong: rgba(56, 189, 248, 0.22);
  --rohi-btn: #0ea5e9;
  --rohi-btn-hover: #0284c7;
  --rohi-ink-on-accent: #0c1222; /* accent clair → encre sombre */
  --rohi-bg-a: rgba(56, 189, 248, 0.14);
  --rohi-bg-b: rgba(14, 165, 233, 0.1);
  --rohi-bg-c: rgba(99, 102, 241, 0.08);
}
body[data-theme="violet"] {
  --rohi-accent: #7c3aed;
  --rohi-accent-bright: #a78bfa;
  --rohi-accent-soft: #c4b5fd;
  --rohi-accent-glow: rgba(167, 139, 250, 0.4);
  --rohi-accent-bg: rgba(124, 58, 237, 0.14);
  --rohi-accent-bg-strong: rgba(124, 58, 237, 0.24);
  --rohi-btn: #7c3aed;
  --rohi-btn-hover: #6d28d9;
  --rohi-ink-on-accent: #ffffff; /* accent sombre → encre claire */
  --rohi-bg-a: rgba(124, 58, 237, 0.16);
  --rohi-bg-b: rgba(167, 139, 250, 0.12);
  --rohi-bg-c: rgba(236, 72, 153, 0.08);
}
body[data-theme="emeraude"] {
  --rohi-accent: #059669;
  --rohi-accent-bright: #34d399;
  --rohi-accent-soft: #6ee7b7;
  --rohi-accent-glow: rgba(52, 211, 153, 0.4);
  --rohi-accent-bg: rgba(5, 150, 105, 0.14);
  --rohi-accent-bg-strong: rgba(5, 150, 105, 0.24);
  --rohi-btn: #059669;
  --rohi-btn-hover: #047857;
  --rohi-ink-on-accent: #052e1c; /* accent clair → encre sombre */
  --rohi-bg-a: rgba(5, 150, 105, 0.14);
  --rohi-bg-b: rgba(52, 211, 153, 0.1);
  --rohi-bg-c: rgba(14, 165, 233, 0.08);
}
body[data-theme="ambre"] {
  --rohi-accent: #d97706;
  --rohi-accent-bright: #fbbf24;
  --rohi-accent-soft: #fcd34d;
  --rohi-accent-glow: rgba(251, 191, 36, 0.4);
  --rohi-accent-bg: rgba(217, 119, 6, 0.14);
  --rohi-accent-bg-strong: rgba(217, 119, 6, 0.24);
  --rohi-btn: #d97706;
  --rohi-btn-hover: #b45309;
  --rohi-ink-on-accent: #1c1408; /* accent clair → encre sombre */
  --rohi-bg-a: rgba(217, 119, 6, 0.14);
  --rohi-bg-b: rgba(251, 191, 36, 0.1);
  --rohi-bg-c: rgba(239, 68, 68, 0.08);
}
body[data-theme="rose"] {
  --rohi-accent: #e11d48;
  --rohi-accent-bright: #fb7185;
  --rohi-accent-soft: #fda4af;
  --rohi-accent-glow: rgba(251, 113, 133, 0.4);
  --rohi-accent-bg: rgba(225, 29, 72, 0.14);
  --rohi-accent-bg-strong: rgba(225, 29, 72, 0.24);
  --rohi-btn: #e11d48;
  --rohi-btn-hover: #be123c;
  --rohi-ink-on-accent: #ffffff; /* accent sombre → encre claire */
  --rohi-bg-a: rgba(225, 29, 72, 0.14);
  --rohi-bg-b: rgba(251, 113, 133, 0.1);
  --rohi-bg-c: rgba(124, 58, 237, 0.08);
}

/* Bouton thème retiré — changement auto / mouvement curseur */
.rohi-theme-toggle,
#rohiThemeToggle,
.rohi-theme-swatch {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.has-results .rohi-theme-toggle {
  background: rgba(18, 22, 31, 0.85);
}

/* Map existing accents to theme vars (sans rechargement) */
.page-content .field-btn,
button:not(.admin-link):not(.btn-autre-recherche) { background-color: var(--rohi-btn) !important; }
.page-content .field-btn:hover,
button:not(.admin-link):not(.btn-autre-recherche):hover { background-color: var(--rohi-btn-hover) !important; }
.page-content .field-input:focus,
input[type="text"]:focus {
  border-color: var(--rohi-accent) !important;
  box-shadow: 0 0 0 3px var(--rohi-accent-glow) !important;
}
.page-content .field-input:hover { border-color: var(--rohi-accent-soft) !important; }
.loading-indicator { color: var(--rohi-accent-bright) !important; }
.stage-footer-tel { color: #0369a1 !important; }

/* Couleurs de fond liées au thème (complétées plus bas par les animations) */
body.has-results[data-theme] {
  --rohi-aurora-a: var(--rohi-accent-glow);
  --rohi-aurora-b: var(--rohi-bg-a);
  --rohi-aurora-c: var(--rohi-bg-b);
  --rohi-aurora-d: var(--rohi-bg-c);
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 100;
  font-size: 12px;
  background-color: #2a2520;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  min-width: 0;
  color: #1a1a1a;
  line-height: 1.5;
}

body.has-results {
  padding: 0;
  /* clip n’empêche pas position:sticky (contrairement à hidden) */
  overflow-x: clip;
  background-color: #2a2520;
  position: relative;
  /* flex + align-items:center casse sticky : repasser en flux normal */
  display: block !important;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
}
html:has(body.has-results) {
  overflow-x: clip;
}

body.has-results::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("images/fond4.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.6;
}

/* Page d'accueil : bloc plein écran, image + champs solidaires (une seule "découpe") */
body:not(.has-results) .container {
  background: transparent;
  box-shadow: none;
  transform: none;
  padding: 0;
  max-width: none;
  width: 100%;
  height: 100vh;
  position: relative;
}

body:not(.has-results) .container:hover {
  box-shadow: none;
  transform: none;
}

/* Wrapper = tout l'espace ; image en cover + page-content en overlay = même repère, solidaires */
.background-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

body.has-results .background-wrapper {
  display: none;
}

.page-content {
  position: absolute;
  inset: 0;
  transform: rotate(-1deg);
  transform-origin: center center;
  z-index: 2;
}

.background-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  pointer-events: none;
}

.page-content .field-subtitle,
.page-content .field-row,
.page-content .loading-indicator,
.page-content .error-container {
  position: absolute;
  margin: 0;
}

.page-content .field-subtitle {
  top: 36%;
  left: 24%;
  width: 52%;
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  font-weight: 300;
  color: #424242;
  padding-bottom: 0.5em;
  line-height: 1.35;
  min-height: 2.5em;
  box-sizing: border-box;
}

.page-content .field-row {
  top: 44%;
  left: 24%;
  width: 52%;
  min-width: min(220px, 90vw);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.page-content .field-input {
  flex: 1;
  min-width: 120px;
  min-height: 2.25rem;
  padding: 0.4em 0.6em;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  font-size: clamp(12px, 2.5vw, 14px);
  color: #1a1a1a;
  box-sizing: border-box;
  flex: 1 1 60%;
}

.page-content .field-input.field-input--code {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 180px;
}

.page-content .field-input::placeholder {
  color: #757575;
}

.page-content .field-input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.page-content .field-btn {
  flex: 0 0 auto;
  max-width: 38%;
  min-width: 5rem;
  min-height: 2.25rem;
  padding: 0.4em 0.75em;
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.page-content .field-btn:hover {
  background: #0284c7;
}

.page-content .loading-indicator {
  top: 58%;
  left: 24%;
  width: 52%;
  min-height: 2.5rem;
  margin-top: 0;
}

.page-content .error-container {
  top: 58%;
  left: 24%;
  width: 52%;
  min-height: 2rem;
  margin-top: 0;
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
  color: #b71c1c;
}

/* Footer sur la page d'accueil : styles détaillés plus bas (section pied de page) */
body:not(.has-results) .container > footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 40;
  margin: 0;
  transform: none;
}

/* Bloc principal : posé sur le cahier blanc du fond */
.container {
  background: rgba(255, 252, 248, 0.97);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  padding: 40px;
  width: 90%;
  max-width: 640px;
  text-align: center;
  position: relative;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  color: #1a1a1a;
}

.container:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transform: none;
}

.hero-section {
  margin-bottom: 30px;
}

.hero-section h1 {
  color: #0ea5e9;
  font-size: 1.25em;
  font-weight: 500;
  margin-bottom: 8px;
}

.hero-section p {
  color: #424242;
  font-size: 0.82em;
  font-weight: 300;
  margin-bottom: 0;
}

.search-container {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #ccc;
  background-color: #fff;
  border-radius: 6px;
  font-size: 12px;
  width: 100%;
  color: #1a1a1a;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

input[type="text"]::placeholder {
  color: #757575;
}

input[type="text"]:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

button {
  background-color: #0ea5e9;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}

button:hover {
  background-color: #0284c7;
  color: #fff;
}

.page-results-wrapper {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto 0 max(0px, calc((100% - 1320px) / 2 - 40px));
  padding: 24px 24px 24px 8px;
  box-sizing: border-box;
  align-self: stretch;
}

.page-results-wrapper .container {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.results-sidebar {
  position: sticky;
  top: 20px;
  min-width: 0;
}

/* Responsive: mobile uniquement → une colonne, bloc stagiaire au-dessus */
@media (max-width: 600px) {
  .page-results-wrapper {
    grid-template-columns: 1fr;
    padding: 16px 12px;
    gap: 16px;
  }
  .results-sidebar {
    position: static;
  }
  .courier-info {
    padding: 16px;
  }
  .courier-info h3 {
    font-size: 0.9rem;
  }
  .stagiaire-summary p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .page-results-wrapper {
    padding: 12px 10px;
  }
  .courier-info {
    padding: 12px;
  }
}

.results-container {
  margin-top: 30px;
  text-align: left;
}

.btn-autre-recherche {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--rohi-btn) !important;
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  z-index: 1;
}
.btn-autre-recherche:hover {
  background: var(--rohi-btn-hover) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.results-main {
  min-width: 0;
  overflow-x: auto;
  overflow-wrap: break-word;
}

.results-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-top: 0;
}

.courier-info {
  border: none;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 0;
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.courier-info:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.courier-info h3 {
  margin-top: 0;
  color: #38bdf8;
  font-size: 0.95rem;
  font-weight: 500;
}

.courier-info p {
  margin-bottom: 3px;
  line-height: 1.28;
  color: #bdbdbd;
  font-size: 0.85rem;
}

/* Liens utiles – carte sous les informations */
.liens-utiles-card {
  border: none;
  border-radius: 6px;
  padding: 20px;
  margin-top: 16px;
  background-color: #2c2c2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.liens-utiles-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.liens-utiles-card h3 {
  margin-top: 0;
  color: #38bdf8;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.liens-utiles-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.liens-utiles-list li {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.liens-utiles-list li:last-child {
  margin-bottom: 0;
}

.liens-utiles-list .liens-utiles-desc {
  font-size: 0.85rem;
  color: #9e9e9e;
  text-align: right;
  flex-shrink: 0;
}

.liens-utiles-list a {
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.liens-utiles-list a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Timeline – situation du dossier */
.timeline-wrap {
  margin-top: 28px;
  position: relative;
}

.timeline-wrap > h3 {
  color: #38bdf8;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 10px 0 6px 8px;
  border-bottom: 1px solid #3d3d3d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 50%, #0ea5e9 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
  display: block;
}

.timeline-item:last-child {
  padding-bottom: 12px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0ea5e9;
  border: 3px solid #1e1e1e;
  box-shadow: 0 0 0 2px #38bdf8;
  z-index: 1;
  box-sizing: border-box;
}

.timeline-item:first-child::before {
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.timeline-item:last-child::before {
  background: #7dd3fc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.timeline-card {
  display: block;
  background: #252525;
  border: 1px solid #3d3d3d;
  border-radius: 12px;
  padding: 0;
  border-left: 4px solid #38bdf8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  margin-bottom: 4px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.timeline-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
}

.timeline-item:first-child .timeline-card {
  border-left-color: #38bdf8;
}

.timeline-item:last-child .timeline-card {
  border-left-color: #7dd3fc;
}

.timeline-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.timeline-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #38bdf8;
  color: #121212;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Dates / heures : texte nu, sans encadré */
.timeline-meta {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.timeline-date,
.timeline-date-badge,
.timeline-date-text {
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.timeline-ref-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 5px;
  font-family: inherit;
  /* défaut : fond clair → texte sombre (évite sombre/sombre) */
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.18) !important;
}

.timeline-card .timeline-path {
  color: #e0e0e0;
  font-size: 0.85rem;
  padding: 10px 20px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.timeline-card .timeline-path i {
  color: #38bdf8;
  font-size: 0.75rem;
}

.timeline-instruction {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 12px;
  color: #bdbdbd;
  font-size: 0.85rem;
}

.timeline-instruction i {
  color: #7dd3fc;
  width: 16px;
  text-align: center;
}

.timeline-comment {
  margin: 0 20px 14px;
  padding: 10px 12px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 8px;
  border-left: 3px solid #7dd3fc;
  color: #bdbdbd;
  font-size: 0.8rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.timeline-comment i {
  color: #7dd3fc;
  margin-top: 2px;
  flex-shrink: 0;
}

.stagiaire-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 20px;
  margin-top: 12px;
}

.stagiaire-summary p {
  margin: 0;
  font-size: 0.85rem;
}

.stagiaire-summary p strong {
  margin-right: 1em;
}

.stagiaire-summary .statut-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.stagiaire-summary .statut-badge.statut-accepted {
  background: rgba(76, 175, 80, 0.25);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.5);
}
.stagiaire-summary .statut-badge.statut-refused {
  background: rgba(244, 67, 54, 0.2);
  color: #e57373;
  border: 1px solid rgba(244, 67, 54, 0.45);
}
.stagiaire-summary .statut-badge.statut-pending {
  background: rgba(255, 193, 7, 0.2);
  color: #ffd54f;
  border: 1px solid rgba(255, 193, 7, 0.45);
}
.stagiaire-summary .statut-badge.statut-neutral {
  background: rgba(158, 158, 158, 0.2);
  color: #bdbdbd;
  border: 1px solid rgba(158, 158, 158, 0.35);
  font-size: 0.75rem;
}

.error-container {
  color: #ff8a80;
  margin-top: 24px;
  font-size: 0.82rem;
  min-height: 2rem;
}
.pending-data {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.72em;
    display: inline-block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f3f4f6d9 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite linear;
    border-radius: 4px;
    padding: 2px 8px;
}

@keyframes loading-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #424242;
  color: #616161;
  font-size: 0.7rem;
}
.admin-link-wrap {
  margin: 8px 0 0;
}

.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  min-height: 2.5rem;
  font-size: 1.1rem;
  color: #38bdf8;
  visibility: hidden;
}

.loading-indicator.visible {
  visibility: visible;
}

/* Responsive global (page recherche + page résultats) */
@media (max-width: 768px) {
  .container {
    width: 92%;
    padding: 24px 20px;
    max-width: none;
  }

  .hero-section {
    margin-bottom: 20px;
  }

  .hero-section h1 {
    font-size: 1.2em;
  }

  .hero-section p {
    font-size: 0.9em;
  }

  .search-container {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }

  input[type="text"],
  button {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    font-size: 16px;
    box-sizing: border-box;
  }

  .btn-autre-recherche {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .results-container {
    margin-top: 20px;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline::before {
    left: 5px;
  }

  .timeline-item::before {
    left: -24px;
    width: 12px;
    height: 12px;
    margin-left: 0;
  }

  .timeline-card {
    padding: 12px 14px;
  }

  .stagiaire-summary {
    grid-template-columns: 1fr;
  }

  footer {
    margin-top: 24px;
    padding-top: 12px;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 20px 16px;
    border-radius: 0;
  }

  .hero-section h1 {
    font-size: 1.15em;
  }

  input[type="text"],
  button {
    min-height: 48px;
    padding: 14px;
  }

  .btn-autre-recherche {
    width: 100%;
    max-width: 100%;
  }
/* ——— Animations & survols (ROHI stage suivi) ——— */
@media (prefers-reduced-motion: no-preference) {
  body:not(.has-results) .background-image {
    animation: stage-fond-in 1.1s ease-out both;
  }

  body:not(.has-results) .page-content .field-subtitle {
    animation: stage-rise 0.7s ease-out 0.15s both;
  }

  body:not(.has-results) .page-content .field-row {
    animation: stage-rise 0.75s ease-out 0.28s both;
  }

  body:not(.has-results) .container > footer {
    animation: stage-fade 0.8s ease-out 0.45s both;
  }

  body.has-results .page-results-wrapper {
    animation: stage-fade 0.45s ease-out both;
  }

  body.has-results .results-sidebar .courier-info {
    animation: stage-slide-left 0.55s ease-out both;
  }

  body.has-results .results-sidebar .liens-utiles-card {
    animation: stage-slide-left 0.55s ease-out 0.08s both;
  }

  body.has-results .results-main {
    animation: stage-rise 0.55s ease-out 0.12s both;
  }

  .timeline-item {
    animation: stage-card-in 0.5s ease-out both;
  }
  .timeline-item:nth-child(1) { animation-delay: 0.05s; }
  .timeline-item:nth-child(2) { animation-delay: 0.12s; }
  .timeline-item:nth-child(3) { animation-delay: 0.19s; }
  .timeline-item:nth-child(4) { animation-delay: 0.26s; }
  .timeline-item:nth-child(5) { animation-delay: 0.33s; }
  .timeline-item:nth-child(6) { animation-delay: 0.4s; }
  .timeline-item:nth-child(7) { animation-delay: 0.47s; }
  .timeline-item:nth-child(8) { animation-delay: 0.54s; }
  .timeline-item:nth-child(n+9) { animation-delay: 0.6s; }
}

@keyframes stage-fond-in {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes stage-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stage-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stage-slide-left {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes stage-card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stage-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px #38bdf8; }
  50% { box-shadow: 0 0 0 2px #38bdf8, 0 0 14px rgba(56, 189, 248, 0.75); }
}

.page-content .field-input {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
  cursor: text;
}

.page-content .field-input:hover {
  border-color: #7dd3fc;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

.page-content .field-input:focus {
  transform: translateY(-1px);
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22), 0 4px 14px rgba(14, 165, 233, 0.15);
}

.page-content .field-btn {
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.page-content .field-btn:hover {
  background: #0284c7;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.45);
}

.page-content .field-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
}

.page-content .field-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.loading-indicator.visible i {
  animation: stage-spin 0.85s linear infinite;
}

@keyframes stage-spin {
  to { transform: rotate(360deg); }
}

.error-container:not(:empty) {
  animation: stage-shake 0.45s ease-out;
}

@keyframes stage-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}


.courier-info,
.liens-utiles-card {
  cursor: default;
  transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease;
}

.courier-info:hover,
.liens-utiles-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(56, 189, 248, 0.28);
}

.liens-utiles-list li {
  border-radius: 6px;
  padding: 4px 6px;
  margin-left: -6px;
  margin-right: -6px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: default;
}

.liens-utiles-list li:hover {
  background: rgba(56, 189, 248, 0.08);
  transform: translateX(3px);
}

.liens-utiles-list a {
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
  cursor: pointer;
}

.liens-utiles-list a:hover {
  color: #7dd3fc;
  text-decoration: none;
  transform: translateX(2px);
}

.stagiaire-summary .statut-badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  cursor: default;
}

.stagiaire-summary .statut-badge:hover {
  transform: scale(1.06);
  filter: brightness(1.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.timeline-card {
  cursor: default;
  transition: box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, background-color 0.25s ease !important;
}

.timeline-card:hover {
  transform: translateY(-4px) scale(1.01) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.35) !important;
  background: #2a2a2a !important;
}

.timeline-item:hover::before {
  animation: stage-pulse-dot 1.2s ease-in-out infinite;
  background: #7dd3fc;
}

.timeline-step-badge {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-card:hover .timeline-step-badge {
  transform: scale(1.12) rotate(-6deg);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

.header-with-stats {
  position: sticky;
  top: 10px;
  z-index: 40;
}
.stats-demandes-item {
  --float-x: 0px;
  --float-y: 0px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important;
  cursor: default;
  transform: translate(var(--float-x), var(--float-y));
  will-change: transform;
}

.stats-demandes-item:hover {
  transform: translate(var(--float-x), calc(var(--float-y) - 4px)) scale(1.04) !important;
  background: var(--rohi-accent-bg-strong) !important;
  border-color: var(--rohi-accent-soft) !important;
  box-shadow: 0 10px 20px var(--rohi-accent-glow) !important;
}

.btn-autre-recherche {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease !important;
  cursor: pointer;
}

.btn-autre-recherche:hover {
  transform: translateY(-3px) scale(1.04) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35) !important;
}

.btn-autre-recherche:active {
  transform: translateY(0) scale(0.98) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ——— Responsivité + pied de page plus visible ——— */

/* Formulaire : empilement mobile */
@media (max-width: 720px) {
  .page-content {
    transform: none;
  }

  .page-content .field-subtitle {
    top: auto;
    bottom: 42%;
    left: 6%;
    width: 88%;
    text-align: center;
    font-size: clamp(0.95rem, 3.6vw, 1.1rem);
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  }

  .page-content .field-row,
  .page-content .field-row--stack-on-mobile {
    top: auto;
    bottom: 28%;
    left: 6%;
    width: 88%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-content .field-input,
  .page-content .field-input.field-input--code {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
    border-radius: 10px;
  }

  .page-content .field-btn {
    width: 100%;
    max-width: none;
    min-height: 48px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .page-content .loading-indicator,
  .page-content .error-container {
    top: auto;
    bottom: 16%;
    left: 6%;
    width: 88%;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .page-content .field-subtitle {
    bottom: 46%;
  }
  .page-content .field-row,
  .page-content .field-row--stack-on-mobile {
    bottom: 30%;
  }
}

/* Résultats : grille plus souple tablette */
@media (max-width: 900px) {
  .page-results-wrapper {
    grid-template-columns: 1fr !important;
    padding: 16px 12px !important;
    gap: 16px !important;
  }
  .results-sidebar {
    position: static !important;
  }
  .stats-demandes {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .stats-demandes {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .header-with-stats {
    flex-direction: column !important;
  }
  .mef-header {
    width: 100%;
  }
}


/* Pied de page — zone sombre sous la ligne de séparation, textes gras */
body:not(.has-results) .container > footer,
body:not(.has-results) .container > footer.stage-footer {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 40 !important;
  margin: 0 !important;
  padding: 18px 20px max(22px, env(safe-area-inset-bottom)) !important;
  text-align: center !important;
  transform: none !important;
  border-top: 2px solid rgba(15, 23, 42, 0.85) !important;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  box-shadow: 0 -12px 36px rgba(2, 6, 23, 0.45) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #f8fafc !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
}

.stage-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 4px;
  margin: 0 0 12px !important;
  font-size: clamp(0.82rem, 2.4vw, 0.95rem);
  font-weight: 700;
}

.stage-footer-legal a {
  color: #e2e8f0 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.stage-footer-legal a:hover {
  color: #ffffff !important;
}

.stage-footer-copy {
  margin: 0 0 14px !important;
  color: #f8fafc !important;
  font-size: clamp(0.92rem, 2.6vw, 1.08rem) !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.stage-footer-sep {
  margin: 0 0.35em;
  color: #94a3b8;
  font-weight: 700;
}

.stage-footer-tel {
  color: #7dd3fc !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.stage-footer-tel:hover {
  color: #bae6fd !important;
}

.admin-link-wrap {
  margin: 0 !important;
  display: block !important;
}

.admin-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 46px !important;
  padding: 11px 26px !important;
  border-radius: 12px !important;
  border: 2px solid #0284c7 !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  font-size: clamp(0.95rem, 2.8vw, 1.05rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  text-decoration: none !important;
  text-transform: none !important;
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.4) !important;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
  cursor: pointer !important;
}

.admin-link i {
  font-size: 1em;
  color: #ffffff !important;
}

.admin-link:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(3, 105, 161, 0.45) !important;
  text-decoration: none !important;
}

.admin-link:hover i {
  color: #ffffff !important;
}

.admin-link:active {
  transform: translateY(0) !important;
}

body.has-results footer.stage-footer,
body.has-results footer {
  margin-top: 28px;
  padding: 18px 16px 22px;
  border-top: 2px solid rgba(15, 23, 42, 0.85);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

body.has-results .admin-link-wrap {
  display: block !important;
}

@media (max-width: 560px) {
  .stage-footer-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    font-size: 0.95rem !important;
  }
  .stage-footer-sep {
    display: none;
  }
  .admin-link {
    width: min(100%, 320px) !important;
  }
}

/* Fond animé riche — auroras + orbes de couleur (thème) */
body.has-results {
  background-color: #0f141c;
  --rohi-aurora-a: var(--rohi-accent-glow);
  --rohi-aurora-b: var(--rohi-bg-a);
  --rohi-aurora-c: var(--rohi-bg-b);
  --rohi-aurora-d: var(--rohi-bg-c);
}
body.has-results::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 55% 45% at 12% 18%, var(--rohi-aurora-a), transparent 58%),
    radial-gradient(ellipse 50% 40% at 88% 22%, var(--rohi-aurora-b), transparent 55%),
    radial-gradient(ellipse 48% 42% at 78% 78%, var(--rohi-aurora-c), transparent 52%),
    radial-gradient(ellipse 42% 38% at 18% 82%, var(--rohi-aurora-d), transparent 50%),
    radial-gradient(circle 28% at 50% 48%, var(--rohi-accent-bg-strong), transparent 70%),
    linear-gradient(155deg, #0c111a 0%, #151b28 42%, #1a1224 72%, #0f1722 100%);
  background-size: 140% 140%, 150% 150%, 145% 145%, 160% 160%, 120% 120%, 100% 100%;
  opacity: 1;
  filter: saturate(1.25) brightness(1.05);
  animation:
    rohiBgDrift 18s ease-in-out infinite alternate,
    rohiBgHue 22s ease-in-out infinite alternate,
    rohiBgPulse 9s ease-in-out infinite;
}
body.has-results::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--rohi-accent-soft), transparent 55%),
    radial-gradient(ellipse 60% 40% at 110% 60%, var(--rohi-accent-glow), transparent 50%),
    radial-gradient(ellipse 50% 35% at -10% 70%, var(--rohi-bg-c), transparent 48%),
    linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);
  background-size: 160% 120%, 140% 140%, 150% 150%, 220% 220%;
  mix-blend-mode: soft-light;
  opacity: 0.55;
  animation:
    rohiAuroraSweep 14s ease-in-out infinite alternate,
    rohiAuroraShimmer 7s linear infinite;
}
@keyframes rohiBgDrift {
  0%   { background-position: 0% 15%, 100% 10%, 90% 90%, 5% 95%, 50% 50%, 0 0; }
  50%  { background-position: 18% 40%, 70% 35%, 55% 70%, 30% 60%, 42% 58%, 0 0; }
  100% { background-position: 28% 55%, 55% 70%, 30% 40%, 55% 25%, 58% 42%, 0 0; }
}
@keyframes rohiBgHue {
  0%   { filter: saturate(1.15) brightness(1.02) hue-rotate(0deg); }
  50%  { filter: saturate(1.45) brightness(1.1) hue-rotate(18deg); }
  100% { filter: saturate(1.3) brightness(1.06) hue-rotate(-12deg); }
}
@keyframes rohiBgPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: 0.92; }
}
@keyframes rohiAuroraSweep {
  0%   { background-position: 0% 0%, 100% 40%, 0% 80%, 0% 50%; opacity: 0.4; }
  100% { background-position: 40% 30%, 40% 70%, 50% 20%, 80% 50%; opacity: 0.7; }
}
@keyframes rohiAuroraShimmer {
  0%   { background-position: 0% 0%, 100% 40%, 0% 80%, -40% 50%; }
  100% { background-position: 0% 0%, 100% 40%, 0% 80%, 140% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  body.has-results::before,
  body.has-results::after {
    animation: none !important;
    transform: none !important;
  }
}
body.has-results .page-results-wrapper {
  position: relative;
  z-index: 1;
  overflow: visible !important;
  align-items: start !important;
}
/* 2 cartes de gauche : toujours visibles (scroll haut/bas) */
body.has-results .results-sidebar {
  position: sticky !important;
  top: 12px !important;
  align-self: start !important;
  z-index: 35 !important;
  max-height: calc(100vh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.has-results .results-sidebar .courier-info,
body.has-results .results-sidebar .liens-utiles-card {
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  body.has-results::before { animation: none; }
}


/*
 * Contraste strict :
 * - fond sombre → texte clair
 * - fond clair → texte sombre
 * Jamais sombre/sombre ni clair/clair.
 */

/* Dates : texte seul, jamais encadré / pastille */
body.has-results .timeline-meta,
body.has-results .timeline-date,
body.has-results .timeline-date-badge,
body.has-results .timeline-date-text,
body.has-results .timeline-date *,
body.has-results .timeline-date-badge *,
body.has-results .timeline-date-text * {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  text-shadow: none !important;
}
body.has-results .timeline-date,
body.has-results .timeline-date-badge,
body.has-results .timeline-date-text {
  display: inline !important;
  color: #1e293b !important; /* fond page clair → texte sombre, sans cadre */
  opacity: 1 !important;
  filter: none !important;
}

/* Carte actuelle = fond ciel doux (pas trop sombre) + texte sombre */
body.has-results .timeline-item.is-current .timeline-card {
  background: linear-gradient(165deg, #e0f2fe 0%, #bae6fd 55%, #7dd3fc 100%) !important;
  border-color: #0284c7 !important;
  color: #0c4a6e !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.28) !important;
}
body.has-results .timeline-item.is-current .timeline-card,
body.has-results .timeline-item.is-current .timeline-card *:not(.timeline-step-badge):not(.timeline-step-badge *):not(.timeline-ref-badge) {
  color: #0c4a6e !important;
}
body.has-results .timeline-item.is-current .timeline-card .timeline-path,
body.has-results .timeline-item.is-current .timeline-card .timeline-path-block,
body.has-results .timeline-item.is-current .timeline-card .timeline-path * {
  color: #0f172a !important;
  font-weight: 700 !important;
}
body.has-results .timeline-item.is-current .timeline-card .timeline-instruction,
body.has-results .timeline-item.is-current .timeline-card .timeline-comment,
body.has-results .timeline-item.is-current .timeline-card .timeline-site-porte,
body.has-results .timeline-item.is-current .timeline-card .timeline-site-porte *,
body.has-results .timeline-item.is-current .timeline-card i {
  color: #1e293b !important;
}
body.has-results .timeline-item.is-current .timeline-card-header {
  background: rgba(255, 255, 255, 0.45) !important;
  border-bottom-color: rgba(2, 132, 199, 0.25) !important;
}
body.has-results .timeline-item.is-current .timeline-ref-badge {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border: 1px solid rgba(2, 132, 199, 0.35) !important;
}
body.has-results .timeline-item.is-current .timeline-comment {
  background: rgba(255, 255, 255, 0.55) !important;
  color: #0c4a6e !important;
}
body.has-results .timeline-item.is-current .timeline-step-badge {
  background: #0284c7 !important;
  color: #ffffff !important;
}
body.has-results .timeline-item.is-current .timeline-site-porte {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding: 6px 0 2px;
  font-size: 0.74rem;
  line-height: 1.4;
}
body.has-results .timeline-item.is-current .timeline-date,
body.has-results .timeline-item.is-current .timeline-date * {
  color: #1e293b !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-shadow: none !important;
}

/* Cartes passées = fond clair → tout le contenu en sombre */
body.has-results .timeline-item.is-past .timeline-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  color: #0f172a !important;
  opacity: 1 !important;
  filter: none !important;
}
body.has-results .timeline-item.is-past .timeline-card,
body.has-results .timeline-item.is-past .timeline-card *:not(.timeline-step-badge):not(.timeline-step-badge *):not(.timeline-ref-badge) {
  color: #0f172a !important;
}
body.has-results .timeline-item.is-past .timeline-card .timeline-path,
body.has-results .timeline-item.is-past .timeline-card .timeline-instruction,
body.has-results .timeline-item.is-past .timeline-card .timeline-comment,
body.has-results .timeline-item.is-past .timeline-card i {
  color: #1e293b !important;
}
body.has-results .timeline-item.is-past .timeline-card-header {
  background: rgba(15, 23, 42, 0.06) !important;
  border-bottom-color: rgba(15, 23, 42, 0.12) !important;
}
/* N° dossier sur carte claire → pastille claire + texte sombre */
body.has-results .timeline-item.is-past .timeline-ref-badge {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.2) !important;
}
body.has-results .timeline-item.is-past .timeline-comment {
  background: rgba(15, 23, 42, 0.04) !important;
  color: #1e293b !important;
}
body.has-results .timeline-item.is-past .timeline-step-badge {
  background: #1e293b !important;
  color: #fff !important; /* pastille sombre → texte clair */
}
body.has-results .timeline-item.is-past .timeline-date,
body.has-results .timeline-item.is-past .timeline-date * {
  color: #1e293b !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-shadow: none !important;
}
/* Anciennes pastilles date éventuelles : neutre total */
body.has-results .timeline-meta,
body.has-results .timeline-meta * {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* Sidebar sombre → textes / liens clairs */
body.has-results .courier-info,
body.has-results .liens-utiles-card {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}
body.has-results .courier-info h3,
body.has-results .liens-utiles-card h3 {
  color: var(--rohi-accent-soft) !important;
}
body.has-results .courier-info p,
body.has-results .courier-info strong,
body.has-results .courier-info .stagiaire-summary,
body.has-results .liens-utiles-desc {
  color: #e2e8f0 !important;
}
/* Réf. dossier dans la sidebar sombre → texte clair */
body.has-results .courier-info .stagiaire-summary p {
  color: #f1f5f9 !important;
}
body.has-results .liens-utiles-list a {
  color: #f0f9ff !important;
}
body.has-results .liens-utiles-list a:hover {
  color: var(--rohi-accent-bright) !important;
}

/* Bandeau sticky MEF + stats : fond clair → textes sombres */
body.has-results .header-with-stats {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12) !important;
}
body.has-results .header-with-stats .mef-line,
body.has-results .header-with-stats .mef-header .mef-line {
  color: #0f172a !important;
  text-shadow: none !important;
}
body.has-results .header-with-stats .mef-logo {
  filter: none !important;
  opacity: 1 !important;
}
body.has-results .stats-demandes-item {
  background: var(--rohi-accent-bg) !important;
  border-color: var(--rohi-accent-glow) !important;
}
body.has-results .stats-demandes-item .stats-nb {
  color: var(--rohi-btn-hover) !important;
}
body.has-results .stats-demandes-item .stats-label {
  color: #475569 !important;
}

/* Vague de thème : gauche → droite, ondulaire */
body.theme-wave::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background: linear-gradient(
    100deg,
    transparent 0%,
    var(--rohi-accent-glow) 42%,
    var(--rohi-accent-soft) 50%,
    var(--rohi-accent-glow) 58%,
    transparent 100%
  );
  width: 42vw;
  transform: translateX(calc(var(--wave-x, 0%) - 20%));
  opacity: 0.55;
  mix-blend-mode: soft-light;
  transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  filter: blur(8px);
}
.theme-wave-el {
  transition:
    background-color 0.75s ease var(--wave-delay, 0ms),
    color 0.75s ease var(--wave-delay, 0ms),
    border-color 0.75s ease var(--wave-delay, 0ms),
    box-shadow 0.75s ease var(--wave-delay, 0ms),
    filter 0.75s ease var(--wave-delay, 0ms) !important;
}
body.has-results {
  transition: background-color 1s ease;
}
body.has-results::before {
  transition: background-image 1.1s ease, filter 1.1s ease, opacity 1.1s ease;
}
