/* Rod Sidney — feuille de style unique. Aucune police ni icône distante. */

:root {
  --fond: #f6f7f9;
  --carte: #ffffff;
  --bord: #dfe3e8;
  --texte: #1c2126;
  --discret: #667080;
  --accent: #2f6fd0;
  --danger: #c0392b;
  --rayon: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #14171b;
    --carte: #1c2126;
    --bord: #2c333b;
    --texte: #e8ebee;
    --discret: #98a2b0;
    --accent: #6ea8f0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main { max-width: 900px; margin: 0 auto; }

.tete { margin-bottom: 1.5rem; }
h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
.sous-titre { margin: 0.25rem 0 0; color: var(--discret); font-size: 0.95rem; }
h2 { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; }

/* ------------------------------------------------------------------ dépôt */

.depot {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s, background 0.15s;
}

.depot.survol {
  border-color: var(--accent);
  border-style: dashed;
  background: color-mix(in srgb, var(--accent) 6%, var(--carte));
}

.champs { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; }

.fichier { position: relative; flex: 1 1 220px; }
.fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.fichier span {
  display: block;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--bord);
  border-radius: 8px;
  background: var(--fond);
  color: var(--discret);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fichier input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="text"], input[type="search"] {
  flex: 1 1 200px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--bord);
  border-radius: 8px;
  background: var(--carte);
  color: var(--texte);
  font: inherit;
  min-width: 0;
}

button {
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: progress; }

.aide { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--discret); }
code { background: var(--fond); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }

/* ------------------------------------------------------------- barre / liste */

.barre { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.compteur { color: var(--discret); font-size: 0.9rem; white-space: nowrap; }

.lien {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0.3rem;
  font-size: 0.9rem;
  text-decoration: underline;
}

.liste { list-style: none; margin: 0; padding: 0; }

.element {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  margin-bottom: 0.5rem;
}

.infos { min-width: 0; }

.nom {
  display: block;
  color: var(--texte);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.nom:hover { color: var(--accent); text-decoration: underline; }

.meta { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--discret); }

.actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.action {
  background: transparent;
  border: 1px solid var(--bord);
  color: var(--texte);
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.action:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.action.danger:hover { border-color: var(--danger); color: var(--danger); }

.vide {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--discret);
  border: 1px dashed var(--bord);
  border-radius: var(--rayon);
}

/* --------------------------------------------------------------- messages */

.messages {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10;
  width: min(90vw, 420px);
}

.message {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--texte);
  color: var(--fond);
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.18);
}
.message.erreur { background: var(--danger); color: #fff; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 560px) {
  .element { flex-direction: column; align-items: stretch; }
  .actions { justify-content: flex-end; }
  .champs { flex-direction: column; }
  .barre { flex-wrap: wrap; }
}
