/* Atelier — feuille de style unique, dans l'esprit du site (papier ancien,
   sérif chaleureux). Pensée pour le téléphone d'abord : c'est là qu'on
   photographie une carafe, souvent d'une seule main. */

:root {
  --encre:      #2b1a12;
  --papier:     #f6f0e4;
  --papier-2:   #efe6d4;
  --trait:      #d9cbb0;
  --accent:     #8c4a2f;
  --accent-clr: #b4653f;
  --vert:       #4a6b3a;
  --rouge:      #9a3412;
  --menu:       #7a6a58;
}

@media (prefers-color-scheme: dark) {
  :root {
    --encre:    #f0e7d8;
    --papier:   #1b1310;
    --papier-2: #251a15;
    --trait:    #43332a;
    --accent:   #d98a63;
    --accent-clr:#e6a184;
    --menu:     #a3927d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1rem calc(2rem + env(safe-area-inset-bottom));
  background: var(--papier);
  color: var(--encre);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 34rem;
  margin-inline: auto;
}

.barre {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem;
  padding: calc(1rem + env(safe-area-inset-top)) 0 .75rem;
  border-bottom: 1px solid var(--trait);
  margin-bottom: 1.25rem;
}
.barre h1 {
  font-size: 1.5rem; font-weight: 600; margin: 0;
  letter-spacing: .02em;
}

.ecran[hidden] { display: none; }

.intro { color: var(--menu); }
.attente { color: var(--menu); font-style: italic; }

label {
  display: block;
  margin: 1.1rem 0 .3rem;
  font-weight: 600;
  font-size: .95rem;
}

input[type=text], textarea, select {
  width: 100%;
  padding: .6rem .7rem;
  font: inherit;
  color: var(--encre);
  background: var(--papier-2);
  border: 1px solid var(--trait);
  border-radius: .4rem;
}
textarea { resize: vertical; }

/* 16px minimum : en dessous, iOS zoome tout seul au focus. */
input[type=text], textarea, select { font-size: 1rem; }

.aide { margin: .3rem 0 0; font-size: .85rem; color: var(--menu); }
.menu { color: var(--menu); font-size: .9rem; }

.ligne-case {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 400; margin-top: 1.1rem;
}
.ligne-case input { width: 1.15rem; height: 1.15rem; }

/* --- zone photo : grande cible, on la vise à une main --- */
.zone-photo {
  display: flex; align-items: center; justify-content: center;
  position: relative;
  min-height: 13rem;
  margin: 0;
  padding: 1rem;
  text-align: center;
  background: var(--papier-2);
  border: 2px dashed var(--trait);
  border-radius: .6rem;
  cursor: pointer;
}
.zone-photo strong { display: block; font-size: 1.15rem; }
.zone-photo small { color: var(--menu); }
#apercu {
  max-width: 100%; max-height: 22rem;
  border-radius: .4rem;
  display: block;
}

.bouton {
  display: block; width: 100%;
  margin-top: 1.4rem; padding: .85rem 1rem;
  font: inherit; font-size: 1.05rem; font-weight: 600;
  text-align: center; text-decoration: none;
  color: #fff; background: var(--accent);
  border: 0; border-radius: .5rem;
  cursor: pointer;
}
.bouton:hover:not(:disabled) { background: var(--accent-clr); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }

.lien {
  font: inherit; font-size: .9rem;
  color: var(--menu); background: none; border: 0;
  text-decoration: underline; cursor: pointer; padding: 0;
}

.alerte {
  margin-top: 1rem; padding: .7rem .8rem;
  border-radius: .4rem;
  background: var(--papier-2);
  border-left: 4px solid var(--rouge);
  font-size: .95rem;
}
.alerte.ok { border-left-color: var(--vert); }

#recents { margin-top: 2.5rem; border-top: 1px solid var(--trait); padding-top: 1rem; }
#recents h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .6rem; }
#liste-recents { list-style: none; margin: 0; padding: 0; }
#liste-recents li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .4rem 0; border-bottom: 1px solid var(--trait);
  font-size: .9rem;
}
#liste-recents li:last-child { border-bottom: 0; }
.etape { color: var(--menu); white-space: nowrap; }

/* Barre de progression d'envoi : sur mobile, un envoi de 2 Mo sans retour
   visuel donne l'impression que l'application a planté. */
.progression {
  height: .35rem; margin-top: .8rem;
  background: var(--trait); border-radius: .2rem; overflow: hidden;
}
.progression > span {
  display: block; height: 100%; width: 0;
  background: var(--accent); transition: width .2s ease;
}

/* --- journal de diagnostic ------------------------------------------------
   Discret par défaut : il ne sert qu'à déboguer depuis un téléphone, où l'on
   n'a pas de console. */
#journal-bloc {
  margin-top: 2.5rem;
  border-top: 1px solid var(--trait);
  padding-top: .8rem;
  font-size: .8rem;
  color: var(--menu);
}
#journal-bloc summary { cursor: pointer; }
#journal {
  margin: .6rem 0;
  padding-left: 1.2rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .72rem;
  line-height: 1.45;
  max-height: 16rem;
  overflow-y: auto;
  word-break: break-word;
}
