/* Ecrans : connexion, armoire, fiche, ajout, formulaire, chat, profil. */

/* ---------- connexion ---------- */

.connexion {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.connexion__carte {
  width: 100%;
  max-width: 25rem;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.connexion__logo {
  border-radius: 22px;
  box-shadow: var(--ombre);
}

.connexion__titre {
  margin-top: 6px;
  font-size: 1.85rem;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.connexion__sous {
  max-width: 21rem;
  color: var(--doux);
}

.connexion__formulaire {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--bord);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--ombre);
  text-align: left;
}

.connexion__formulaire .champ {
  margin-bottom: 0;
}

.connexion__message:empty {
  display: none;
}

.connexion__message .bandeau {
  margin-bottom: 0;
}

/* ---------- armoire ---------- */

.recherche {
  position: relative;
  margin-bottom: 12px;
}

.recherche__icone {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--doux);
  pointer-events: none;
}

.saisie--recherche {
  padding-left: 2.6rem;
  border-radius: 14px;
}

.filtres {
  display: flex;
  gap: 8px;
  margin: 0 -16px 16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.filtres::-webkit-scrollbar {
  display: none;
}

@media (min-width: 700px) {
  .filtres {
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 0;
    overflow: visible;
  }
}

/* ---------- fiche ---------- */

.fiche__photo {
  display: grid;
  place-items: center;
  margin: 0 0 16px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--ombre);
}

.fiche__photo img {
  display: block;
  width: 100%;
  max-height: 20rem;
  object-fit: contain;
}

.fiche__photo--vide {
  height: 9rem;
  background: var(--accent-fond);
  color: var(--accent);
}

.fiche__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.fiche__section {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--surface);
  display: grid;
  gap: 10px;
}

.fiche__titre-section {
  font-size: 1.05rem;
  font-weight: 720;
}

.fiche__texte {
  overflow-wrap: anywhere;
}

.fiche__texte--notes {
  white-space: pre-wrap;
}

.fiche__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.boites__liste {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.boite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 6px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.boite__infos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.boite__detail {
  color: var(--doux);
  font-size: 0.88rem;
}

.nouvelle-boite {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--bord);
}

/* ---------- ajout : photos ---------- */

.ajout {
  display: grid;
  gap: 14px;
}

.ajout__titre {
  font-size: 1.3rem;
  font-weight: 740;
}

.ajout__actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.ajout__note {
  text-align: center;
  font-size: 0.9rem;
}

.ajout--attente {
  justify-items: center;
  padding: 24px 0;
  text-align: center;
}

.ajout__vignettes {
  display: flex;
  gap: 8px;
}

.ajout__vignettes img {
  width: 72px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
}

.tuiles-photo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tuile-photo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding-top: 24%;
  aspect-ratio: 3 / 4;
  padding: 24% 8px 8px;
  overflow: hidden;
  border: 2px dashed var(--bord);
  border-radius: 16px;
  background: var(--surface);
  color: var(--accent);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 120ms ease-out, border-color 150ms ease-out;
}

.tuile-photo:active {
  transform: scale(0.97);
}

.tuile-photo__titre {
  font-size: 0.92rem;
  font-weight: 700;
}

.tuile-photo__aide {
  color: var(--doux);
  font-size: 0.75rem;
  line-height: 1.25;
}

.tuile-photo--remplie {
  padding: 0;
  border-style: solid;
  border-color: var(--bord);
  cursor: default;
}

.tuile-photo--remplie:active {
  transform: none;
}

.tuile-photo--erreur {
  border-color: var(--perime);
}

.tuile-photo--remplie img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tuile-photo__voile {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

.tuile-photo__voile--erreur {
  background: rgba(150, 25, 20, 0.92);
}

.tuile-photo__retirer {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
}

.tuile-photo__retirer .icone {
  padding: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

/* ---------- formulaire d'un medicament ---------- */

.formulaire {
  display: grid;
  gap: 14px;
}

.formulaire__bloc {
  padding: 16px 16px 4px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--surface);
}

.formulaire__titre {
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 720;
}

.formulaire__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 4px;
  padding: 14px 0 6px;
  background: linear-gradient(to bottom, transparent, var(--fond) 28%);
}

.photo-champ {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.photo-champ__image {
  width: 96px;
  height: 128px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-2);
}

.photo-champ__image--vide {
  display: grid;
  place-items: center;
  color: var(--doux);
}

.photo-champ__actions {
  display: grid;
  gap: 6px;
  justify-items: start;
}

/* ---------- chat ---------- */

.vue--plein > .chat {
  flex: 1;
  min-height: 0;
}

.chat {
  display: flex;
  flex-direction: column;
}

.chat .entete {
  flex: none;
  margin-bottom: 10px;
}

.chat .entete__titre {
  white-space: nowrap;
}

.chat__fil {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.bulle {
  max-width: min(100%, 36rem);
  padding: 12px 16px;
  border-radius: 20px;
  overflow-wrap: anywhere;
  animation: apparition 180ms ease-out;
}

.bulle--assistant {
  align-self: flex-start;
  border: 1px solid var(--bord);
  border-bottom-left-radius: 6px;
  background: var(--surface);
  box-shadow: var(--ombre);
}

.bulle--moi {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--accent);
  color: var(--accent-sur);
  user-select: text;
}

.bulle--accueil {
  background: var(--accent-fond);
  border-color: transparent;
  box-shadow: none;
}

.bulle--attente {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--doux);
}

.points {
  display: inline-flex;
  gap: 4px;
}

.points i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: souffle 1.2s ease-in-out infinite;
}

.points i:nth-child(2) {
  animation-delay: 0.15s;
}

.points i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes souffle {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .points i {
    animation: none !important;
    opacity: 0.6;
  }
}

.texte-riche {
  display: grid;
  gap: 8px;
}

.texte-riche ul,
.texte-riche ol {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 4px;
}

.bulle__mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
}

.bulle__note {
  color: var(--doux);
  font-size: 0.82rem;
}

.bulle__cartes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.bulle__legende {
  color: var(--doux);
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat__suggestions {
  align-self: flex-start;
}

.alerte-urgence {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--urgence);
  color: #fff;
}

.alerte-urgence__texte {
  display: grid;
  gap: 2px;
  font-size: 0.92rem;
}

.alerte-urgence__texte strong {
  font-size: 1.1rem;
}

.alerte-urgence__appel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 12px;
  background: #fff;
  color: #9a1b14;
  font-weight: 750;
  text-decoration: none;
  touch-action: manipulation;
}

.alerte-urgence__appel--second {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.chat__bas {
  flex: none;
  padding: 8px 0 10px;
  background: var(--fond);
}

.chat__saisie {
  display: flex;
  gap: 8px;
}

.chat__champ {
  flex: 1;
  border-radius: 24px;
  padding-left: 1.1rem;
}

.chat__envoi {
  width: 48px;
  height: 48px;
}

.chat__mention {
  margin-top: 8px;
  color: var(--doux);
  font-size: 0.78rem;
  text-align: center;
}

/* ---------- profil ---------- */

.reglage {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 18px 16px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--surface);
}

.reglage .champ {
  margin-bottom: 4px;
}

.reglage .bandeau {
  margin-bottom: 0;
}

.reglage__titre {
  font-size: 1.1rem;
  font-weight: 730;
}

.reglage__sous {
  margin-bottom: 6px;
  font-size: 0.98rem;
  font-weight: 700;
}

.reglage__corps {
  display: grid;
  gap: 12px;
}

.reglage__corps:empty {
  display: none;
}

.reglage__boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reglage > .bouton {
  justify-self: start;
}

.etapes {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 8px;
}
