/* =============================================================================
 * creneau.lamiedor.be — style page réponse client à une proposition de créneau
 * Extrait fidèle de lmd-creneau-page.html (mockup) — moins la barre preview.
 * =============================================================================
 * ⚠️ Q7 CLAUDE.md : pas de padding en % sur un flex item.
 * ============================================================================= */

:root {
  --sage: #7a8c6e;
  --sage-dark: #5f7156;
  --sage-deep: #3c4835;
  --cream: #f3ede0;
  --cream-warm: #f7f4ec;
  --paper: #fbfaf6;
  --gold: #c9a86a;
  --gold-deep: #a8873f;
  --ink: #2e332a;
  --ink-soft: #6b6f64;
  --line: #e3ded1;
  --red: #a8433a;
  --red-soft: #fdf0ee;
  --ease: cubic-bezier(.22, .8, .28, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Lato, system-ui, sans-serif;
  color: var(--ink);
  background: #dfe3da;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Page réelle (pas de cadre .phone du mockup — on occupe l'écran) */
.page {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

@media (min-width: 481px) {
  body { padding: 40px 20px; }
  .page {
    border-radius: 32px;
    min-height: auto;
    box-shadow: 0 40px 80px -30px rgba(40, 50, 30, .4);
  }
}

/* En-tête */
.head {
  background: var(--sage-deep);
  color: #fff;
  padding: 16px 22px 36px;
  padding-top: max(16px, env(safe-area-inset-top));
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
}
.head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 22px;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
}
.crown {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  color: var(--gold);
  animation: crownIn .6s var(--ease) backwards .1s;
}
@keyframes crownIn { from { opacity: 0; transform: translateY(-6px) scale(.8); } }
.brand { font-family: Caveat, cursive; font-size: 23px; line-height: 1; }
.brandsub { font-size: 9px; letter-spacing: .22em; opacity: .6; margin-top: 1px; }

/* Corps */
.body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 22px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

/* Un seul écran rendu à la fois — pas de switch client (état serveur) */
.screen { animation: screenIn .45s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }

/* Bloc horaire (écran ask) */
.hey { font-size: 15px; font-weight: 700; color: var(--ink-soft); margin: 2px 0 1px; animation: screenIn .45s var(--ease) backwards .05s; }
.title {
  font-family: Caveat, cursive;
  line-height: 1.15;
  margin: 0 0 5px;
  color: var(--sage-deep);
  font-size: clamp(23px, 7.1vw, 28px);
  white-space: nowrap;
}
.reason { font-size: 14px; color: var(--ink-soft); margin: 0 0 13px; line-height: 1.45; }

.slots {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 14px;
  margin-bottom: 11px;
  box-shadow: 0 6px 18px rgba(60, 72, 53, .07);
}
.slot { text-align: center; flex: 1 1 0; }
.slot .lbl { font-size: 10.5px; letter-spacing: .14em; color: var(--ink-soft); margin-bottom: 5px; }
.slot .val { font-family: Lato; font-weight: 900; font-size: 28px; line-height: 1; }
.slot.old .val { color: #b6b3a8; position: relative; display: inline-block; }
.slot.old .val::after {
  content: "";
  position: absolute;
  left: -4px; right: -4px; top: 52%;
  height: 2.5px;
  background: var(--red);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  animation: strike .5s var(--ease) forwards .45s;
}
@keyframes strike { to { transform: scaleX(1); } }
.slot.new .val { color: var(--sage-deep); animation: pulseIn .55s cubic-bezier(.2, 1.5, .4, 1) backwards .7s; }
@keyframes pulseIn { from { opacity: 0; transform: scale(.7); } }
.arrow { flex: 0 0 auto; color: var(--gold); opacity: 0; animation: arrowIn .4s var(--ease) forwards .6s; }
@keyframes arrowIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.arrow svg { width: 26px; height: 26px; display: block; }

/* Deadline */
.deadline {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 13px;
  color: var(--gold-deep);
  background: #fdf8ee;
  border: 1px solid #efe2c6;
  border-radius: 99px;
  padding: 7px 14px;
  margin-bottom: 14px;
}
.deadline b { font-weight: 900; }
.deadline i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Récap commande */
.recap {
  background: var(--cream-warm);
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 16px;
}
.recap .rt { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.recap .ref { font-size: 11px; letter-spacing: .1em; color: var(--ink-soft); }
.recap .amt { font-weight: 900; font-size: 16px; }
.recap ul {
  list-style: none; margin: 0; padding: 0;
  position: relative;
  max-height: 74px; /* ~3 lignes puis scroll interne */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cfc8b6 transparent;
}
.recap ul::-webkit-scrollbar { width: 4px; }
.recap ul::-webkit-scrollbar-thumb { background: #cfc8b6; border-radius: 99px; }
.recap li { font-size: 14px; color: var(--ink-soft); padding: 3px 0; display: flex; gap: 8px; }
.recap li b { color: var(--ink); font-weight: 700; flex: 0 0 auto; }
.recap .wrap { position: relative; }
.recap .wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 4px; bottom: 0;
  height: 26px;
  pointer-events: none;
  background: linear-gradient(rgba(247, 244, 236, 0), var(--cream-warm));
  opacity: 0;
  transition: opacity .2s ease;
}
.recap .wrap.more::after { opacity: 1; }
.recap .count {
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  display: none;
}
.recap .count.on { display: block; }

/* Boutons */
.btn {
  width: 100%;
  min-height: 50px;
  font: inherit; font-weight: 700; font-size: 16px;
  cursor: pointer;
  border-radius: 99px;
  border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  gap: 9px;
  transition: background .18s, color .18s, border-color .18s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn-yes {
  background: var(--sage-deep); color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 8px 20px rgba(60, 72, 53, .26);
}
.btn-yes:hover { background: #2f3a2a; }
.btn-no {
  background: transparent; color: var(--ink-soft);
  border-color: var(--line);
}
.btn-no:hover { border-color: #cfc8b6; color: var(--ink); }
.btn-no.armed {
  background: var(--red-soft); border-color: var(--red); color: var(--red);
  animation: shake .32s ease;
}
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.btn-call { background: var(--gold); color: #3a2e10; margin-top: 10px; text-decoration: none; }
.btn-call:hover { background: #d6b779; }
.btn-ghost {
  background: transparent; color: var(--ink-soft);
  border-color: var(--line);
  margin-top: 9px;
  text-decoration: none;
}
.btn svg { width: 19px; height: 19px; flex: 0 0 auto; }

/* Pied */
.foot {
  text-align: center;
  padding: 13px 0 2px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.foot p { margin: 0 0 4px; font-size: 12.5px; color: var(--ink-soft); }
.foot a { color: var(--sage-dark); font-weight: 700; text-decoration: none; }

/* Écran succès */
.hero-ok { text-align: center; padding: 26px 0 8px; }
.check {
  width: 88px; height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--sage-deep);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  animation: popIn .55s cubic-bezier(.2, 1.6, .4, 1) backwards .05s;
}
@keyframes popIn { from { opacity: 0; transform: scale(.3); } }
.check::before {
  content: "";
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--sage);
  opacity: .55;
  animation: ring .9s ease-out forwards .3s;
}
@keyframes ring { to { transform: scale(1.5); opacity: 0; } }
.check svg { width: 44px; height: 44px; color: #fff; }
.check svg path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .45s ease forwards .35s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-ok h2 { font-family: Caveat, cursive; font-size: 33px; margin: 0 0 6px; color: var(--sage-deep); }
.bigtime {
  font-weight: 900; font-size: 52px; line-height: 1;
  color: var(--sage-deep);
  margin: 14px 0 6px;
  animation: popIn .5s cubic-bezier(.2, 1.5, .4, 1) backwards .5s;
}
.bigday { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 4px; }
.hero-ok .sub { font-size: 14.5px; color: var(--ink-soft); margin: 14px 0 0; line-height: 1.55; }

/* Confettis */
.conf { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.conf i {
  position: absolute; top: -14px;
  width: 12px; height: 12px;
  color: var(--gold);
  animation: fall 2.6s linear forwards;
}
.conf i svg { width: 100%; height: 100%; display: block; }
@keyframes fall { to { transform: translateY(760px) rotate(400deg); opacity: 0; } }

/* Écran refus */
.hero-no { text-align: center; padding: 22px 0 4px; }
.hero-no .mark {
  width: 74px; height: 74px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  animation: popIn .5s var(--ease) backwards;
}
.hero-no .mark svg { width: 34px; height: 34px; color: var(--ink-soft); }
.hero-no h2 { font-family: Caveat, cursive; font-size: 31px; margin: 0 0 8px; color: var(--sage-deep); }
.hero-no p { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.55; }
.sorry, .hero-no .sorry, .hero-ok .sorry {
  font-family: Caveat, cursive;
  font-size: 23px; line-height: 1.3;
  color: var(--gold-deep);
  text-align: center;
  margin: 18px auto 0;
  max-width: none;
  animation: screenIn .5s var(--ease) backwards .55s;
}
.sep {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
}
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* États neutres */
.hero-flat { text-align: center; padding: 34px 0 8px; }
.hero-flat .mark {
  width: 70px; height: 70px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
}
.hero-flat .mark svg { width: 32px; height: 32px; color: var(--ink-soft); }
.hero-flat h2 { font-family: Caveat, cursive; font-size: 29px; margin: 0 0 8px; color: var(--sage-deep); }
.hero-flat p { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 6px; line-height: 1.55; }
.hero-flat .stamp {
  display: inline-block;
  font-weight: 900; font-size: 15px;
  color: var(--sage-deep);
  background: var(--cream-warm);
  border-radius: 99px;
  padding: 7px 16px;
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .slot.old .val::after { transform: scaleX(1); }
  .arrow { opacity: 1; }
}
