/* NeedsFileDrop — zone d'upload stylée (remplace les <input type="file"> natifs) */

.nfd-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.nfd-wrap {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.nfd-zone {
  border: 2px dashed var(--border-card, #2A2A38);
  background: var(--bg-secondary, #13131A);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-on-card, #F0EDE8);
  box-sizing: border-box;
  outline: none;
}

.nfd-zone:hover,
.nfd-zone.is-drag,
.nfd-zone:focus-visible {
  border-color: var(--accent, #C9A84C);
  background: var(--bg-card, #1a1a24);
}

.nfd-zone.is-drag {
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}

.nfd-zone.nfd-compact {
  padding: 18px 14px;
}

.nfd-ico {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: block;
  color: #C9A84C;
}

.nfd-compact .nfd-ico {
  font-size: 1.35rem;
}

.nfd-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: inherit;
}

.nfd-sub {
  font-size: 0.72rem;
  color: var(--text-secondary, #9B99A6);
  margin: 0;
  line-height: 1.4;
}

.nfd-filled {
  display: none;
  text-align: left;
}

.nfd-wrap.is-filled .nfd-empty {
  display: none;
}

.nfd-wrap.is-filled .nfd-filled {
  display: block;
}

.nfd-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nfd-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-card, #1C1C26);
  border: 1px solid var(--border-card, #2A2A38);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C9A84C;
  font-size: 1.4rem;
  overflow: hidden;
}

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

.nfd-thumb.nfd-round,
.nfd-thumb.nfd-round img {
  border-radius: 50%;
}

.nfd-meta {
  flex: 1;
  min-width: 0;
}

.nfd-name {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 2px;
  word-break: break-all;
  color: inherit;
}

.nfd-size {
  font-size: 0.72rem;
  color: var(--text-secondary, #9B99A6);
  margin: 0;
}

.nfd-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.nfd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-card, #2A2A38);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.nfd-btn:hover {
  border-color: var(--accent, #C9A84C);
  color: var(--accent, #C9A84C);
}

.nfd-btn-danger:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.nfd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.nfd-grid-item {
  position: relative;
  background: var(--bg-card, #1C1C26);
  border: 1px solid var(--border-card, #2A2A38);
  border-radius: 10px;
  overflow: hidden;
  padding-bottom: 8px;
}

.nfd-grid-item .nfd-thumb {
  width: 100%;
  height: 90px;
  border-radius: 0;
  border: none;
}

.nfd-grid-item .nfd-meta {
  padding: 6px 8px 0;
}

.nfd-grid-item .nfd-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary, #9B99A6);
}

.nfd-grid-rm {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nfd-grid-rm:hover {
  background: #dc2626;
}

.nfd-err {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #dc2626;
  min-height: 0;
  line-height: 1.35;
}

.nfd-err:empty {
  display: none;
}

.nfd-secure-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted, #9B99A6);
}

.nfd-secure-note i {
  color: #C9A84C;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Mode clair */
html.needs-light .nfd-zone,
body.light-mode .nfd-zone {
  background: #FFFFFF !important;
  border-color: #D8D3CE !important;
  color: #0A0A0F !important;
}

html.needs-light .nfd-zone:hover,
html.needs-light .nfd-zone.is-drag,
html.needs-light .nfd-zone:focus-visible,
body.light-mode .nfd-zone:hover,
body.light-mode .nfd-zone.is-drag,
body.light-mode .nfd-zone:focus-visible {
  background: #F8F6F1 !important;
  border-color: #C9A84C !important;
}

html.needs-light .nfd-sub,
html.needs-light .nfd-size,
html.needs-light .nfd-grid-item .nfd-name,
body.light-mode .nfd-sub,
body.light-mode .nfd-size,
body.light-mode .nfd-grid-item .nfd-name {
  color: #5C5A66 !important;
}

html.needs-light .nfd-thumb,
html.needs-light .nfd-grid-item,
body.light-mode .nfd-thumb,
body.light-mode .nfd-grid-item {
  background: #F5F0EB !important;
  border-color: #D8D3CE !important;
}

html.needs-light .nfd-btn,
body.light-mode .nfd-btn {
  border-color: #D8D3CE !important;
  color: #0A0A0F !important;
}

html.needs-light .nfd-secure-note,
body.light-mode .nfd-secure-note {
  color: #5C5A66 !important;
}
