/* Charte de Leslie. Les polices sont servies d'ici et pas par Google, pour ne pas lui envoyer l'adresse IP des salariés. */
@font-face { font-family: Montserrat; src: url(polices/montserrat.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Lato; src: url(polices/lato-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Lato; src: url(polices/lato-400-italique.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Lato; src: url(polices/lato-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --creme: #F5F0E6;
  --creme-clair: #FBF8F2;
  --blanc: #FFFFFF;
  --olive: #708238;
  --olive-pale: #EDF0E2;
  --accent: #D97C4E;
  --cafe: #4a2e20;
  --texte: #2E2E2E;
  --gris: #6b6b6b;
  --bord: rgb(74 46 32 / .08);
  --ombre: 0 1px 2px rgb(74 46 32 / .06), 0 8px 24px -8px rgb(74 46 32 / .14);
  --titres: Montserrat, -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --corps: Lato, -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* La barre de défilement garde toujours sa place : la page ne saute pas de côté d'un écran à l'autre. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(120% 60% at 100% 0%, rgb(217 124 78 / .12), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgb(112 130 56 / .10), transparent 60%),
    var(--creme);
  background-attachment: fixed;
  color: var(--texte);
  font: 1.0625rem/1.55 var(--corps);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2 { font-family: var(--titres); color: var(--cafe); letter-spacing: -.02em; }
h1 { font-size: 1.85rem; line-height: 1.15; font-weight: 800; margin: 0; }
h2 { font-size: 1.4rem; line-height: 1.25; font-weight: 750; margin: 0; }
a { color: var(--cafe); }

/* Le titre reçoit le focus pour les lecteurs d'écran, sans cadre visible. */
[tabindex="-1"]:focus { outline: none; }
/* Safari dessine un cadre bleu au toucher : on ne le garde que pour la navigation au clavier. */
:focus:not(:focus-visible) { outline: none; }

.entete {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 32rem;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: linear-gradient(var(--creme) 70%, transparent);
}
.nom-entreprise { font: 750 1rem var(--titres); color: var(--cafe); letter-spacing: -.01em; }
.logo-entreprise { max-height: 36px; max-width: 60%; }
.jauge-rond {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blanc);
  box-shadow: var(--ombre);
}
.jauge { width: 30px; height: 30px; }
#jauge-niveau { transform: translateY(30px); transition: transform .5s cubic-bezier(.3, .8, .3, 1); }

/* La barre de progression se range entre le nom de l'entreprise et la tasse. */
.entete { gap: 14px; }
.nom-entreprise, .logo-entreprise { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jauge-rond { flex: none; order: 3; }
.progression {
  order: 2;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgb(74 46 32 / .1);
  box-shadow: inset 0 1px 2px rgb(74 46 32 / .12);
  overflow: hidden;
}
.progression span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .5s cubic-bezier(.3, .8, .3, 1);
}

main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 16px 20px calc(32px + env(safe-area-inset-bottom));
}

.ecran { display: flex; flex-direction: column; gap: 16px; animation: entree .35s cubic-bezier(.3, .8, .3, 1); }
.ecran[hidden] { display: none; }
.ecran:not(.question) { text-align: center; align-items: center; padding-top: 8px; }
@keyframes entree { from { opacity: 0; transform: translateY(12px); } }

.medaillon {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--blanc), var(--creme-clair));
  box-shadow: var(--ombre), inset 0 0 0 8px rgb(217 124 78 / .08);
}
.medaillon .tasse { width: 84px; height: 84px; }
.medaillon .vapeur { animation: fumee 2.6s ease-in-out infinite; }
.medaillon .vapeur:nth-of-type(2) { animation-delay: .4s; }
.medaillon .vapeur:nth-of-type(3) { animation-delay: .8s; }
@keyframes fumee {
  0%, 100% { opacity: .2; transform: translateY(3px); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.tasse { width: 96px; height: 96px; }
.tasse .trait { fill: none; stroke: var(--cafe); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tasse .vapeur, .jauge .trait { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.jauge .trait { stroke: var(--cafe); stroke-width: 3; }
.tasse .froid { stroke: #6f8fa6; }

.pastille {
  margin: 4px 0 -4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(217 124 78 / .12);
  color: #a4532c;
  font: 700 .8rem var(--titres);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.chapeau { margin: 0; color: var(--gris); max-width: 24rem; }

.leslie {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin: 4px 0;
  padding: 14px 16px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 20px;
  box-shadow: var(--ombre);
  text-align: left;
}
.leslie img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  flex: none;
  box-shadow: 0 0 0 3px var(--blanc), 0 0 0 5px var(--olive);
}
.leslie figcaption { font-size: .95rem; line-height: 1.45; color: var(--texte); }
.leslie strong { display: block; font: 750 .95rem var(--titres); color: var(--cafe); margin-bottom: 2px; }

.bouton {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 18px 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  color: #fff;
  font: 750 1.15rem var(--titres);
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, black), inset 0 1px 0 rgb(255 255 255 / .25);
  transition: transform .15s, box-shadow .15s;
}
.bouton:active { transform: scale(.98); box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--accent) 80%, black); }

.etape {
  align-self: flex-start;
  margin: 8px 0 0;
  font: 750 .85rem var(--titres);
  color: var(--accent);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.etape span { color: var(--gris); font-weight: 600; }
.aide { margin: -6px 0 0; color: var(--gris); font-style: italic; }

.choix { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.option {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 1.5px solid var(--bord);
  border-radius: 18px;
  background: var(--blanc);
  box-shadow: 0 1px 2px rgb(74 46 32 / .05);
  color: var(--texte);
  font: 1.05rem var(--corps);
  text-align: left;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
}
.option:active { transform: scale(.98); }
.option[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
@media (hover: hover) {
  .option:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
}
.option:focus-visible, .bouton:focus-visible, .discret:focus-visible, .lien-grave:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--olive);
  outline-offset: 2px;
}
.option-tasse .tasse {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 4px;
  border-radius: 14px;
  background: var(--creme-clair);
}
.option-tasse span { display: flex; flex-direction: column; line-height: 1.25; color: var(--gris); font-size: .95rem; }
.option-tasse strong { font: 750 1.05rem var(--titres); color: var(--cafe); letter-spacing: -.01em; }

textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--bord);
  border-radius: 18px;
  background: var(--blanc);
  box-shadow: inset 0 1px 2px rgb(74 46 32 / .05);
  font: 1.05rem/1.45 var(--corps);
  color: var(--texte);
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea::placeholder { color: #a39a90; }
.prudence { margin: 0; font-size: .8rem; color: var(--gris, #8a8076); }

.navigation { display: flex; justify-content: space-between; margin-top: 4px; }
.discret {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: none;
  padding: 10px 14px;
  color: var(--gris);
  font: 600 .95rem var(--corps);
  cursor: pointer;
}
.discret:active { background: var(--bord); }

.lien-grave {
  appearance: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgb(112 130 56 / .25);
  border-radius: 999px;
  background: var(--olive-pale);
  padding: 8px 14px;
  color: #4d5a26;
  font: 700 .85rem var(--corps);
  cursor: pointer;
}
.lien-grave::before { content: "!"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--olive); color: #fff; font-size: .75rem; }

.medaillon-merci { position: relative; }
.medaillon-merci::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--olive);
  color: #fff;
  font: 800 1.1rem var(--titres);
  box-shadow: 0 0 0 4px var(--creme);
  animation: tampon .4s .2s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes tampon { from { transform: scale(0); } }

.compteur {
  margin: 0;
  padding: 12px 18px;
  border-radius: 18px;
  background: var(--blanc);
  box-shadow: var(--ombre);
  font-size: 1rem;
}
.compteur strong { font: 800 1.6rem var(--titres); color: var(--accent); vertical-align: -2px; margin-right: 2px; }
.en-attente { margin: 0; background: #fff3e8; border-radius: 16px; padding: 12px 16px; }

.bouge {
  width: 100%;
  text-align: left;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 20px;
  box-shadow: var(--ombre);
  padding: 16px 18px;
}
.bouge h2 { font-size: 1.05rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.bouge h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 4px var(--olive-pale); }
.bouge ul { margin: 0; padding-left: 1.1rem; }
.bouge li + li { margin-top: 8px; }

dialog {
  max-width: 30rem;
  width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 0;
  border-radius: 22px;
  padding: 18px 18px 16px;
  background: var(--blanc);
  color: var(--texte);
  font-size: .92rem;
  line-height: 1.42;
  box-shadow: 0 24px 60px -12px rgb(46 46 46 / .35);
}
dialog[open] { animation: entree .3s cubic-bezier(.3, .8, .3, 1); }
dialog::backdrop { background: rgb(46 46 46 / .45); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.2rem; margin-bottom: 6px; }
dialog p { margin: 0 0 8px; }
dialog ul { margin: 0 0 10px; padding-left: 1.1rem; }
dialog li + li { margin-top: 3px; }
dialog a[href^="tel:"] { white-space: nowrap; }
dialog form { display: flex; justify-content: center; }
dialog .bouton { padding: 12px 20px; font-size: 1rem; }
.urgence { font-weight: 700; padding: 10px 12px; border-radius: 14px; background: #fff3e8; }

.page-simple { text-align: center; padding-top: 15vh; }
.logo-leslie { width: 120px; }
.discret-texte { color: var(--gris); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Le mot du patron : la case d'accord pour le partager. */
.accord {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--blanc);
  border: 1.5px solid var(--bord);
  cursor: pointer;
}
.accord input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.aide-accord { margin: -8px 0 0; font-size: .88rem; color: var(--gris); }

/* Rappel du vendredi sur le téléphone, à l'écran merci. */
.rappel-push {
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--blanc);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}
.rappel-push p { margin: 0 0 10px; }
.rappel-push p:last-child { margin-bottom: 0; }
.bouton-clair {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: color-mix(in srgb, var(--accent) 70%, black);
  box-shadow: none;
  font-size: 1rem;
  padding: 12px 20px;
}
.aide-push { font-size: .9rem; color: var(--gris); }

.pied { text-align: center; font-size: .85rem; color: var(--gris); margin: 8px 0 24px; }
.pied a { color: var(--gris); }

/* Pages de texte : confidentialité, mentions légales. */
.page-texte { padding-top: 16px; }
.page-texte h1 { margin-bottom: 12px; }
.page-texte h2 { font-size: 1.1rem; margin: 22px 0 6px; }
.page-texte p { margin: 0 0 10px; }
.chapeau-texte { font-size: 1.1rem; }

/* Tablette et ordinateur : le café devient une carte posée au centre de l'écran. */
@media (min-width: 700px) {
  body:not(.leslie-espace):not(.page-affiche) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
  }
  body:not(.leslie-espace):not(.page-affiche) > .entete,
  body:not(.leslie-espace):not(.page-affiche) > main { width: 100%; max-width: 38rem; }
  body:not(.leslie-espace):not(.page-affiche) > .entete {
    position: relative;
    background: none;
    padding: 0 8px 18px;
  }
  #cafe, .page-texte {
    padding: 36px 44px 40px;
    border-radius: 32px;
    background: rgb(255 255 255 / .6);
    border: 1px solid var(--bord);
    box-shadow: 0 30px 60px -30px rgb(74 46 32 / .25);
  }
  .page-texte { max-width: 44rem !important; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.55rem; }
  .medaillon { width: 150px; height: 150px; }
  .medaillon .tasse { width: 96px; height: 96px; }
  .question .choix { gap: 12px; }
  .pied { margin-bottom: 0; }
}

/* Grand écran : les cinq tasses côte à côte, à cliquer comme des cartes. */
@media (min-width: 1000px) {
  body:not(.leslie-espace):not(.page-affiche) > .entete,
  body:not(.leslie-espace):not(.page-affiche) > main { max-width: 46rem; }
  .question .choix:has(.option-tasse) { display: grid; grid-template-columns: repeat(5, 1fr); }
  .option-tasse { flex-direction: column; text-align: center; padding: 18px 8px; min-height: 0; }
  .option-tasse .tasse { width: 64px; height: 64px; }
  .option-tasse span { align-items: center; }

}

/* Effet de survol seulement avec une souris : sur tablette, la carte touchée ne reste pas soulevée. */
@media (min-width: 1000px) and (hover: hover) {
  .option:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgb(74 46 32 / .35); }
}

/* Rappel par mail, à l'écran merci. */
.rappel-mail {
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--blanc);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  text-align: left;
}
.rappel-mail label { display: block; margin-bottom: 10px; text-align: center; }
.rappel-mail-ligne { display: flex; gap: 8px; }
.rappel-mail-ligne[hidden] { display: none; }
.rappel-mail input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--bord);
  border-radius: 14px;
  font: 1rem var(--corps);
  color: var(--texte);
}
.rappel-mail input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.rappel-mail .bouton { width: auto; flex: none; }
.rappel-mail .aide-push { margin: 10px 0 0; text-align: center; }
.rappel-mail [hidden] { display: none; }
.sans-coupure { white-space: nowrap; }

/* Le logo du café : la tasse se remplit et la vapeur dessine le monogramme de Leslie. */
.logo-cafe { width: 150px; height: 150px; align-self: center; filter: drop-shadow(0 14px 24px rgb(74 46 32 / .18)); }
@media (min-width: 700px) { .logo-cafe { width: 170px; height: 170px; } }

/* La question libre sous les tasses : elle s'ouvre une fois la tasse choisie. */
.relance { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--bord); }
.relance label { font: 750 1.1rem/1.3 var(--titres); color: var(--cafe); letter-spacing: -.01em; }
.relance:not(.ouverte) .bouton { opacity: .45; pointer-events: none; }

.choix-relance { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille-choix { appearance: none; border: 1px solid var(--bord); border-radius: 999px; padding: 9px 16px; background: #fff; font: 600 .95rem var(--corps); color: var(--texte); cursor: pointer; }
.pastille-choix[aria-pressed="true"] { background: var(--cafe); border-color: var(--cafe); color: #fff; }

.question[data-mot] textarea { margin-top: 4px; }

/* Le mot de Leslie : une ligne par phrase ; le premier mot, plus long, garde la photo en haut. */
.leslie .ligne-mot { display: block; }
.leslie-long { align-items: flex-start; }
.leslie-long .ligne-mot + .ligne-mot { margin-top: 6px; }
.leslie-long .ligne-mot:first-of-type { font-weight: 700; color: var(--cafe); }
