/* ============================================================
   Design system : Salon des métiers de l'accueil et du goût
   Inspiré de decouvre.metiers-de-bouche.ch
   (fond sombre, jaune vif, angles droits, Funnel Display + Onest)
   ============================================================ */

@font-face {
  font-family: 'Onest';
  src: url('/shared/fonts/onest-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  src: url('/shared/fonts/onest-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Funnel Display';
  src: url('/shared/fonts/funnel-latin.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Funnel Display';
  src: url('/shared/fonts/funnel-latin-ext.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* base */
  --ink: #1d1d1b;
  --ink-soft: #2a2a27;
  --paper: #ffffff;
  --cream: #f3efe6;
  --line: rgba(255, 255, 255, 0.14);
  --line-ink: rgba(29, 29, 27, 0.14);

  /* accent principal */
  --yellow: #ffc700;
  --yellow-deep: #e8ae00;

  /* palette domaines */
  --c-boucherie: #fd5340;
  --c-boulangerie: #e44c94;
  --c-cuisine: #ff8a3d;
  --c-hotellerie: #00aece;
  --c-service: #aa60bf;
  --c-systeme: #3d6fe0;
  --c-lait: #ffc700;
  --c-vente: #63d05a;

  --font-display: 'Funnel Display', 'Onest', system-ui, sans-serif;
  --font-text: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 0px; /* angles droits comme le site de référence */
  --maxw: 640px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  /* empêche le "tirer pour recharger" mobile qui relançait le questionnaire */
  overscroll-behavior-y: contain;
}

body {
  font-family: var(--font-text);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2rem, 7vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); }
p { margin: 0 0 1rem; }
a { color: inherit; }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 24px) clamp(14px, 5vw, 26px) 84px;
  padding-top: max(clamp(16px, 4vw, 24px), env(safe-area-inset-top));
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.grow { flex: 1; }
.center { text-align: center; }
.muted { opacity: 0.66; }
.small { font-size: 0.85rem; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  padding: clamp(13px, 3.6vw, 17px) 22px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: clamp(0.95rem, 3.6vw, 1.02rem);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(2px); }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--paper);
  font-weight: 600;
}
.btn--light { background: var(--paper); border-color: var(--paper); }

/* ---------- cartes / choix ---------- */
.card {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  margin: 0 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-soft);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.06s ease;
}
.choice:hover { border-color: var(--yellow); }
.choice:active { transform: scale(0.99); }
.choice.is-selected {
  border-color: var(--yellow);
  background: #35331f;
}
.choice.is-correct { border-color: var(--c-vente); background: #1f3320; }
.choice.is-wrong { border-color: var(--c-boucherie); background: #3a2320; }
.choice .dot {
  width: 22px; height: 22px; flex: none;
  border: 2px solid currentColor; border-radius: 50%;
  opacity: 0.5;
}

/* ---------- progression ---------- */
.progress {
  height: 6px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 26px;
}
.progress > i {
  display: block; height: 100%;
  background: var(--yellow);
  transition: width 0.35s ease;
}

/* ---------- pastilles / tags ---------- */
.tag {
  display: inline-block;
  padding: 5px 11px;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- champs ---------- */
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: 0.92rem; }
input[type='text'], input[type='email'] {
  width: 100%;
  padding: 14px 15px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  margin-bottom: 16px;
}
input:focus-visible, .choice:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.check {
  display: flex; gap: 12px; align-items: flex-start;
  font-weight: 500; font-size: 0.9rem; cursor: pointer;
  margin-bottom: 18px;
}
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--yellow); }

/* ---------- divers ---------- */
.kicker {
  font-family: var(--font-text);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.6;
}
.footer-note {
  margin-top: auto;
  padding-top: 28px;
  font-size: 0.76rem;
  opacity: 0.5;
}
.fade-in { animation: fade 0.4s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  /* on coupe les animations décoratives, mais PAS les jauges qui portent une info
     (barre de temps du Défi IA, barre de progression du quiz) */
  *:not(.timer > i):not(.progress > i) {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* très petits écrans en hauteur (petits téléphones, paysage) : on resserre */
@media (max-height: 620px) {
  .wrap { padding-bottom: 28px; }
  h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .footer-note { padding-top: 16px; }
  .choice { padding: 12px 14px; margin-bottom: 8px; }
  .progress { margin-bottom: 16px; }
}
/* très petits écrans en largeur : marges minimales */
@media (max-width: 340px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
}
