/* =========================================================
   GS1 Sénégal — Charte graphique
   Bleu GS1 #002C6C · Orange GS1 #F26334 · Gris GS1
   ========================================================= */

:root {
  --gs1-blue: #002C6C;
  --gs1-blue-700: #00204f;
  --gs1-blue-100: #e6ebf2;
  --gs1-orange: #F26334;
  --gs1-orange-600: #d94f22;
  --gs1-dark-gray: #454545;
  --gs1-medium-gray: #888B8D;
  --gs1-light-medium: #B1B3B3;
  --gs1-light-gray: #F4F4F4;
  --gs1-sky: #00B6DE;
  --gs1-forest: #00B74F;
  --white: #ffffff;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 44, 108, .06), 0 1px 3px rgba(0, 44, 108, .08);
  --shadow-md: 0 4px 12px rgba(0, 44, 108, .08), 0 12px 32px rgba(0, 44, 108, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 780px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gs1-dark-gray);
  background: var(--gs1-light-gray);
  -webkit-font-smoothing: antialiased;
}

/* ---------- En-tête ---------- */

.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--gs1-blue);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header img { height: 44px; width: auto; display: block; }
.site-header .tag {
  font-size: 13px;
  color: var(--gs1-medium-gray);
  text-align: right;
  line-height: 1.35;
}
.site-header .tag strong { color: var(--gs1-blue); display: block; font-size: 14px; }

/* ---------- Bandeau de progression ---------- */

.progress-wrap {
  position: sticky;
  top: 74px;
  z-index: 19;
  background: var(--white);
  border-bottom: 1px solid #e6e8ea;
  padding: 12px 20px;
}
.progress-inner { max-width: var(--maxw); margin: 0 auto; }
.progress-bar {
  height: 6px;
  background: var(--gs1-blue-100);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gs1-blue), var(--gs1-sky));
  border-radius: 99px;
  transition: width .35s ease;
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gs1-medium-gray);
}
.progress-steps b { color: var(--gs1-blue); font-weight: 700; }

/* ---------- Structure ---------- */

main { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 60px; }

.intro-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
  margin-bottom: 24px;
  border-top: 5px solid var(--gs1-orange);
}
.intro-card h1 {
  margin: 0 0 6px;
  font-size: 27px;
  line-height: 1.25;
  color: var(--gs1-blue);
  letter-spacing: -.4px;
}
.intro-card .sub { color: var(--gs1-orange); font-weight: 700; margin: 0 0 18px; font-size: 15px; }
.intro-card p { margin: 0 0 14px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gs1-light-gray);
  color: var(--gs1-blue);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
}
.chip svg { width: 15px; height: 15px; }

/* ---------- Sections / cartes ---------- */

.step { display: none; animation: fade .35s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 30px 32px;
  margin-bottom: 20px;
}
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.section-num {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gs1-blue);
  color: var(--white);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
}
.section-head h2 { margin: 0; font-size: 20px; color: var(--gs1-blue); letter-spacing: -.2px; }
.section-rule { height: 3px; background: var(--gs1-orange); width: 52px; border-radius: 2px; margin: 14px 0 26px; }

/* ---------- Champs ---------- */

.field { margin-bottom: 30px; }
.field:last-child { margin-bottom: 6px; }
.field > label.q, .q-label {
  display: block;
  font-weight: 600;
  color: #222;
  margin-bottom: 12px;
  font-size: 16.5px;
  line-height: 1.45;
}
.q-label .req { color: var(--gs1-orange); margin-left: 3px; }
.hint { font-size: 13px; color: var(--gs1-medium-gray); margin: -6px 0 12px; }

input[type="text"], input[type="email"], input[type="month"], textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--gs1-dark-gray);
  background: #fbfcfd;
  border: 1.5px solid #d8dde3;
  border-radius: var(--radius);
  padding: 13px 15px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 116px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gs1-blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 44, 108, .10);
}
input.err, textarea.err { border-color: var(--gs1-orange); background: #fff8f6; }

.field-error { color: var(--gs1-orange-600); font-size: 13.5px; font-weight: 600; margin-top: 8px; display: none; }
.field-error.show { display: block; }

/* ---------- Choix (radio) ---------- */

.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1.5px solid #dfe3e8;
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--white);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.option:hover { border-color: var(--gs1-blue); background: #f8fbff; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .dot {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  border-radius: 50%;
  border: 2px solid var(--gs1-light-medium);
  position: relative;
  transition: border-color .15s;
}
.option input:checked ~ .dot { border-color: var(--gs1-blue); }
.option input:checked ~ .dot::after {
  content: '';
  position: absolute; inset: 3.5px;
  border-radius: 50%;
  background: var(--gs1-blue);
}
/* Case à cocher (questions à choix multiples) */
.option .box {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  border-radius: 5px;
  border: 2px solid var(--gs1-light-medium);
  position: relative;
  transition: border-color .15s, background .15s;
}
.option input:checked ~ .box {
  border-color: var(--gs1-blue);
  background: var(--gs1-blue);
}
.option input:checked ~ .box::after {
  content: '';
  position: absolute;
  left: 5.5px; top: 1.5px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.option-check .txt { user-select: none; }

.option:has(input:checked), .option.checked {
  border-color: var(--gs1-blue);
  background: var(--gs1-blue-100);
  box-shadow: 0 0 0 3px rgba(0, 44, 108, .08);
}
.option .txt { font-size: 15.5px; }

.other-input { margin-top: 10px; display: none; }
.other-input.show { display: block; }

/* ---------- Échelle 1 → 5 ---------- */

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale-item {
  position: relative;
  border: 1.5px solid #dfe3e8;
  border-radius: var(--radius);
  background: var(--white);
  padding: 16px 6px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.scale-item:hover { border-color: var(--gs1-blue); background: #f8fbff; transform: translateY(-2px); }
.scale-item input { position: absolute; opacity: 0; pointer-events: none; }
.scale-item .n { display: block; font-size: 22px; font-weight: 800; color: var(--gs1-blue); line-height: 1.1; }
.scale-item .face { font-size: 20px; display: block; margin-bottom: 2px; }
.scale-item:has(input:checked), .scale-item.checked {
  border-color: var(--gs1-orange);
  background: #fff3ef;
  box-shadow: 0 0 0 3px rgba(242, 99, 52, .14);
}
.scale-item:has(input:checked) .n, .scale-item.checked .n { color: var(--gs1-orange-600); }
.scale-legend {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--gs1-medium-gray); margin-top: 9px;
}

/* ---------- Fichier ---------- */

.dropzone {
  border: 2px dashed #cbd3db;
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.dropzone:hover, .dropzone.drag { border-color: var(--gs1-blue); background: var(--gs1-blue-100); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .ico { font-size: 26px; }
.dropzone .main { font-weight: 600; color: var(--gs1-blue); margin-top: 6px; }
.dropzone .sub { font-size: 13px; color: var(--gs1-medium-gray); margin-top: 3px; }
.file-chip {
  display: none;
  align-items: center; gap: 10px;
  margin-top: 12px;
  background: var(--gs1-blue-100);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14px;
}
.file-chip.show { display: flex; }
.file-chip .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--gs1-blue); }
.file-chip button {
  border: none; background: none; color: var(--gs1-orange-600);
  font-weight: 700; cursor: pointer; font-size: 13px; padding: 2px 6px;
}

/* ---------- Navigation ---------- */

.nav-row { display: flex; gap: 12px; justify-content: space-between; margin-top: 8px; }
.btn {
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  border-radius: var(--radius);
  padding: 14px 28px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 9px;
}
.btn-primary { background: var(--gs1-blue); color: var(--white); }
.btn-primary:hover { background: var(--gs1-blue-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--gs1-orange); color: var(--white); }
.btn-accent:hover { background: var(--gs1-orange-600); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--white); color: var(--gs1-blue); border-color: #d8dde3; }
.btn-ghost:hover { border-color: var(--gs1-blue); background: var(--gs1-blue-100); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- États ---------- */

.alert {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14.5px;
  border-left: 4px solid;
}
.alert-error { background: #fff3ef; border-color: var(--gs1-orange); color: #8f3212; }
.alert-info { background: var(--gs1-blue-100); border-color: var(--gs1-blue); color: var(--gs1-blue); }

.site-footer {
  text-align: center;
  padding: 26px 20px 40px;
  font-size: 12.5px;
  color: var(--gs1-medium-gray);
}
.site-footer a { color: var(--gs1-blue); }

/* ---------- Pages simples (merci, désinscription, 404) ---------- */

.page-simple { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.card-simple {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 46px 40px;
  max-width: 560px;
  text-align: center;
  border-top: 5px solid var(--gs1-orange);
}
.card-simple img { margin-bottom: 22px; }
.card-simple h1 { color: var(--gs1-blue); font-size: 25px; margin: 0 0 12px; }
.card-simple p { color: var(--gs1-dark-gray); margin: 0 0 8px; }
.success-mark {
  width: 66px; height: 66px; border-radius: 50%;
  background: var(--gs1-forest); color: #fff;
  display: grid; place-items: center;
  font-size: 34px; margin: 0 auto 20px;
}

.loading { text-align: center; padding: 70px 20px; color: var(--gs1-medium-gray); }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--gs1-blue-100);
  border-top-color: var(--gs1-blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .site-header img { height: 36px; }
  .site-header .tag { font-size: 11px; }
  .progress-wrap { top: 63px; padding: 10px 16px; }
  main { padding: 18px 14px 48px; }
  .intro-card, .card { padding: 24px 20px; border-radius: 12px; }
  .intro-card h1 { font-size: 22px; }
  .section-head h2 { font-size: 17.5px; }
  .scale { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .scale-item { padding: 12px 2px 9px; }
  .scale-item .n { font-size: 18px; }
  .scale-item .face { font-size: 16px; }
  .btn { padding: 13px 20px; font-size: 15px; flex: 1; justify-content: center; }
  .nav-row { gap: 10px; }
}

@media print { .site-header, .progress-wrap, .nav-row { display: none; } }
