/* =========================================================
   Page d'une course dispatchee (courses.taxis-select.fr/c/CODE)
   Complement de pages.css et formulaire-partenaire.css, copies du
   site www.taxis-select.fr : memes variables, memes composants.
   ========================================================= */

.page--course { width: min(640px, calc(100% - 48px)); margin-top: 40px; }

/* Resume de la course : la meme information que le message WhatsApp,
   dans une carte du site. */
.course-card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 28px;
  margin-top: 26px;
}
/* Trajet en frise : chaque point est centre sur la premiere ligne de sa
   valeur, et le trait relie exactement le point de depart a celui
   d'arrivee, quelle que soit la longueur de l'adresse.
   Les hauteurs de ligne sont fixees pour que ces positions se calculent :
   libelle 18px + 4px d'ecart, valeur sur des lignes de 28px. Le centre de
   la premiere ligne tombe donc a 18 + 4 + 14 = 36px. */
.course-route { list-style: none; margin: 0; padding: 0; }
.course-route .stop {
  position: relative;
  padding: 0 0 22px 34px;
}
.course-route .stop:last-child { padding-bottom: 0; }
.course-route .stop::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 29px;              /* 36px - rayon du point (7px) */
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--card);
  z-index: 1;
}
.course-route .stop--end::before { background: var(--gold); }
/* Trait : du bas de ce point jusqu'au haut du point suivant, qui se trouve
   29px sous le debut de l'etape suivante. */
.course-route .stop:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 47px;              /* sous le point, 4px de respiration */
  bottom: -25px;          /* s'arrete 4px au-dessus du point suivant */
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--gold), var(--gold3));
  opacity: 0.55;
}
.course-route .place small {
  display: block;
  margin-bottom: 4px;
  font-family: var(--fs-body);
  font-size: 0.72rem;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver);
}
.course-route .place-value {
  display: block;
  font-family: var(--fs-head);
  font-size: 1.25rem;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--white);
  overflow-wrap: anywhere;
}
/* Adresse complete, plus longue qu'une ville : un cran plus petite, meme
   hauteur de ligne pour garder le point aligne. */
.course-route .place-value--address { font-size: 1.08rem; }
.course-route .place-dept {
  font-family: var(--fs-body);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--silver);
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  color: rgba(240, 242, 248, 0.9);
}
.chip-icon { width: 20px; height: 20px; flex: 0 0 20px; object-fit: contain; }
.chip--gold {
  background: rgba(212, 175, 106, 0.1);
  border-color: rgba(212, 175, 106, 0.35);
  color: var(--gold2);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(212, 175, 106, 0.15);
}
.status-pill--ok { color: var(--green); }
.status-pill--ok::before { box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.15); }
.status-pill--off { color: var(--silver); }
/* Course immediate : le rouge du site, un patient attend deja. */
.status-pill--urgent { color: var(--red); }
.status-pill--urgent::before { box-shadow: 0 0 0 4px rgba(255, 51, 71, 0.18); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 51, 71, 0.06); } }

/* Delai d'approche : pastilles a choix unique, dans le style des champs. */
.eta-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.eta-choice { position: relative; cursor: pointer; }
.eta-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.eta-choice span {
  display: inline-block;
  min-width: 76px;
  text-align: center;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(240, 242, 248, 0.85);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.eta-choice:hover span { border-color: rgba(212, 175, 106, 0.35); }
.eta-choice input:checked + span {
  background: linear-gradient(135deg, var(--gold2) 0%, var(--gold) 100%);
  border-color: var(--gold);
  color: var(--black);
}
.eta-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.3); }
.status-pill--off::before { box-shadow: none; }

/* Formulaire d'acceptation : une seule etape, deux champs. */
.page--course .form-card { margin-top: 18px; padding: 28px; }
.page--course .form-step { margin-bottom: 0; }
.btn-submit--wide { width: 100%; justify-content: center; }

/* Detail revele au chauffeur retenu. */
.detail-grid { display: grid; gap: 18px; }
.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: 4px;
}
.detail-value { font-size: 1.05rem; color: var(--white); }
.detail-value--big {
  font-family: var(--fs-head);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.detail-note {
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 14px 16px;
  font-size: 0.95rem;
  color: rgba(240, 242, 248, 0.85);
}
.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.actions .btn-submit { grid-column: 1 / -1; justify-content: center; }
.actions .btn-ghost { justify-content: center; }

/* Invitation a rejoindre le groupement : meme filet dore que les
   conditions du formulaire partenaire, sans rivaliser avec les actions
   de la course. */
.partner-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  font-size: 0.88rem;
  color: rgba(240, 242, 248, 0.78);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.partner-hint strong { color: var(--white); }
.partner-hint:hover { background: rgba(255, 255, 255, 0.04); border-color: rgba(212, 175, 106, 0.3); }
.partner-hint-cta {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

.loader {
  width: 30px;
  height: 30px;
  margin: 80px auto;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .page--course { width: calc(100% - 36px); margin-top: 28px; }
  .course-card, .page--course .form-card { padding: 22px 18px; }
  .actions { grid-template-columns: 1fr; }
  .partner-hint { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .loader { animation-duration: 2s; }
  .status-pill--urgent::before { animation: none; }
}
