/* ═══════════════════════════════════════════════════════════════════════════
   IMOVI+ · Dépôt de fichiers (photos, vidéos, documents) — tout le site
   Fichier : assets/css/depot.css · comportement : assets/js/depot.js
   Chargé par partials/depot.php (via partials/selecteur.php, présent dans
   chaque coque : public, espaces, administration, apporteurs, conversation).
   ─────────────────────────────────────────────────────────────────────────────
   1. Le composant : tout <input type="file"> natif devient une zone de dépôt
      (pastille cuivre, glisser-déposer, aperçu, retrait). Le champ d'origine
      reste le champ envoyé : le serveur ne voit aucune différence.
   2. L'harmonie : les dépôts faits main (inscription, KYC, annonce, photos de
      véhicule, dossier apporteur, pièces jointes du chat) reçoivent la même
      écriture — mêmes pastilles, mêmes survols, mêmes couleurs.
   Monde IMOVI+ : ivoire, encre, sable ; accent cuivre (orange brûlé dans
   l'administration, via --idep-accent).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --idep-accent: #9A5E24;
  --idep-accent-2: #C68A4A;
  --idep-encre: #1A1612;
  --idep-texte-2: #5E5850;
  --idep-texte-3: #6B655D;
  --idep-fond: #FFFDF9;
  --idep-fond-2: #F8F1E6;
  --idep-ligne: #DCCDB6;
  --idep-erreur: #B3391F;
  --idep-succes: #1B6E53;
  --idep-police: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --idep-ombre: 0 1px 2px rgba(26, 22, 18, .05), 0 12px 28px -18px rgba(26, 22, 18, .32);
}
body.ad-body { --idep-accent: #A4471A; --idep-accent-2: #D0763F; }

/* ══ 1. LE COMPOSANT ═══════════════════════════════════════════════════════ */
.idep { position: relative; width: 100%; min-width: 0; font-family: var(--idep-police); color: var(--idep-encre); }
.idep *, .idep *::before, .idep *::after { box-sizing: border-box; }

.idep-zone {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  min-height: 92px; padding: 18px 20px;
  border: 1.5px dashed var(--idep-ligne); border-radius: 18px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(198, 138, 74, .10), transparent 55%),
    linear-gradient(180deg, var(--idep-fond), var(--idep-fond-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: border-color .22s, box-shadow .22s, background .22s, transform .22s;
}
/* Le vrai champ couvre la zone : un clic ouvre le sélecteur de fichiers, un
   fichier lâché dessus est reçu par le navigateur lui-même. */
.idep-zone > input[type=file] {
  position: absolute !important; inset: 0 !important; z-index: 3;
  width: 100% !important; height: 100% !important; margin: 0 !important; padding: 0 !important;
  opacity: 0 !important; cursor: pointer; font-size: 0 !important;
  border: 0 !important; background: none !important; box-shadow: none !important;
}
.idep-zone:hover { border-color: color-mix(in srgb, var(--idep-accent) 55%, var(--idep-ligne)); box-shadow: var(--idep-ombre); }
.idep:focus-within .idep-zone { border-color: var(--idep-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--idep-accent) 18%, transparent); }
.idep.idep-survol .idep-zone {
  border-style: solid; border-color: var(--idep-accent); transform: scale(1.005);
  background: radial-gradient(90% 120% at 50% 0%, color-mix(in srgb, var(--idep-accent-2) 22%, transparent), transparent 70%), var(--idep-fond);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--idep-accent) 14%, transparent), var(--idep-ombre);
}

/* La pastille : cuivre plein, halo doux, l'icône change avec le type attendu. */
.idep-pastille {
  position: relative; flex: 0 0 auto; display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%; color: #fff;
  background: linear-gradient(145deg, var(--idep-accent-2), var(--idep-accent) 72%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--idep-accent-2) 16%, transparent), 0 12px 22px -10px color-mix(in srgb, var(--idep-accent) 75%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s;
}
.idep-pastille svg { width: 24px; height: 24px; }
.idep-zone:hover .idep-pastille, .idep.idep-survol .idep-pastille { transform: translateY(-2px) rotate(-4deg); }
.idep.idep-survol .idep-pastille { animation: idep-pouls 1.1s ease-in-out infinite; }
@keyframes idep-pouls { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--idep-accent-2) 10%, transparent), 0 12px 22px -10px color-mix(in srgb, var(--idep-accent) 75%, transparent); } }

.idep-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.idep-titre { font-size: 15px; font-weight: 650; line-height: 1.3; letter-spacing: -.005em; color: var(--idep-encre); }
.idep-sous { font-size: 13.5px; color: var(--idep-texte-2); }
.idep-sous b { font-weight: 650; color: var(--idep-accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.idep-meta { font-size: 12px; color: var(--idep-texte-3); letter-spacing: .01em; }

.idep-bouton {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  background: var(--idep-encre); color: #FAF6F0; font-size: 13.5px; font-weight: 650; white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(26, 22, 18, .7);
  transition: transform .2s, background .2s;
}
.idep-bouton svg { width: 16px; height: 16px; }
.idep-zone:hover .idep-bouton { transform: translateY(-1px); background: #2B2620; }

/* Fichiers choisis */
.idep-liste { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.idep-liste:empty { display: none; }
.idep-fichier {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px;
  background: #fff; border: 1px solid rgba(26, 22, 18, .09); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(26, 22, 18, .04);
  animation: idep-entree .32s cubic-bezier(.22, .61, .36, 1);
}
@keyframes idep-entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.idep-vignette {
  position: relative; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: var(--idep-fond-2); color: var(--idep-accent);
}
.idep-vignette img, .idep-vignette video { width: 100%; height: 100%; object-fit: cover; display: block; }
.idep-vignette .idep-lecture { position: absolute; inset: auto 4px 4px auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(26, 22, 18, .72); color: #fff; }
.idep-vignette .idep-lecture svg { width: 10px; height: 10px; }
.idep-ext { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #fff; background: var(--idep-encre); border-radius: 6px; padding: 3px 6px; }
.idep-ext.pdf { background: #8F2D18; }
.idep-infos { flex: 1 1 auto; min-width: 0; }
.idep-nom { display: block; font-size: 13.5px; font-weight: 600; color: var(--idep-encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idep-poids { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--idep-texte-3); margin-top: 2px; }
.idep-poids .idep-ok { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--idep-succes) 14%, #fff); color: var(--idep-succes); }
.idep-poids .idep-ok svg { width: 10px; height: 10px; }
.idep-retirer {
  flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(26, 22, 18, .12); background: #fff; color: var(--idep-texte-2); cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.idep-retirer svg { width: 14px; height: 14px; }
.idep-retirer:hover { background: #FDF3F0; border-color: #EFC9BE; color: var(--idep-erreur); transform: rotate(90deg); }
.idep-retirer:focus-visible { outline: 2px solid var(--idep-accent); outline-offset: 2px; }
.idep-erreur { display: none; margin: 8px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--idep-erreur); }
.idep.idep-en-erreur .idep-erreur { display: block; }
.idep.idep-en-erreur .idep-zone { border-color: var(--idep-erreur); }

/* Un fichier choisi : la zone se fait discrète, le fichier prend la place. */
.idep.idep-rempli:not(.idep-multiple) .idep-zone { min-height: 0; padding: 12px 16px; border-style: solid; border-color: rgba(26, 22, 18, .1); }
.idep.idep-rempli:not(.idep-multiple) .idep-pastille { width: 38px; height: 38px; box-shadow: none; }
.idep.idep-rempli:not(.idep-multiple) .idep-pastille svg { width: 17px; height: 17px; }
.idep.idep-rempli:not(.idep-multiple) .idep-titre { font-size: 14px; }
.idep.idep-rempli:not(.idep-multiple) .idep-meta { display: none !important; }

/* Place étroite (pièce jointe d'un message, cellule de tableau, téléphone) :
   une ligne élégante plutôt qu'une grande zone. La largeur est MESURÉE par
   depot.js (classes idep-etroit / idep-tres-etroit) : une requête de conteneur
   ferait tomber à zéro la largeur d'une cellule qui s'ajuste à son contenu. */
.idep.idep-etroit .idep-zone { min-height: 0; gap: 12px; padding: 12px 14px; border-radius: 14px; }
.idep.idep-etroit .idep-pastille { width: 40px; height: 40px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--idep-accent-2) 14%, transparent); }
.idep.idep-etroit .idep-pastille svg { width: 18px; height: 18px; }
.idep.idep-etroit .idep-titre { font-size: 14px; }
.idep.idep-etroit .idep-sous { font-size: 12.5px; }
.idep.idep-etroit .idep-meta, .idep.idep-etroit .idep-bouton { display: none; }
.idep.idep-tres-etroit .idep-sous { display: none; }
.idep.idep-tres-etroit .idep-zone { padding: 10px; gap: 10px; }
.idep.idep-compact .idep-zone { min-height: 0; padding: 10px 12px; gap: 10px; border-radius: 14px; }
.idep.idep-compact .idep-pastille { width: 36px; height: 36px; box-shadow: none; }
.idep.idep-compact .idep-pastille svg { width: 16px; height: 16px; }
.idep.idep-compact .idep-meta, .idep.idep-compact .idep-bouton { display: none; }

@media (prefers-reduced-motion: reduce) {
  .idep-zone, .idep-pastille, .idep-bouton, .idep-retirer { transition: none; }
  .idep.idep-survol .idep-pastille, .idep-fichier { animation: none; }
}

/* ══ 2. L'HARMONIE DES DÉPÔTS FAITS MAIN ═══════════════════════════════════ */

/* — Pastille commune pour les icônes de dépôt existantes — */
html .fb-depot > i, html .dropzone.mv-depot .dz-message i, html .dropzone.mv-depot .dz-message .fas,
html .ins-apercu > span > i {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 50%;
  font-size: 22px !important; color: #fff !important;
  background: linear-gradient(145deg, var(--idep-accent-2), var(--idep-accent) 72%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--idep-accent-2) 16%, transparent), 0 12px 22px -10px color-mix(in srgb, var(--idep-accent) 75%, transparent);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

/* — Zones de dépôt : annonces (formulaire-bien) et photos de véhicule (Dropzone) — */
html .fb-depot, html .dropzone.mv-depot {
  border: 1.5px dashed var(--idep-ligne) !important; border-radius: 18px !important;
  background: radial-gradient(120% 140% at 0% 0%, rgba(198, 138, 74, .10), transparent 55%), linear-gradient(180deg, var(--idep-fond), var(--idep-fond-2)) !important;
  transition: border-color .22s, box-shadow .22s, transform .22s;
}
html .fb-depot:hover, html .fb-depot.survol, html .dropzone.mv-depot:hover, html .dropzone.mv-depot.dz-drag-hover {
  border-color: var(--idep-accent) !important; box-shadow: 0 0 0 5px color-mix(in srgb, var(--idep-accent) 12%, transparent), var(--idep-ombre);
}
html .fb-depot:hover > i, html .fb-depot.survol > i, html .dropzone.mv-depot:hover .dz-message i { transform: translateY(-2px) rotate(-4deg); }
html .fb-depot strong, html .dropzone.mv-depot .dz-message strong, html .dropzone.mv-depot .dz-message b { font-weight: 650; color: var(--idep-encre); }

/* — Inscription : cadre d'aperçu et boutons en pilules — */
html .ins-depot { border-radius: 18px; }
html .ins-apercu { border: 1.5px dashed var(--idep-ligne); border-radius: 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(198, 138, 74, .10), transparent 55%), linear-gradient(180deg, var(--idep-fond), var(--idep-fond-2)); }
html .ins-depot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
html .ins-depot-actions > label, html .ins-depot-actions > button {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px; white-space: nowrap; font-weight: 650; font-size: 13.5px; cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s, border-color .2s;
}
html .ins-depot-actions > label:first-child { background: var(--idep-encre); color: #FAF6F0; border: 1px solid var(--idep-encre); box-shadow: 0 8px 18px -10px rgba(26, 22, 18, .7); }
html .ins-depot-actions > label:first-child:hover { transform: translateY(-1px); background: #2B2620; }
html .ins-depot-actions > label + label { background: #fff; color: var(--idep-encre); border: 1px solid var(--idep-ligne); }
html .ins-depot-actions > label + label:hover { border-color: var(--idep-accent); color: var(--idep-accent); }
html .ins-depot-actions > label:focus-within { outline: 2px solid var(--idep-accent); outline-offset: 2px; }

/* — KYC propriétaire : tuiles de pièces — */
html .ky-piece { border-radius: 18px; transition: transform .22s, box-shadow .22s, border-color .22s; }
html .ky-piece:hover { transform: translateY(-2px); box-shadow: var(--idep-ombre); border-color: color-mix(in srgb, var(--idep-accent) 45%, transparent); }
html .ky-piece:focus-within { outline: 2px solid var(--idep-accent); outline-offset: 3px; }
html .ky-piece .ky-piece-action { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--idep-encre); color: #FAF6F0; font-size: 12.5px; font-weight: 650; width: max-content; }
html .ky-piece.nouveau .ky-piece-action { background: var(--idep-succes); }

/* — Photo de profil (dialogue) et trombone de la messagerie IMOVI+ — */
html .pp-depot { border-radius: 18px; transition: box-shadow .22s, border-color .22s; }
html .pp-depot:hover { box-shadow: 0 0 0 5px color-mix(in srgb, var(--idep-accent) 12%, transparent); }
html .im-joindre { transition: transform .2s, background .2s, color .2s; }
html .im-joindre:hover { transform: rotate(-12deg); color: var(--idep-accent); }

/* — Menu « joindre » de la conversation : la palette IMOVI+ au lieu de l'arc-en-ciel — */
html .attach-item .attach-ico { box-shadow: 0 10px 20px -10px rgba(26, 22, 18, .55), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
html .attach-item:hover .attach-ico { transform: translateY(-3px) scale(1.04); }
html .attach-item:nth-child(1) .attach-ico { background: linear-gradient(145deg, #3A332B, #1A1612) !important; }
html .attach-item:nth-child(2) .attach-ico { background: linear-gradient(145deg, #D39A5C, #9A5E24) !important; }
html .attach-item:nth-child(3) .attach-ico { background: linear-gradient(145deg, #B87333, #6B461F) !important; }
html .attach-item:nth-child(4) .attach-ico { background: linear-gradient(145deg, #8E6A45, #4E3A26) !important; }
html .attach-item:nth-child(5) .attach-ico { background: linear-gradient(145deg, #2E8A6A, #14543F) !important; }
html .attach-item:nth-child(6) .attach-ico { background: linear-gradient(145deg, #6B655D, #3A342C) !important; }

/* ══ 3. PROTECTION CONTRE LES STYLES DE PAGE ═══════════════════════════════
   Certaines pages stylent tous leurs <span> (display:block, marges…). La mise
   en page interne du dépôt ne doit pas en dépendre. */
.idep .idep-pastille { display: grid !important; place-items: center !important; margin: 0 !important; padding: 0 !important; }
.idep .idep-texte { display: flex !important; margin: 0 !important; }
.idep .idep-titre, .idep .idep-sous, .idep .idep-meta, .idep .idep-nom { display: block !important; margin: 0 !important; }
.idep .idep-bouton { display: inline-flex !important; margin: 0 !important; }
.idep.idep-etroit .idep-bouton, .idep.idep-compact .idep-bouton,
.idep.idep-etroit .idep-meta, .idep.idep-compact .idep-meta,
.idep.idep-tres-etroit .idep-sous, .idep.idep-compact.idep-tres-etroit .idep-sous { display: none !important; }
.idep .idep-poids { display: flex !important; }
.idep .idep-vignette { display: grid !important; }
.idep .idep-pastille svg, .idep .idep-bouton svg, .idep .idep-retirer svg { display: block; flex: 0 0 auto; }
.idep.idep-compact.idep-tres-etroit .idep-zone { justify-content: center; padding: 8px 10px; }
.idep.idep-compact.idep-tres-etroit .idep-pastille { width: 30px; height: 30px; }
.idep.idep-compact.idep-tres-etroit .idep-pastille svg { width: 14px; height: 14px; }
.idep.idep-compact.idep-tres-etroit .idep-texte { flex: 0 1 auto; }
.idep.idep-compact.idep-tres-etroit .idep-titre { font-size: 13px; }
