/* ============================================================
   css/pieces-jointes.css
   Photos et message vocal joints a une demande de devis.
   Partagee par le site (theme clair) et la demo B (theme sombre).

   AUCUNE couleur ici : chaque theme definit les --pj-* dans son :root
   (css/styles.css pour le clair, demo/B/toinett.css pour le sombre).
   ============================================================ */

.pj {
  min-width: 0;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px dashed var(--pj-bordure);
  border-radius: var(--pj-rayon);
  background: var(--pj-fond);
}

/* Les blocs en display:flex ignoreraient l'attribut hidden sinon. */
.pj [hidden] { display: none !important; }

.pj legend {
  padding: 0 6px;
  font-weight: 700;
  color: var(--pj-texte);
}

.pj-facultatif { font-weight: 400; color: var(--pj-doux); }

.pj-bloc + .pj-bloc {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--pj-bordure);
}

.pj label,
.pj-titre {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pj-texte);
}

.pj .pj-label-fichier {
  margin-top: 12px;
  font-weight: 400;
  color: var(--pj-doux);
}

.pj input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--pj-texte);
}

.pj input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 14px;
  border: 1px solid var(--pj-bordure);
  border-radius: var(--pj-rayon);
  background: transparent;
  color: var(--pj-texte);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pj-aide {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--pj-doux);
}

.pj-apercu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.pj-apercu li {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--pj-rayon);
}

.pj-apercu img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pj-retirer {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--pj-accent);
  color: var(--pj-sur-accent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pj-micro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.pj-enreg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--pj-accent);
  color: var(--pj-sur-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pj-point {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.pj-en-cours .pj-point { animation: pj-pulse 1s ease-in-out infinite; }

@keyframes pj-pulse { 50% { opacity: 0.25; } }

.pj-duree {
  font-variant-numeric: tabular-nums;
  color: var(--pj-doux);
}

.pj-en-cours .pj-duree { font-weight: 700; color: var(--pj-texte); }

.pj-lecture {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.pj-suppr-audio {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pj-lien);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.pj-alerte {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--pj-accent);
  background: var(--pj-alerte-fond);
  color: var(--pj-texte);
  font-size: 14px;
}

.pj button:focus-visible,
.pj input[type="file"]:focus-visible {
  outline: 3px solid var(--pj-lien);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pj-en-cours .pj-point { animation: none; }
}
