:root {
  --fond: #fbf7f0;
  --carte: #ffffff;
  --encre: #1e2622;
  --doux: #56615a;
  --trait: #e4dccf;
  --vert: #1c7347;
  --vert-clair: #e5f3ea;
  --orange: #a84e08;
  --orange-clair: #fdefdd;
  --rouge: #b3261e;
  --rouge-clair: #fbe7e4;
  --rayon: 18px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 17px/1.5 ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.entete,
main,
.pied {
  width: min(100% - 40px, 560px);
  margin-inline: auto;
}

.entete {
  padding-block: 20px 0;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.pastilles {
  display: inline-flex;
  gap: 4px;
}

.pastilles i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #35a26b;
}

.pastilles i:nth-child(2) {
  background: #f0a23b;
}

.pastilles i:nth-child(3) {
  background: #e5594f;
}

.accroche {
  padding-block: 36px 24px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.accroche p {
  margin: 0;
  max-width: 30em;
  color: var(--doux);
  font-size: 19px;
}

.entrees {
  display: grid;
  gap: 20px;
}

label,
.secours h2 {
  display: block;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: var(--carte);
  color: var(--encre);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.bouton.principal {
  width: 100%;
  min-height: 60px;
  background: var(--encre);
  color: #fff;
  font-size: 19px;
}

.bouton.discret {
  width: 100%;
  margin: 0;
  border-color: var(--trait);
  font-size: 17px;
}

.bouton:active {
  transform: translateY(1px);
}

:focus-visible,
.cache:focus-visible + label {
  outline: 3px solid #2a6fdb;
  outline-offset: 3px;
}

.champ {
  display: flex;
  gap: 8px;
}

input[type='search'],
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 2px solid var(--trait);
  border-radius: 26px;
  background: var(--carte);
  color: inherit;
  font: inherit;
}

textarea {
  display: block;
  margin-bottom: 10px;
  border-radius: var(--rayon);
  resize: vertical;
}

input[type='search']:focus,
textarea:focus {
  border-color: var(--encre);
}

.secours {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--trait);
}

.note {
  margin: 8px 0 0;
  color: var(--doux);
  font-size: 15px;
}

.cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

details {
  margin-top: 16px;
}

summary {
  width: fit-content;
  padding-block: 8px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

details form {
  padding-top: 8px;
}

#etat {
  min-height: 1.5em;
  margin: 20px 0 0;
  font-weight: 600;
}

#etat:empty {
  display: none;
}

/* Produits trouvés */

#liste {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

#liste:empty,
#resultat:empty {
  display: none;
}

.produit {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--carte);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.vignette {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--fond);
  object-fit: contain;
}

.produit strong,
.fiche-nom {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.produit small,
.fiche-marque {
  display: block;
  color: var(--doux);
  font-size: 15px;
}

/* Résultat */

#resultat {
  margin-top: 24px;
  scroll-margin-top: 16px;
}

.fiche {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.fiche:not(:has(img)) {
  grid-template-columns: 1fr;
}

.fiche-nom {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.verdict {
  padding: 22px;
  border-radius: var(--rayon);
  background: var(--vert-clair);
}

.verdict.orange {
  background: var(--orange-clair);
}

.verdict.rouge {
  background: var(--rouge-clair);
}

.verdict.neutre {
  background: var(--carte);
  border: 1px solid var(--trait);
}

.verdict-titre {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 4px;
  color: var(--vert);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.verdict.orange .verdict-titre {
  color: var(--orange);
}

.verdict.rouge .verdict-titre {
  color: var(--rouge);
}

.verdict.neutre .verdict-titre {
  color: var(--encre);
  font-size: 22px;
}

.verdict-titre::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
}

.verdict.neutre .verdict-titre::before {
  content: none;
}

.verdict p {
  margin: 0;
}

.signales {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.signales li {
  padding: 16px 18px;
  border: 1px solid var(--trait);
  border-left: 6px solid var(--orange);
  border-radius: 14px;
  background: var(--carte);
}

.signales li.rouge {
  border-left-color: var(--rouge);
}

.signales strong {
  display: block;
  overflow-wrap: anywhere;
}

.etiquette {
  display: inline-block;
  margin: 4px 0 6px;
  color: var(--orange);
  font-size: 15px;
  font-weight: 700;
}

.rouge .etiquette {
  color: var(--rouge);
}

.signales p {
  margin: 0;
}

.source {
  display: block;
  margin-top: 6px;
  color: var(--doux);
  font-size: 15px;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

.tous {
  margin-top: 14px;
}

.tous p {
  margin: 4px 0 0;
  color: var(--doux);
  overflow-wrap: anywhere;
}

.tous mark {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--orange-clair);
  color: var(--orange);
  font-weight: 700;
}

.tous mark.rouge {
  background: var(--rouge-clair);
  color: var(--rouge);
}

.pied {
  margin-top: 48px;
  padding-block: 20px 40px;
  border-top: 1px solid var(--trait);
  color: var(--doux);
  font-size: 15px;
}

.pied p {
  margin: 0 0 8px;
}

/* Scan */

dialog {
  width: min(100% - 32px, 480px);
  padding: 18px;
  border: 0;
  border-radius: 24px;
  background: var(--carte);
  color: inherit;
}

dialog::backdrop {
  background: rgb(20 26 23 / 0.7);
}

dialog h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

dialog video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: 14px;
  background: #000;
  object-fit: cover;
}

dialog .bouton {
  width: 100%;
}
