/* =========================================================
   File Upload — drop-zone pour le formulaire de contact
   Drag & drop + clic, multi-fichiers (5 max), aperçus
========================================================= */

.upload-zone {
  grid-column: 1 / -1;
  position: relative;
  border: 2px dashed rgba(149, 86, 255, 0.32);
  border-radius: 16px;
  padding: 22px 20px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: rgba(162, 112, 255, 0.65);
  background: rgba(123, 47, 190, 0.07);
}

/* Le label rempli toute la zone et déclenche le picker au clic */
.upload-zone__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  padding: 8px 0;
}

.upload-zone__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(149, 86, 255, 0.16);
  color: #c8a0ff;
  margin-bottom: 4px;
}

.upload-zone__icon svg {
  width: 22px;
  height: 22px;
}

.upload-zone__title {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 500;
}

.upload-zone__title strong {
  color: #c8a0ff;
  font-weight: 700;
}

.upload-zone__hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Compteur (X / 5 fichiers — Y MB) */
.upload-zone__counter {
  margin-top: 10px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

.upload-zone__counter:empty {
  display: none;
}

/* Liste des fichiers ajoutés */
.upload-zone__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 10px;
}

.upload-zone__list:empty {
  display: none;
}

.upload-zone__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(149, 86, 255, 0.22);
}

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

.upload-zone__file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.6rem;
  background: linear-gradient(135deg, rgba(123, 47, 190, 0.22), rgba(45, 125, 255, 0.1));
  color: #c8a0ff;
}

.upload-zone__filename {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 4px 6px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8));
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.upload-zone__remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease;
}

.upload-zone__remove:hover,
.upload-zone__remove:focus-visible {
  background: rgba(220, 38, 38, 0.9);
  outline: none;
}

/* Message d'erreur (taille, format refusé, etc.) */
.upload-zone__error {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 80, 110, 0.08);
  border: 1px solid rgba(255, 80, 110, 0.3);
  color: #ff9cba;
  font-size: 0.88rem;
  line-height: 1.4;
  min-height: auto;
}

.upload-zone__error:empty {
  display: none;
}

/* Honeypot anti-bot : invisible visuellement et au lecteur d'écran */
.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Reduced motion : pas de transition */
@media (prefers-reduced-motion: reduce) {
  .upload-zone,
  .upload-zone__remove {
    transition: none !important;
  }
}
