:root {
  --paper: #F1E9D8;
  --paper-dark: #E4D8BC;
  --card: #FBF7EE;
  --ink: #241F18;
  --ink-soft: #5C5646;
  --rust: #A8452B;
  --pine: #35503F;
  --gold: #B8873B;
  --line: #C9BC9C;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --mono: "Courier New", ui-monospace, Consolas, monospace;
  --sans: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--serif); }
code {
  font-family: var(--mono);
  background: var(--paper-dark);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
}

/* ---- Connexion ---- */
.page-connexion {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.carte-connexion {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2.2rem 2rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 4px 4px 0 rgba(36,31,24,0.08);
}
.carte-connexion h1 { margin: 0.3rem 0 0.4rem; font-size: 1.6rem; }
.sous-titre { color: var(--ink-soft); margin: 0 0 1.4rem; font-size: 0.92rem; }
.note { color: var(--ink-soft); font-size: 0.78rem; margin-top: 1rem; }

/* ---- Structure générale ---- */
.entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.6rem 2rem;
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
}
.entete h1 { margin: 0.2rem 0 0; font-size: 1.7rem; }
.entete-utilisateur { font-size: 0.85rem; color: var(--ink-soft); }
.entete-utilisateur a { color: var(--rust); }

main { max-width: 780px; margin: 0 auto; padding: 2rem; }

.bloc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.6rem;
  box-shadow: 3px 3px 0 rgba(36,31,24,0.06);
}
.bloc h2 { margin-top: 0; font-size: 1.2rem; border-bottom: 2px solid var(--line); padding-bottom: 0.5rem; }
.texte-aide { color: var(--ink-soft); font-size: 0.9rem; }

/* ---- Formulaires ---- */
.formulaire, .formulaire-inline { display: flex; flex-direction: column; gap: 0.9rem; }
.formulaire-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.8rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--ink-soft); }
input[type="text"], input[type="password"], input[type="number"] {
  font-family: var(--sans);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
}
input[type="file"] { font-size: 0.85rem; }

button, .bouton-lien {
  font-family: var(--sans);
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
button:hover, .bouton-lien:hover { background: var(--rust); }
button:disabled { background: var(--line); color: var(--ink-soft); cursor: not-allowed; }

/* ---- Dépôt de fichiers ---- */
.grille-depot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.carte-depot {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.carte-depot h3 { margin: 0; font-size: 1rem; }
.carte-depot p { margin: 0; font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Jauge de volume ---- */
.jauge-conteneur {
  background: var(--paper-dark);
  border-radius: 20px;
  height: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.jauge { height: 100%; background: var(--pine); transition: width 0.3s; }
.jauge-danger { background: var(--rust); }
.jauge-legende { font-size: 0.85rem; color: var(--ink-soft); margin: 0.5rem 0 0; }
.texte-danger { color: var(--rust); font-weight: bold; }
.texte-avertissement { color: var(--gold); font-size: 0.85rem; }

/* ---- Statuts et alertes ---- */
.zone-statut { margin-top: 1rem; }
.statut-attente {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper-dark);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
}
.statut-ok {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--pine);
  font-weight: bold;
}

.barre-progression {
  background: var(--paper-dark);
  border: 1px solid var(--line);
  border-radius: 20px;
  height: 14px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.barre-remplissage {
  height: 100%;
  background: var(--pine);
  transition: width 0.2s;
}

.alerte { border-radius: 6px; padding: 0.9rem 1.1rem; margin: 1rem 0; font-size: 0.9rem; }
.alerte p { margin: 0.2rem 0; }
.alerte ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.alerte-erreur { background: #F4DEDA; border: 1px solid var(--rust); color: #6B2416; }
.alerte-avertissement { background: #F5EAD1; border: 1px solid var(--gold); color: #6B4F14; }
.alerte-succes { background: #DCE6DC; border: 1px solid var(--pine); color: #1F3324; }
.alerte-info { background: var(--paper-dark); border: 1px solid var(--line); color: var(--ink); }

@media (max-width: 600px) {
  .entete, main { padding: 1.2rem; }
  .formulaire-inline { flex-direction: column; align-items: stretch; }
}
