/* ============================================================
   Design system Aroma Zone — tokens
   6 couleurs, aucune invention. Police unique : Roboto Flex.
   ============================================================ */
:root {
  --c-marron:       #4A3428;  /* marque, titres */
  --c-ivoire:       #FAEBDE;  /* fond principal */
  --c-ivoire-fonce: #FCD3AD;  /* surface accent / chaude */
  --c-bleu-clair:   #E4F1F5;  /* surface fraîche */
  --c-gris:         #3E3B3E;  /* texte courant */
  --c-bouton:       #484448;  /* CTA */

  --line:        rgba(74, 52, 40, 0.14);
  --line-strong: rgba(74, 52, 40, 0.28);
  --line-soft:   rgba(74, 52, 40, 0.08);
  --shadow-1:    0 1px 2px rgba(74, 52, 40, 0.06);
  --shadow-2:    0 2px 6px rgba(74, 52, 40, 0.08), 0 10px 24px rgba(74, 52, 40, 0.06);

  --marron-90: rgba(74, 52, 40, 0.90);
  --marron-70: rgba(74, 52, 40, 0.70);
  --marron-50: rgba(74, 52, 40, 0.50);
  --marron-30: rgba(74, 52, 40, 0.30);

  --ff: "Roboto Flex", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-20: 20px;
  --s-24: 24px; --s-32: 32px; --s-40: 40px; --s-56: 56px;

  --r-4: 4px; --r-8: 8px; --r-12: 12px; --r-full: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--ff);
  font-variation-settings: "opsz" 14, "wdth" 100;
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-gris);
  background: var(--c-ivoire);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--c-ivoire-fonce); color: var(--c-marron); }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--s-40) var(--s-20) var(--s-56);
}

/* ---------- En-tête ---------- */
header { margin-bottom: var(--s-40); }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--marron-70);
  margin: 0 0 var(--s-12);
}

h1 {
  font-weight: 300;
  font-variation-settings: "opsz" 144, "wdth" 100;
  font-size: clamp(40px, 6vw, 56px);
  line-height: .98;
  letter-spacing: -.03em;
  margin: 0 0 var(--s-12);
  color: var(--c-marron);
}
h1 b { font-weight: 600; }

.subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-gris);
  max-width: 58ch;
}

/* ---------- Cartes / étapes ---------- */
.card {
  background: var(--c-ivoire);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  padding: var(--s-24) var(--s-32);
  margin-bottom: var(--s-16);
  box-shadow: var(--shadow-1);
}

h2 {
  margin: 0 0 var(--s-20);
  font-weight: 500;
  font-variation-settings: "opsz" 32, "wdth" 100;
  font-size: 24px;
  letter-spacing: -.01em;
  color: var(--c-marron);
  display: flex;
  align-items: center;
  gap: var(--s-12);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-marron);
  color: var(--c-ivoire);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ---------- Zone d'upload ---------- */
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-12);
  padding: var(--s-32) var(--s-16);
  text-align: center;
  color: var(--marron-70);
  background: var(--c-ivoire);
  margin-bottom: var(--s-16);
  transition: border-color .18s ease, background .18s ease;
}
.dropzone.dragover { border-color: var(--c-marron); background: var(--c-ivoire-fonce); }
.dropzone p { margin: 0; }

.file-name { margin-top: var(--s-8) !important; font-weight: 600; color: var(--c-marron); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--c-marron);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.link-btn:hover { color: var(--c-bouton); }

/* ---------- Boutons (pilule, CTA) ---------- */
button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  font-family: var(--ff);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .01em;
  padding: 14px 22px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: var(--c-bouton);
  color: var(--c-ivoire);
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, opacity .18s ease;
}
button.primary:hover:not(:disabled) { background: var(--c-marron); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { background: var(--marron-30); cursor: not-allowed; }

button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  padding: 14px 22px;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--c-marron);
  border: 1px solid var(--c-marron);
  cursor: pointer;
  transition: background .18s ease, transform .12s ease;
}
button.secondary:hover { background: var(--c-ivoire-fonce); }
button.secondary:active { transform: translateY(1px); }

/* ---------- Messages d'erreur ---------- */
.error {
  color: var(--c-marron);
  background: var(--c-ivoire);
  border: 1px solid var(--line);
  border-left: 4px solid var(--c-bouton);
  border-radius: var(--r-8);
  padding: var(--s-12) var(--s-16);
  margin: var(--s-12) 0 0;
  white-space: pre-wrap;
}

/* ---------- Filtre ---------- */
.filter-input {
  width: 100%;
  font-family: var(--ff);
  font-size: 15px;
  padding: 14px 18px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--c-ivoire);
  color: var(--c-marron);
  outline: none;
  margin-bottom: var(--s-12);
  transition: border-color .15s, box-shadow .15s;
}
.filter-input::placeholder { color: var(--marron-50); }
.filter-input:focus { border-color: var(--c-marron); box-shadow: 0 0 0 3px var(--c-ivoire-fonce); }

.no-match {
  color: var(--marron-70);
  margin: 0 0 var(--s-16);
  padding: var(--s-4) var(--s-12);
}

/* ---------- Sélection des produits ---------- */
.select-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-12);
  gap: var(--s-12);
  flex-wrap: wrap;
}

.count {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--marron-70);
  font-variant-numeric: tabular-nums;
}

.product-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  padding: var(--s-8);
  margin-bottom: var(--s-16);
  background: var(--c-ivoire);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  padding: var(--s-8) var(--s-12);
  border-radius: var(--r-8);
  cursor: pointer;
  transition: background .15s;
}
.checkbox-line:hover { background: var(--c-ivoire-fonce); }
.checkbox-line[hidden] { display: none; }

.checkbox-line input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--c-marron);
}

.product-label { flex: 1; color: var(--c-marron); font-weight: 500; }

.sku {
  color: var(--c-marron);
  background: var(--c-bleu-clair);
  border-radius: var(--r-4);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Progression ---------- */
.progress-line { display: flex; align-items: center; gap: var(--s-16); }

.spinner {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: 3px solid var(--c-ivoire-fonce);
  border-top-color: var(--c-marron);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#progress-text { margin: 0; font-weight: 600; color: var(--c-marron); }

.hint { color: var(--marron-70); font-size: 13px; }

a { color: var(--c-marron); text-underline-offset: 3px; }
a:hover { color: var(--c-bouton); }

/* ---------- Résultat ---------- */
.result-actions {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  flex-wrap: wrap;
  margin-bottom: var(--s-16);
}

.secondary-link { font-weight: 500; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  background: var(--c-ivoire);
}

table { border-collapse: collapse; width: 100%; font-size: 14px; }

th {
  text-align: left;
  padding: var(--s-12) var(--s-16);
  background: var(--c-ivoire-fonce);
  color: var(--c-marron);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

td {
  text-align: left;
  padding: var(--s-12) var(--s-16);
  border-top: 1px solid var(--line);
  vertical-align: top;
  max-width: 420px;
  color: var(--c-gris);
}

tbody tr:hover td { background: var(--c-bleu-clair); }

details { margin-top: var(--s-16); }
summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--marron-70);
}
summary:hover { color: var(--c-marron); }

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--c-bleu-clair);
  color: var(--c-gris);
  border-radius: var(--r-8);
  padding: var(--s-16);
  font-size: 13px;
}
