/* ==========================================================================
   Dépôt par zones (templates/_depot_zones.html + static/depot-zones.js).
   Partagé par « Mes documents » (portail, fond bleu nuit) et l'étape
   « Documents » du dossier candidat (page autonome, sans accueil.css).

   Charte : fonds OPAQUES (la trame animée ne passe jamais sous un texte),
   aucune barre colorée à gauche, un état = une puce sobre (contour + texte).
   Deux rayons : 16 px (zone) et 8 px (contrôle).

   Spécificité : la page candidat habille tous ses champs avec
   `.candidature-page input:not([type=checkbox])` et `select` (0,2,1). Les
   sélecteurs de champ ci-dessous pèsent (0,3,0) pour l'emporter partout.
   ========================================================================== */

.depot { margin: 0 0 24px; }

.depot-zones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.depot-zones--4,
.depot-zones--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.depot-zones--1 { grid-template-columns: minmax(0, 1fr); }

.depot-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 210px;
  padding: 22px 22px 18px;
  border: 1.5px dashed color-mix(in srgb, var(--turquoise-sur-sombre) 45%, transparent);
  border-radius: 16px;
  background: var(--surface-sombre-mate);
  color: var(--blanc);
  cursor: pointer;
  transition: border-color var(--t-court) var(--ease-out),
              background-color var(--t-court) var(--ease-out);
}
.depot-zone:hover,
.depot-zone--survol,
.depot-zone--visee {
  border-color: var(--turquoise-sur-sombre);
  background: var(--surface-sombre-mate-haute);
}
.depot-zone:has(.depot-zone-fichier:focus-visible) {
  outline: var(--focus-contour);
  outline-offset: var(--focus-decalage);
}

.depot-zone-icone {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  fill: none;
  stroke: var(--turquoise-sur-sombre);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.depot-zone-titre { font-size: 1.08rem; font-weight: 600; }
.depot-zone-texte { font-size: .88rem; line-height: 1.5; color: var(--muted-sur-sombre); }
.depot-zone-auto {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-sur-sombre);
}

/* Champ fichier : présent et focalisable, invisible. */
.depot-zone .depot-zone-fichier[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Le libellé couvre toute la zone (::after) : un clic n'importe où ouvre le
   sélecteur de fichiers. La liste des envois passe au-dessus, ses
   sélecteurs de type restent cliquables. */
.depot-zone-action {
  margin-top: auto;
  padding-top: 14px;
  font-size: .86rem;
  color: var(--muted-sur-sombre);
  cursor: pointer;
}
.depot-zone-action::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
}
.depot-zone-lien {
  color: var(--turquoise-sur-sombre);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Fichiers ajoutés ---------------------------------------------------- */
.depot-envois {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  cursor: default;
}
.depot-envois[hidden] { display: none; }
.depot-envoi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  font-size: .82rem;
}
.depot-envoi-nom { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.depot-envoi-etat { font-size: .78rem; color: var(--muted-sur-sombre); white-space: nowrap; }
.depot-envoi[data-etat="envoi"] .depot-envoi-etat,
.depot-envoi[data-etat="ok"] .depot-envoi-etat { color: var(--turquoise-sur-sombre); }
.depot-envoi[data-etat="type"] .depot-envoi-etat { color: var(--or-sur-sombre); }
.depot-envoi-erreur {
  grid-column: 1 / -1;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--rouge-sur-sombre);
}
.depot-envoi-erreur:empty { display: none; }
.depot-envoi-barre {
  grid-column: 1 / -1;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, var(--blanc) 12%, var(--surface-sombre-mate));
}
.depot-envoi-barre[hidden] { display: none; }
.depot-envoi-barre i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--turquoise-sur-sombre);
  transition: width var(--t-court) var(--ease-out);
}

.depot-zone .depot-envoi .depot-envoi-type {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--blanc) 22%, transparent);
  border-radius: 8px;
  background: var(--surface-sombre-mate-haute);
  color: var(--blanc);
  color-scheme: dark;
  font: inherit;
  font-size: .8rem;
}
.depot-zone .depot-envoi .depot-envoi-type:disabled { opacity: .7; }

.depot-annonce {
  margin: 10px 0 0;
  font-size: .84rem;
  color: var(--muted-sur-sombre);
}
.depot-annonce:empty { display: none; }

/* --- Puce d'état et boutons, partagés par les listes de la page ---------- */
.depot-etat {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--blanc) 22%, transparent);
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--muted-sur-sombre);
}
.depot-etat--ok { color: var(--turquoise-sur-sombre); border-color: color-mix(in srgb, var(--turquoise-sur-sombre) 45%, transparent); }
.depot-etat--ko { color: var(--rouge-sur-sombre); border-color: color-mix(in srgb, var(--rouge-sur-sombre) 45%, transparent); }
.depot-etat--attente { color: var(--or-sur-sombre); border-color: color-mix(in srgb, var(--or-sur-sombre) 45%, transparent); }

.depot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--turquoise-sur-sombre) 50%, transparent);
  border-radius: 8px;
  background: var(--surface-sombre-mate);
  color: var(--turquoise-sur-sombre);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-court) var(--ease-out),
              border-color var(--t-court) var(--ease-out);
}
.depot-btn:hover { border-color: var(--turquoise-sur-sombre); background: var(--surface-sombre-mate-haute); }
.depot-btn--plein { border-color: var(--turquoise); background: var(--turquoise); color: var(--blanc); }
.depot-btn--plein:hover { border-color: var(--turquoise-fonce); background: var(--turquoise-fonce); }
.depot-btn:focus-visible { outline: var(--focus-contour); outline-offset: var(--focus-decalage); }

@media (max-width: 760px) {
  .depot-zones,
  .depot-zones--2,
  .depot-zones--4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .depot-zone { min-height: 0; padding: 18px; }
  .depot-zone-icone { width: 28px; height: 28px; margin-bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .depot-zone,
  .depot-btn,
  .depot-envoi-barre i { transition: none; }
}
