/* ============================================================
   BioDrive — illustrations, animations and their states
   One illustration family everywhere (tools/illustrations/,
   Images/animations/ASSETS.md): Lottie animations through
   Js/bd-anim.js, and their still SVG frames for spot
   illustrations and empty states.
   ============================================================ */

/* ---- The animation component (Js/bd-anim.js) ----------------- */
.bd-anim {
  display: block;
  position: relative;
  width: var(--bd-anim-w, 150px);
  max-width: 100%;
  margin-inline: auto;
}
.bd-anim--sm { --bd-anim-w: 96px; }
.bd-anim--md { --bd-anim-w: 150px; }
.bd-anim--lg { --bd-anim-w: 220px; }

.bd-anim__poster {
  display: block;
  width: 100%;
  height: auto;
}
.bd-anim__stage {
  width: 100%;
  height: 100%;
}
.bd-anim__stage svg { display: block; }

/* ---- Empty states ------------------------------------------------
   Every .empty-state gets a small illustration above its sentence,
   chosen by modifier; the sentence and any action button stay the
   actual message. --animated: the state carries its own .bd-anim. */
.empty-state::before {
  content: '';
  display: block;
  width: 120px;
  height: 90px;
  margin: 0 auto 12px;
  background: url('/Images/illustrations/all-clear.svg') center / contain no-repeat;
}
.empty-state--deliveries::before { background-image: url('/Images/illustrations/empty-box.svg'); }
.empty-state--patients::before { background-image: url('/Images/illustrations/empty-people.svg'); }
.empty-state--notifications::before { background-image: url('/Images/illustrations/empty-bell.svg'); }
.empty-state--route::before { background-image: url('/Images/illustrations/route-map.svg'); }
.empty-state--reports::before { background-image: url('/Images/illustrations/reports-chart.svg'); }
.empty-state--error::before { background-image: url('/Images/illustrations/error-cloud.svg'); }
.empty-state--animated::before { display: none; }

/* Dark theme: the same pictures with light outlines (<name>.dark.svg) —
   with no backdrop behind the art, dark lines would vanish on a dark page. */
:root[data-theme="dark"] .empty-state::before { background-image: url('/Images/illustrations/all-clear.dark.svg'); }
:root[data-theme="dark"] .empty-state--deliveries::before { background-image: url('/Images/illustrations/empty-box.dark.svg'); }
:root[data-theme="dark"] .empty-state--patients::before { background-image: url('/Images/illustrations/empty-people.dark.svg'); }
:root[data-theme="dark"] .empty-state--notifications::before { background-image: url('/Images/illustrations/empty-bell.dark.svg'); }
:root[data-theme="dark"] .empty-state--route::before { background-image: url('/Images/illustrations/route-map.dark.svg'); }
:root[data-theme="dark"] .empty-state--reports::before { background-image: url('/Images/illustrations/reports-chart.dark.svg'); }
:root[data-theme="dark"] .empty-state--error::before { background-image: url('/Images/illustrations/error-cloud.dark.svg'); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .empty-state::before { background-image: url('/Images/illustrations/all-clear.dark.svg'); }
  :root:not([data-theme="light"]) .empty-state--deliveries::before { background-image: url('/Images/illustrations/empty-box.dark.svg'); }
  :root:not([data-theme="light"]) .empty-state--patients::before { background-image: url('/Images/illustrations/empty-people.dark.svg'); }
  :root:not([data-theme="light"]) .empty-state--notifications::before { background-image: url('/Images/illustrations/empty-bell.dark.svg'); }
  :root:not([data-theme="light"]) .empty-state--route::before { background-image: url('/Images/illustrations/route-map.dark.svg'); }
  :root:not([data-theme="light"]) .empty-state--reports::before { background-image: url('/Images/illustrations/reports-chart.dark.svg'); }
  :root:not([data-theme="light"]) .empty-state--error::before { background-image: url('/Images/illustrations/error-cloud.dark.svg'); }
}

/* Inside a table row or a narrow list, keep it compact. */
td .empty-state::before,
.empty-state--compact::before {
  width: 84px;
  height: 63px;
  margin-bottom: 8px;
}
td .empty-state { padding-block: 22px; }

.empty-state .bd-anim { margin-bottom: 10px; }
.empty-state__title {
  display: block;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 2px;
}
.empty-state__action { margin-top: 14px; }

@media (max-width: 420px) {
  .empty-state::before { width: 96px; height: 72px; }
  td .empty-state::before, .empty-state--compact::before { width: 72px; height: 54px; }
}

/* ---- Loading: a small tumbling capsule instead of a bare spinner -- */
.loading-indicator::before {
  width: 22px;
  height: 10px;
  margin-right: 10px;
  vertical-align: -1px;
  border: 2px solid var(--g-700);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--g-600) 50%, var(--surface) 50%);
  animation: bd-pill-tumble 1.1s ease-in-out infinite;
}
@keyframes bd-pill-tumble {
  0% { transform: rotate(0deg); }
  45%, 55% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Auth pages: one still spot illustration above the form ------- */
.auth-illustration {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
  margin: -6px auto 18px;
}
@media (max-width: 420px) {
  .auth-illustration { max-width: 150px; margin-bottom: 12px; }
}
/* Never push the form off a short screen (landscape phones). */
@media (max-height: 620px) {
  .auth-illustration { display: none; }
}

/* ---- Verification page --------------------------------------------- */
.verify-art {
  margin: -8px auto 8px;
  min-height: 1px;
}
@media (max-height: 620px) {
  .verify-art { display: none; }
}

/* ---- Inline icon used inside text/buttons (Lucide, see sprite) ----- */
.bd-inline-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- "On its way" strip above a list of moving deliveries (GP) ----- */
.delivery-tracker[hidden] { display: none; }
.delivery-tracker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--grey-200);
  background: var(--g-50);
}
.delivery-tracker__anim { width: 120px; margin: 0; flex-shrink: 0; }
.delivery-tracker__text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--g-700);
}
@media (max-width: 480px) {
  .delivery-tracker__anim { width: 88px; }
}

/* ---- Patient order tracking: where the parcel is, in picture + words -- */
.track-scene {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--grey-200);
}
.track-scene__img { display: block; width: 150px; height: auto; margin: 0 auto; }
.track-scene__text {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}
