/* Charte AI-FIKA : marine #1B4F72, teal #17A589, ambre #F39C12, fond #FDFEFE, texte #2C3E50 */

:root {
  --marine: #1B4F72;
  --teal: #17A589;
  --ambre: #F39C12;
  --fond: #FDFEFE;
  --texte: #2C3E50;
  --gris-clair: #EAEDED;
  --gris-bordure: #D5DBDB;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: 'Open Sans', Arial, sans-serif;
}

h1, h2, .brand-name {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: var(--marine);
  color: white;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ambre); }
.brand-name { font-size: 1.1rem; }
.brand-name strong { color: var(--teal); }
.brand-tag { font-size: 0.85rem; opacity: 0.85; }

/* ── Container ── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  text-align: center;
}

h1 { font-size: 1.8rem; margin-bottom: 8px; }
.subtitle { color: #5D6D7E; margin-bottom: 32px; }

/* ── Cards ── */
.card {
  background: white;
  border: 1px solid var(--gris-bordure);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
  text-align: left;
}

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed var(--teal);
  background: #F4FBFA;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.dropzone.dragover { background: #E3F6F2; }
.dropzone-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 2rem;
  line-height: 56px;
}
.dropzone-text { font-size: 1.05rem; margin: 0; }
.dropzone-formats { font-size: 0.8rem; color: #7F8C8D; margin-top: 8px; }
.link-btn {
  background: none; border: none;
  color: var(--marine);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

/* ── Liste fichiers — scroll si > 6 entrées ── */
.liste-fichiers {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  text-align: left;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) var(--gris-clair);
}
.liste-fichiers::-webkit-scrollbar { width: 6px; }
.liste-fichiers::-webkit-scrollbar-track { background: var(--gris-clair); border-radius: 4px; }
.liste-fichiers::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 4px; }

.liste-fichiers li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  background: var(--gris-clair);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.liste-fichiers button {
  background: none; border: none; color: #C0392B; cursor: pointer; font-weight: 700;
  flex-shrink: 0; margin-left: 8px;
}
.fichier-taille { color: #7F8C8D; font-size: 0.78rem; margin-left: 6px; }

/* ── Info taille totale ── */
.info-taille {
  font-size: 0.8rem; color: #5D6D7E;
  margin: 0 0 16px;
  text-align: right;
}

/* ── Message d'erreur UI inline ── */
.erreur-ui {
  background: #FDEDEC;
  border: 1px solid #E74C3C;
  border-radius: 8px;
  color: #C0392B;
  font-size: 0.88rem;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* ── Options ── */
.option-bloc { margin-bottom: 20px; }
.option-titre { display: block; font-weight: 700; margin-bottom: 8px; font-size: 0.92rem; }
.option-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

input[type="text"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gris-bordure);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--texte);
}

.checkbox-row { display: flex; gap: 10px; flex-wrap: wrap; }
.checkbox-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--gris-bordure);
  border-radius: 20px;
  font-size: 0.88rem;
  cursor: pointer;
}
.checkbox-pill input { accent-color: var(--teal); }

.hint { font-size: 0.8rem; color: #7F8C8D; margin: 6px 0 0; }

/* ── Bouton principal ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--ambre);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Montserrat', Arial, sans-serif;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { background: var(--gris-bordure); cursor: not-allowed; }

/* ── Résultat ── */
.resultat h2 { color: var(--teal); margin-top: 0; }
.resultat ul { padding-left: 20px; }
.resultat li.erreur { color: #C0392B; }
.resultat li.avertissement { color: #D35400; }

/* ── Overlay progression ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(27, 79, 114, 0.95);
  display: flex; align-items: center; justify-content: center;
  color: white; z-index: 100;
}
.overlay[hidden] { display: none; }

.progress-panel {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 40px 52px;
  min-width: 460px;
  max-width: 90vw;
  text-align: center;
}
.progress-titre {
  margin: 0 0 24px;
  font-size: 1.15rem;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
}
.progress-barre-fond {
  background: rgba(255,255,255,0.15);
  border-radius: 99px; height: 14px;
  overflow: hidden; margin-bottom: 8px;
}
.progress-barre-rempli {
  height: 100%;
  background: var(--ambre);
  border-radius: 99px;
  transition: width 0.6s ease;
  min-width: 4px;
}
.progress-pct {
  font-size: 0.88rem; opacity: 0.65; margin-bottom: 28px;
}
.progress-stats {
  display: flex; justify-content: center; gap: 40px; margin-bottom: 24px;
}
.stat-bloc {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat-bloc span {
  font-size: 2.2rem; font-weight: 700;
  font-family: 'Montserrat', Arial, sans-serif; line-height: 1;
}
.stat-bloc small {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.07em; opacity: 0.65;
}
.stat-ok span  { color: #1ABC9C; }
.stat-err span { color: #E74C3C; }
.stat-rem span { color: rgba(255,255,255,0.55); }

.progress-fichier {
  font-size: 0.8rem; opacity: 0.55; margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.progress-eta {
  font-size: 0.75rem; opacity: 0.45; margin: 0 0 20px;
  min-height: 1em;
}

/* ── Bouton Annuler dans l'overlay ── */
.btn-annuler {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.8);
  border-radius: 8px;
  padding: 8px 24px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-annuler:hover {
  background: rgba(231,76,60,0.25);
  border-color: #E74C3C;
  color: white;
}

/* ── Moniteur de jobs ── */
.jobs-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.jobs-monitor h2 { margin: 0; font-size: 1rem; color: var(--marine); }
.jobs-live {
  font-size: 0.75rem; color: #27AE60; font-weight: 700;
  letter-spacing: 0.04em; transition: opacity 0.3s;
}
.jobs-live-dim { opacity: 0.4; }
.jobs-vide { color: #95A5A6; font-size: 0.88rem; text-align: center; padding: 12px 0; }

.jobs-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.jobs-table th, .jobs-table td {
  padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--gris-clair);
  white-space: nowrap;
}
.jobs-table th {
  font-weight: 700; color: var(--marine); font-size: 0.73rem;
  text-transform: uppercase; letter-spacing: 0.05em; background: var(--gris-clair);
}
.job-id { font-family: monospace; font-size: 0.78rem; color: #7F8C8D; }
.job-fichier {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: #5D6D7E;
}
.stat-ok-cell  { color: #27AE60; font-weight: 700; }
.stat-err-cell { color: #E74C3C; font-weight: 700; }
.job-actif  { background: #FFF8F0; }
.job-ok     { background: #F0FFF4; }
.job-err    { background: #FFF0F0; }
.job-annule { background: #F8F8F8; color: #95A5A6; }

.btn-job-annuler {
  padding: 3px 10px;
  font-size: 0.78rem;
  background: transparent;
  border: 1px solid #E74C3C;
  color: #E74C3C;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-job-annuler:hover { background: rgba(231,76,60,0.12); }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: #95A5A6;
}
