/* La table et le tirage : le client dépose une vraie photo sur une table éclairée. La couleur vient de sa marque. */
@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: block;
}

:root {
  --accent: #EA5428;
  --sur-accent: #3A0A0E;
  --encre: #2A1517;
  --doux: #6E5A52;
  --papier: #FFFFFF;
  --table-clair: #F9F3E9;
  --table: #F4ECDF;
  --trait: #DDD0BC;
  --alerte: #A3231B;
  --ombre-tirage: 0 1px 1px rgb(58 24 24 / .16), 0 4px 8px rgb(58 24 24 / .10), 0 22px 36px -14px rgb(58 24 24 / .38);
  --ombre-bouton: inset 0 1px 0 rgb(255 255 255 / .25), 0 1px 1px rgb(58 24 24 / .22), 0 8px 16px -6px rgb(58 24 24 / .40);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--encre);
  font: 400 18px/1.45 'Bricolage', system-ui, sans-serif;
  background: radial-gradient(130% 80% at 18% 0%, var(--table-clair), var(--table) 62%) fixed var(--table);
}

main {
  max-width: 460px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h1 { font-size: 34px; line-height: 1.05; font-weight: 800; margin: 0; letter-spacing: -.015em; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 700; margin: 10px 0 0; }
p { margin: 0; }
a { color: inherit; }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.logo-papigo { display: block; width: 132px; height: auto; margin: 4px 0 6px; }
.entete img { width: 130px; height: auto; max-height: 72px; object-fit: contain; object-position: left center; }
.entete .nom { font-size: 25px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.entete a { font-size: 16px; color: var(--doux); white-space: nowrap; padding: 8px 0; }

/* Le tirage : l'objet de la page. */
.tirage {
  display: block;
  position: relative;
  background: var(--papier);
  padding: 12px 12px 14px;
  border-radius: 3px;
  box-shadow: var(--ombre-tirage);
  transform: rotate(-1deg);
  transition: transform .16s ease, box-shadow .16s ease;
}
.tirage img, .tirage video { display: block; width: 100%; max-height: 62dvh; object-fit: contain; background: #EFE7D9; }
.tirage.pose { animation: pose .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes pose { from { transform: rotate(-3deg) translateY(-14px) scale(1.03); } to { transform: rotate(-1deg); } }

.avant-apres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.avant-apres figure { margin: 0; padding: 8px 8px 6px; transform: none; }
.avant-apres img { max-height: 46dvh; }
.avant-apres figcaption { padding-top: 6px; font-weight: 700; text-align: center; }

.tirage.compact { align-self: center; width: fit-content; max-width: 100%; }
.tirage.compact img, .tirage.compact video { width: auto; max-width: 100%; max-height: 27dvh; }

label.tirage { cursor: pointer; }
label.tirage:active { transform: rotate(-1deg) translateY(2px) scale(.992); box-shadow: 0 1px 1px rgb(58 24 24 / .2), 0 6px 12px -6px rgb(58 24 24 / .35); }
label.tirage:focus-within { outline: 3px solid var(--encre); outline-offset: 4px; }
label.tirage input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.fenetre {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 20px;
  color: var(--sur-accent);
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent) 55%, color-mix(in srgb, var(--accent) 80%, black));
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08), inset 0 10px 24px -14px rgb(0 0 0 / .5);
}
.fenetre svg { width: 56px; height: 56px; }
.fenetre strong { font-size: 35px; line-height: 1.02; font-weight: 800; letter-spacing: -.02em; }

.bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  font: 700 20px/1.15 'Bricolage', system-ui, sans-serif;
  color: var(--sur-accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, white), var(--accent));
  box-shadow: var(--ombre-bouton);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.bouton:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgb(0 0 0 / .25); }
.bouton:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.bouton[disabled] { opacity: .55; cursor: default; }
.bouton.discret { color: var(--encre); background: var(--papier); box-shadow: inset 0 0 0 1px var(--trait), 0 1px 2px rgb(58 24 24 / .10); font-weight: 600; }
.bouton.danger { color: #fff; background: linear-gradient(180deg, #B83027, var(--alerte)); }
.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.champ { display: flex; flex-direction: column; gap: 6px; }
.champ > span { font-weight: 600; }
textarea, input[type='email'], input[type='text'], input[type='datetime-local'], input[inputmode='numeric'] {
  width: 100%;
  min-height: 56px;
  padding: 14px;
  font: inherit;
  color: var(--encre);
  background: var(--papier);
  border: 0;
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgb(58 24 24 / .18), inset 0 0 0 1px var(--trait);
}
/* La hauteur suit le texte, jamais le focus : si le champ rapetissait en le quittant, « Envoyer » bougerait sous le doigt et l'appui se perdrait. */
textarea { min-height: 62px; max-height: 160px; field-sizing: content; resize: vertical; overflow-wrap: anywhere; }
#texte { height: 170px; max-height: none; }
input[inputmode='numeric'] { font-size: 30px; font-weight: 700; letter-spacing: .25em; text-align: center; }

.choix-quand { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 4px; background: rgb(58 24 24 / .08); border-radius: 13px; box-shadow: inset 0 1px 2px rgb(58 24 24 / .14); }
label.choix { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 6px; text-align: center; font-weight: 600; font-size: 17px; line-height: 1.1; border-radius: 10px; cursor: pointer; }
label.choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.choix:has(input:checked) { background: var(--papier); box-shadow: 0 1px 2px rgb(58 24 24 / .25), 0 3px 8px -3px rgb(58 24 24 / .3); }
label.choix:has(input:focus-visible) { outline: 3px solid var(--encre); outline-offset: 1px; }

.action-fixe { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 2; }

.alerte { padding: 14px; border-radius: 10px; background: #FBEDEB; color: var(--alerte); font-weight: 600; box-shadow: inset 0 0 0 1px #E9BDB8; }
.info { color: var(--doux); }
.note-papier { padding: 14px; background: var(--papier); border-radius: 3px; box-shadow: 0 1px 2px rgb(58 24 24 / .16), 0 8px 14px -8px rgb(58 24 24 / .28); white-space: pre-wrap; overflow-wrap: anywhere; }
.lien { display: block; width: 100%; min-height: 56px; padding: 16px 0; border: 0; background: none; font: inherit; color: var(--doux); text-decoration: underline; cursor: pointer; text-align: center; }

.jauge { height: 12px; border-radius: 6px; background: rgb(58 24 24 / .12); box-shadow: inset 0 1px 2px rgb(58 24 24 / .2); overflow: hidden; }
.jauge div { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

.envois { display: flex; flex-direction: column; gap: 8px; }
.envoi { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 8px; border: 0; border-radius: 10px; background: rgb(255 255 255 / .62); font: inherit; color: inherit; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgb(58 24 24 / .12); }
.envoi img, .envoi .vide { width: 56px; height: 56px; object-fit: cover; background: #E7DCC9; border-radius: 3px; }
.envoi span { display: block; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.envoi small { display: block; font-size: 15px; color: var(--doux); }

.aide { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-radius: 10px; background: rgb(255 255 255 / .62); box-shadow: inset 0 0 0 1px var(--trait); }
.pied { margin-top: 8px; font-size: 14px; color: var(--doux); text-align: center; }

/* Pages simples des liens de courriel. */
.simple blockquote { margin: 0; padding: 14px; background: var(--papier); border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }


/* L'installation : des étapes qu'on suit du doigt, une à la fois. */
.etapes { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: etape; }
.etapes li { counter-increment: etape; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--papier); box-shadow: 0 1px 2px rgb(58 24 24 / .14), 0 8px 14px -10px rgb(58 24 24 / .28); }
.etapes li::before { content: counter(etape); display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; color: var(--sur-accent); background: var(--accent); }
.etapes strong { display: block; font-weight: 700; line-height: 1.25; }
.etapes small { display: block; margin-top: 2px; font-size: 15px; line-height: 1.3; color: var(--doux); }
.etapes svg { width: 28px; height: 28px; color: #2478F2; }

@media (prefers-reduced-motion: reduce) {
  .tirage, .tirage.pose, .jauge div { animation: none; transition: none; }
}
