/* sibtoprint.fr — page d'attente
   Toutes les cotes de la version ordinateur sont relevées sur la maquette (image de 2576 × 1498 px) :
   --u = échelle de l'image de fond (identique à background-size: cover)
   --k = échelle du texte (= --u sur grand écran, jamais en dessous de 0,7 pour rester lisible) */

:root {
  --u: max(calc(100vw / 2576), calc(100vh / 1498));
  --k: max(var(--u), 0.7px);
  --orange: #f7921c;
  --orange-survol: #ee8710;
  --champ: #dcdcdc;
  --encre: #000;
  --alerte: #b3261e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #bebebe;
  color: var(--encre);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { font-family: 'Montserrat', Arial, Helvetica, sans-serif; }

p, h1 { margin: 0; }

/* ---------- Scène plein écran (ordinateur) ---------- */

.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #bebebe url("fond.jpg") center center / cover no-repeat;
}

.bloc {
  position: absolute;
  /* bord gauche du texte sur la maquette : x = 1183 ; centre de l'image : 1288 × 749 */
  left: calc(50% + (1183 - 1288) * var(--u));
  /* le bloc est centré verticalement sur sa position de la maquette (y ≈ 735) */
  top: calc(50% + (735 - 749) * var(--u) - (735 - 473.5) * var(--k));
  width: calc(799 * var(--k));
}

.logo {
  font-weight: 700;
  font-size: calc(60 * var(--k));
  line-height: calc(60 * var(--k));
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.logo .fr { font-size: calc(36 * var(--k)); line-height: 0; }

.titre {
  margin-top: calc(39 * var(--k));
  font-weight: 400;
  font-size: calc(30.5 * var(--k));
  line-height: calc(29 * var(--k));
  white-space: nowrap;
}
.titre strong { font-weight: 700; }

.liste {
  margin-top: calc(2.5 * var(--k));
  font-style: italic;
  font-weight: 400;
  font-size: calc(20.5 * var(--k));
  line-height: calc(27 * var(--k));
  white-space: nowrap;
}

/* ---------- Formulaire ---------- */

.formulaire { margin-top: calc(39 * var(--k)); }

.ligne {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: calc(11 * var(--k));
}

.champ {
  display: block;
  width: 100%;
  height: calc(57 * var(--k));
  margin: 0;
  padding: 0 calc(24.5 * var(--k));
  border: 0;
  border-radius: calc(3 * var(--k));
  background: var(--champ);
  color: var(--encre);
  font-family: inherit;
  font-weight: 500;
  font-size: calc(17 * var(--k));
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow .15s ease;
}
.champ::placeholder { color: var(--encre); opacity: 1; }
.champ:focus { box-shadow: inset 0 0 0 calc(2 * var(--k)) var(--orange); }
.champ:focus::placeholder { color: #6b6b6b; }
.champ.invalide { box-shadow: inset 0 0 0 calc(2 * var(--k)) var(--alerte); }
.champ:-webkit-autofill,
.champ:-webkit-autofill:hover,
.champ:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--encre);
  -webkit-box-shadow: 0 0 0 1000px var(--champ) inset;
  transition: background-color 9999s;
}

.champ.email { margin-top: calc(13 * var(--k)); }

.bouton {
  display: block;
  width: 100%;
  height: calc(60 * var(--k));
  margin: calc(12 * var(--k)) 0 0;
  padding: 0 calc(16 * var(--k));
  border: 0;
  border-radius: calc(3 * var(--k));
  background: var(--orange);
  color: var(--encre);
  font-family: inherit;
  font-weight: 700;
  font-size: calc(24.5 * var(--k));
  line-height: 1.1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, opacity .15s ease;
}
.bouton:hover { background: var(--orange-survol); }
.bouton:focus-visible { outline: calc(2 * var(--k)) solid var(--encre); outline-offset: calc(2 * var(--k)); }
.bouton[disabled] { opacity: .7; cursor: progress; }

.erreur {
  font-weight: 600;
  font-size: calc(16 * var(--k));
  line-height: calc(22 * var(--k));
  color: var(--alerte);
}
.erreur:not(:empty) { margin-top: calc(12 * var(--k)); }

.mention {
  margin-top: calc(19 * var(--k));
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(15 * var(--k));
  line-height: calc(18 * var(--k));
  letter-spacing: 0.027em;
}
.mention span { display: block; white-space: nowrap; }

/* Zone invisible posée sur le gobelet du fond (cotes de l'image : x 819 → 1069, y 608 → 995) */
.gobelet {
  position: absolute;
  left: calc(50% + (819 - 1288) * var(--u));
  top: calc(50% + (608 - 749) * var(--u));
  width: calc(250 * var(--u));
  height: calc(387 * var(--u));
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Champ piège : invisible pour les humains, présent pour les robots */
.piege {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Message de remerciement ---------- */

.merci {
  display: none;
  margin-top: calc(70.5 * var(--k));
  line-height: calc(29 * var(--k));
}
.merci .m1 { font-weight: 600; font-size: calc(30 * var(--k)); }
.merci .m2 { font-weight: 700; font-size: calc(23.5 * var(--k)); }
.merci [hidden] { display: none; }

.est-merci .formulaire { display: none; }
.est-merci .merci { display: block; animation: apparition .35s ease both; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(calc(6 * var(--k))); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Tablette, mobile et écrans peu hauts ----------
   Le gobelet est placé en haut et le texte passe dessous.
   --s = échelle de l'image de fond dans cette mise en page */

@media (max-width: 1179px), (max-height: 559px) {
  :root { --s: max(0.62px, calc(100vw / 2576)); }

  .scene {
    width: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    background-size: calc(2576 * var(--s)) auto;
    /* gobelet : centre x = 944, haut ≈ 600 sur l'image */
    background-position: calc(50vw - 944 * var(--s)) calc(16px - 600 * var(--s));
  }

  .gobelet {
    left: calc(50vw - 125 * var(--s));
    top: calc(16px + 8 * var(--s));
    width: calc(250 * var(--s));
    height: calc(387 * var(--s));
  }

  .bloc {
    position: static;
    width: auto;
    max-width: 560px;
    margin: 0 auto;
    /* sous le gobelet (bas ≈ 1005 sur l'image) */
    padding: calc(16px + 405 * var(--s) + 18px) 20px 36px;
  }

  .logo { font-size: 40px; line-height: 1; }
  .logo .fr { font-size: 24px; }

  .titre {
    margin-top: 22px;
    font-size: 20px;
    line-height: 1.18;
    white-space: normal;
  }

  .liste {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
  }

  br.d { display: none; }

  .formulaire { margin-top: 24px; }
  .ligne { column-gap: 8px; }
  .champ {
    height: 50px;
    padding: 0 16px;
    border-radius: 3px;
    font-size: 16px; /* 16 px minimum : évite le zoom automatique sur iPhone */
  }
  .champ:focus { box-shadow: inset 0 0 0 2px var(--orange); }
  .champ.invalide { box-shadow: inset 0 0 0 2px var(--alerte); }
  .champ.email { margin-top: 8px; }

  .bouton {
    height: auto;
    min-height: 52px;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 3px;
    font-size: 16px;
    line-height: 1.25;
  }

  .erreur { font-size: 14px; line-height: 1.4; }
  .erreur:not(:empty) { margin-top: 10px; }

  .mention { margin-top: 14px; font-size: 11.5px; line-height: 1.45; letter-spacing: 0; }
  .mention span { display: inline; white-space: normal; }

  .merci { margin-top: 30px; line-height: 1.3; }
  .merci .m1 { font-size: 26px; }
  .merci .m2 { margin-top: 4px; font-size: 18px; }
}

@media (max-width: 359px) {
  .logo { font-size: 34px; }
  .logo .fr { font-size: 21px; }
  .titre { font-size: 18px; }
  .bouton { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .est-merci .merci { animation: none; }
}
