/* D-193 — raccourci hôpitaux (création course) */

.ms-hopital-sheet .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ms-hopital-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.15rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--night, #0A3D4A) 18%, transparent);
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mint, #B8E0D2) 55%, #fff), #fff);
  color: var(--night, #0A3D4A);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(10, 61, 74, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ms-hopital-trigger:hover,
.ms-hopital-trigger:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--night, #0A3D4A) 35%, transparent);
  box-shadow: 0 6px 16px rgba(10, 61, 74, 0.12);
  outline: none;
}

.ms-hopital-trigger[hidden] {
  display: none !important;
}

.ms-hopital-trigger-ico {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 28%, transparent 29%),
    linear-gradient(180deg, var(--night, #0A3D4A), color-mix(in srgb, var(--night, #0A3D4A) 70%, #1a6b7a));
  flex: 0 0 auto;
}

.ms-hopital-sheet[hidden] {
  display: none !important;
}

.ms-hopital-sheet {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ms-hopital-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 28, 34, 0.45);
  backdrop-filter: blur(2px);
  animation: msHopFade 0.2s ease;
}

.ms-hopital-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(78vh, 640px);
  margin: 0;
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -12px 40px rgba(8, 28, 34, 0.22);
  display: flex;
  flex-direction: column;
  animation: msHopUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0.85rem 1rem 1.1rem;
}

@media (min-width: 720px) {
  .ms-hopital-sheet {
    align-items: center;
  }

  .ms-hopital-panel {
    border-radius: 22px;
    max-height: min(70vh, 620px);
  }
}

.ms-hopital-grab {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--night, #0A3D4A) 18%, transparent);
  margin: 0.15rem auto 0.75rem;
}

.ms-hopital-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ms-hopital-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--night, #0A3D4A);
}

.ms-hopital-head p {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: color-mix(in srgb, var(--night, #0A3D4A) 65%, #6a8a90);
}

.ms-hopital-close {
  border: 0;
  background: color-mix(in srgb, var(--night, #0A3D4A) 8%, #fff);
  color: var(--night, #0A3D4A);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.ms-hopital-close:focus-visible {
  outline: 2px solid var(--night, #0A3D4A);
  outline-offset: 2px;
}

.ms-hopital-search {
  margin-bottom: 0.65rem;
}

.ms-hopital-search input {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--night, #0A3D4A) 16%, transparent);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: color-mix(in srgb, var(--mint, #B8E0D2) 18%, #fff);
}

.ms-hopital-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--night, #0A3D4A) 35%, transparent);
  outline-offset: 1px;
}

.ms-hopital-list {
  overflow: auto;
  display: grid;
  gap: 0.55rem;
  padding: 0.15rem 0.1rem 0.35rem;
  margin: 0;
  list-style: none;
}

.ms-hopital-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--night, #0A3D4A) 12%, transparent);
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ms-hopital-card:hover,
.ms-hopital-card:focus-visible {
  border-color: color-mix(in srgb, var(--night, #0A3D4A) 40%, transparent);
  background: color-mix(in srgb, var(--mint, #B8E0D2) 22%, #fff);
  box-shadow: 0 8px 20px rgba(10, 61, 74, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.ms-hopital-card.is-selected {
  border-color: var(--night, #0A3D4A);
  background: color-mix(in srgb, var(--mint, #B8E0D2) 35%, #fff);
}

.ms-hopital-card-ico {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--mint, #B8E0D2) 80%, #fff), #fff),
    var(--night, #0A3D4A);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--night, #0A3D4A) 12%, transparent);
  position: relative;
}

.ms-hopital-card-ico::after {
  content: "";
  position: absolute;
  inset: 28% 36% 22% 36%;
  border: 2px solid var(--night, #0A3D4A);
  border-radius: 3px 3px 2px 2px;
  border-top-width: 3px;
}

.ms-hopital-card-body strong {
  display: block;
  font-size: 0.98rem;
  color: var(--night, #0A3D4A);
}

.ms-hopital-card-body span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--night, #0A3D4A) 62%, #6a8a90);
  line-height: 1.35;
}

.ms-hopital-card-go {
  color: var(--night, #0A3D4A);
  font-size: 1.25rem;
  opacity: 0.55;
}

.ms-hopital-empty {
  margin: 0.5rem 0;
  padding: 1rem;
  text-align: center;
  color: color-mix(in srgb, var(--night, #0A3D4A) 65%, #6a8a90);
  font-size: 0.92rem;
}

@keyframes msHopFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes msHopUp {
  from { transform: translateY(18px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ms-hopital-trigger,
  .ms-hopital-card,
  .ms-hopital-backdrop,
  .ms-hopital-panel {
    animation: none !important;
    transition: none !important;
  }
}
