/* LA FEUILLE À ÉTAPES (30/10/2026, handoff Refontes/design_handoff_arrivee_planning).
   Un parcours court (deux ou trois écrans) dans UNE fenêtre : points d'étape, la fenêtre qui change de
   hauteur, et des briques à réutiliser (médaillon, clé du lien qui se retourne sur son QR, raccourcis,
   enveloppe, pastilles, champ mail, boutons en relief, confettis). Construite par js/popotam-feuille.js ;
   premier usage : l'arrivée sur un planning qui vient d'être créé (le lien, puis le mail). Écrite à la
   main, toutes les classes en `fe-`. Sur téléphone (≤ 600 px, la borne de mob()), une feuille du bas ;
   sur ordinateur, un dialogue centré de 440 px. */

.fe-ov {
  --fe-ink: #2A211B; --fe-ink2: #6A5C4C; --fe-muted: #9C8B79;
  --fe-cream: #FFF8EA; --fe-cream2: #FCEFD9; --fe-line: #F0E5CF; --fe-line2: #EEDFC2;
  --fe-orange: #F0682F; --fe-orange-d: #DA541E; --fe-orange-bg: #FCE3D8;
  --fe-green: #33A15B; --fe-green-d: #2C8B4E; --fe-green-bg: #E6F3E9;
  --fe-sun: #FFC53D; --fe-sun-d: #F6A609; --fe-sun-bg: #FFF1D2; --fe-red: #D2452F;
  --fe-fd: "Bricolage Grotesque", system-ui, sans-serif; --fe-fb: "Hanken Grotesk", system-ui, sans-serif;
  --fe-fh: "Caveat", cursive; --fe-fm: "JetBrains Mono", ui-monospace, monospace;
  --fe-spring: cubic-bezier(.3, 1.35, .45, 1); --fe-out: cubic-bezier(.2, .8, .2, 1);
  position: fixed; inset: 0; z-index: 450;
  display: grid; place-items: center; padding: 24px;
  background: rgba(60, 40, 20, .32);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  font-family: var(--fe-fb); color: var(--fe-ink); text-align: center;
  animation: feOvIn .3s var(--fe-out) both;
}
.fe-ov *, .fe-ov *::before, .fe-ov *::after { box-sizing: border-box; }
.fe-ov button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
.fe-ov svg { display: block; }
.fe-ov.fe-out { animation: feOvOut .24s var(--fe-out) both; pointer-events: none; }
@keyframes feOvIn { from { opacity: 0; } }
@keyframes feOvOut { to { opacity: 0; } }
html.fe-verrou, html.fe-verrou body { overflow: hidden; }

.fe {
  position: relative; width: min(440px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; overflow-x: hidden;
  padding: 18px 26px 24px; border-radius: 28px; background: #fff;
  box-shadow: 0 40px 80px -30px rgba(60, 30, 10, .55);
  animation: feIn .5s var(--fe-spring) both;
}
.fe-ov.fe-out .fe { animation: feOut .22s var(--fe-out) both; }
@keyframes feIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes feOut { to { opacity: 0; transform: translateY(14px) scale(.97); } }
.fe-g { display: none; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 5px; background: var(--fe-line2); }

/* l'en-tête : points d'étape, « 1 sur 2 », croix */
.fe-hd { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.fe-dots { display: flex; gap: 5px; }
.fe-dots i { width: 8px; height: 8px; border-radius: 8px; background: var(--fe-line2); transition: width .4s var(--fe-spring), background .3s; }
.fe-dots i.fe-on { width: 24px; background: var(--fe-orange); }
.fe-dots i.fe-ok { background: var(--fe-green); }
.fe-hd small { font: 700 12.5px var(--fe-fb); color: var(--fe-muted); }
.fe-x { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; background: var(--fe-cream2) !important; display: grid; place-items: center; color: var(--fe-ink2); transition: background .2s, transform .3s var(--fe-spring); }
.fe-x:hover { background: var(--fe-line2) !important; color: var(--fe-ink); transform: rotate(90deg); }
.fe-x svg { width: 14px; height: 14px; }
.fe-vp { position: relative; }
.fe-sc[hidden] { display: none; }

/* les tons : succès (vert) et mail (orange) */
.fe-t-ok { --tb: var(--fe-green-bg); --tr: #9ED1AE; --tc: var(--fe-green); --tk: var(--fe-green-d); }
.fe-t-mail { --tb: var(--fe-sun-bg); --tr: var(--fe-sun-d); --tc: var(--fe-orange); --tk: var(--fe-orange-d); }

/* le médaillon (même dessin que la modale basique) */
.fe-art { position: relative; width: 84px; height: 84px; margin: 2px auto 0; border-radius: 50%; background: var(--tb); display: grid; place-items: center; }
.fe-art::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px dashed var(--tr); opacity: .55; }
.fe-art .fe-f { width: 66px; height: 66px; margin-top: 4px; }
.fe-art .fe-f svg { width: 100%; height: 100%; }
.fe-art .fe-bdg { position: absolute; right: -4px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--tc); color: #fff; display: grid; place-items: center; border: 3px solid #fff; }
.fe-art .fe-bdg svg { width: 14px; height: 14px; }
.fe-kk { display: block; margin-top: 12px; font: 700 20px/1 var(--fe-fh); color: var(--tk); }
.fe-tt { margin: 4px 0 0; font: 800 24px/1.12 var(--fe-fd); letter-spacing: -.02em; text-wrap: balance; color: var(--fe-ink); }
.fe-dd { margin: 8px auto 0; max-width: 33ch; font-size: 15px; line-height: 1.5; color: var(--fe-ink2); text-wrap: pretty; }
.fe-dd b { color: var(--fe-ink); }
.fe-note { margin: 10px auto 0; max-width: 36ch; font-size: 13px; line-height: 1.45; color: var(--fe-ink2); }

/* la clé : le lien, et au dos le QR */
.fe-key { position: relative; height: 74px; margin-top: 18px; perspective: 900px; transition: height .55s var(--fe-spring); }
.fe-key.fe-flip { height: 212px; }
.fe-key-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s var(--fe-spring); }
.fe-key.fe-flip .fe-key-in { transform: rotateY(180deg); }
.fe-face { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fe-front { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 12px; background: var(--fe-cream); border: 1.5px dashed var(--fe-line2); text-align: left; }
.fe-front .fe-ic { flex: none; width: 48px; height: 48px; border-radius: 15px; background: var(--fe-orange); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 var(--fe-orange-d); }
.fe-front .fe-ic svg { width: 24px; height: 24px; }
.fe-front .fe-tx { min-width: 0; flex: 1; }
.fe-front small { display: block; font: 800 11px var(--fe-fd); letter-spacing: .1em; text-transform: uppercase; color: var(--fe-muted); }
.fe-front code { display: block; margin-top: 3px; font: 500 13.5px var(--fe-fm); color: var(--fe-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; padding: 0; }
.fe-front code span { color: var(--fe-muted); }
.fe-stamp { position: absolute; right: 10px; top: -12px; padding: 4px 10px; border-radius: 999px; background: var(--fe-green); color: #fff; font: 800 12px var(--fe-fd); display: flex; align-items: center; gap: 5px; transform: scale(0) rotate(-20deg); box-shadow: 0 6px 14px -6px rgba(44, 139, 78, .7); }
.fe-stamp svg { width: 12px; height: 12px; }
.fe-key.fe-copied .fe-stamp { animation: feStamp .5s var(--fe-spring) forwards; }
@keyframes feStamp { to { transform: scale(1) rotate(6deg); } }
.fe-back { transform: rotateY(180deg); display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px; background: var(--fe-sun-bg); text-align: left; }
.fe-back .fe-qr { width: 132px; height: 132px; padding: 8px; border-radius: 14px; background: #fff; }
.fe-back .fe-qr svg { width: 100%; height: 100%; }
.fe-back b { display: block; font: 800 16px/1.2 var(--fe-fd); }
.fe-back p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--fe-ink2); }
.fe-back em { display: block; margin-top: 8px; font-style: normal; font-size: 12px; line-height: 1.35; color: #8A5A10; }

/* les raccourcis, une ligne de tuiles */
.fe-alt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.fe-alt button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 9px; border-radius: 18px; background: #fff; border: 1.5px solid var(--fe-line); font: 700 12.5px var(--fe-fb); color: var(--fe-ink2); transition: border-color .2s, transform .3s var(--fe-spring), background .2s; }
.fe-alt button:hover { border-color: var(--fe-line2); color: var(--fe-ink); transform: translateY(-2px); }
.fe-alt button:active { transform: scale(.96); }
.fe-alt .fe-i { width: 34px; height: 34px; border-radius: 12px; background: var(--fe-cream2); display: grid; place-items: center; color: var(--fe-ink); transition: background .25s; }
.fe-alt .fe-i svg { width: 18px; height: 18px; }
.fe-alt button.fe-done .fe-i { background: var(--fe-green-bg); color: var(--fe-green-d); }
.fe-alt button.fe-done::after { content: ""; position: absolute; right: 8px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--fe-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/10px no-repeat; animation: fePop .4s var(--fe-spring); }
.fe-alt button[aria-pressed="true"] { border-color: var(--fe-sun-d); background: var(--fe-sun-bg); }
@keyframes fePop { from { transform: scale(0); } }

/* les boutons */
.fe-pa { display: grid; gap: 6px; margin-top: 18px; }
.fe-pb { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 18px; border-radius: 999px; font: 800 16px var(--fe-fd); white-space: nowrap; transition: transform .3s var(--fe-spring), background .25s, box-shadow .2s; }
.fe-pb svg { width: 18px; height: 18px; }
.fe-ov .fe-pb.fe-pri { background: var(--fe-orange); color: #fff; box-shadow: 0 3px 0 var(--fe-orange-d); }
.fe-pb.fe-pri:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--fe-orange-d); }
.fe-pb.fe-pri:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--fe-orange-d); }
.fe-ov .fe-pb.fe-pri.fe-done { background: var(--fe-green); box-shadow: 0 3px 0 var(--fe-green-d); }
.fe-pb.fe-busy { pointer-events: none; }
.fe-pb .fe-sp { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: feSpin .7s linear infinite; }
@keyframes feSpin { to { transform: rotate(360deg); } }
.fe-pb.fe-lk { min-height: 44px; font: 700 14.5px var(--fe-fb); color: var(--fe-ink2); }
.fe-pb.fe-lk:hover { color: var(--fe-ink); }

/* l'enveloppe (50 px réservés au-dessus pour le rabat ouvert et la lettre) */
.fe-env { position: relative; width: 140px; height: 88px; margin: 50px auto 0; }
.fe-env .fe-bk { position: absolute; inset: 0; border-radius: 14px; background: #F6B48E; }
.fe-env .fe-lt { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 74px; border-radius: 10px; background: #fff; box-shadow: 0 6px 14px -8px rgba(60, 30, 10, .4); padding: 9px 10px; text-align: left; transform: translateY(-34px); z-index: 1; }
.fe-env .fe-lt small { display: block; font: 700 15px/1 var(--fe-fh); color: var(--fe-orange-d); }
.fe-env .fe-lt b { display: block; margin-top: 2px; font: 800 11px/1.15 var(--fe-fd); color: var(--fe-ink); }
.fe-env .fe-lt b + .fe-wk { margin-top: 4px; }
.fe-env .fe-lt .fe-wk { display: flex; gap: 4px; margin-top: 6px; }
.fe-env .fe-lt .fe-wk i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); }
.fe-env .fe-fr { position: absolute; inset: 0; border-radius: 14px; background: var(--fe-orange); clip-path: polygon(0 34%, 50% 70%, 100% 34%, 100% 100%, 0 100%); z-index: 2; }
.fe-env .fe-fl { position: absolute; left: 0; right: 0; top: 0; height: 50%; background: #E35A22; clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 14px 14px 0 0; transform-origin: 50% 0; transform: rotateX(180deg); z-index: 0; }
.fe-env .fe-seal { position: absolute; left: 50%; top: 52%; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%; background: #fff; border: 3px solid var(--fe-sun); z-index: 4; overflow: hidden; opacity: 0; }
.fe-env .fe-seal svg { width: 100%; height: 100%; }
.fe-sc.fe-in .fe-env { animation: feEnvIn .6s var(--fe-spring) both; }
.fe-sc.fe-in .fe-env .fe-fl { animation: feFlapOpen .45s var(--fe-out) .45s both; }
.fe-sc.fe-in .fe-env .fe-seal { animation: feSealOff .4s var(--fe-out) .35s both; }
.fe-sc.fe-in .fe-env .fe-lt { animation: feLetterUp .6s var(--fe-spring) .8s both, feBob 2.6s ease-in-out 1.6s infinite; }
.fe-sc.fe-in .fe-env .fe-lt .fe-wk i { animation: fePop .35s var(--fe-spring) both; }
@keyframes feEnvIn { from { opacity: 0; transform: translateY(-18px) rotate(-6deg) scale(.9); } }
@keyframes feFlapOpen { 0% { transform: rotateX(0); z-index: 3; } 100% { transform: rotateX(180deg); z-index: 0; } }
@keyframes feSealOff { 0% { opacity: 1; transform: none; } 100% { transform: translateY(-36px) scale(.6); opacity: 0; } }
@keyframes feLetterUp { from { transform: translateY(0); } to { transform: translateY(-34px); } }
@keyframes feBob { 0%, 100% { transform: translateY(-34px); } 50% { transform: translateY(-39px); } }
.fe-env.fe-send .fe-lt { animation: feLetterDown .35s var(--fe-out) forwards !important; }
.fe-env.fe-send .fe-fl { animation: feFlapClose .3s var(--fe-out) .3s both !important; }
.fe-env.fe-send { animation: feFly .7s cubic-bezier(.5, 0, .75, 0) .62s forwards !important; }
@keyframes feLetterDown { from { transform: translateY(-34px); } to { transform: translateY(0); } }
@keyframes feFlapClose { from { transform: rotateX(180deg); z-index: 0; } to { transform: rotateX(0); z-index: 3; } }
@keyframes feFly { to { transform: translate(160px, -150px) rotate(18deg) scale(.5); opacity: 0; } }

/* les pastilles, le champ mail */
.fe-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.fe-chips span { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px; border-radius: 999px; background: var(--fe-cream); border: 1px solid var(--fe-line); font: 700 12.5px var(--fe-fb); color: var(--fe-ink); }
.fe-chips svg { width: 13px; height: 13px; color: var(--fe-green); }
.fe-fld { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-top: 12px; padding: 0 14px; border-radius: 18px; background: var(--fe-cream); border: 2px solid var(--fe-line2); text-align: left; transition: border-color .2s, background .2s, box-shadow .2s; }
.fe-fld:focus-within { border-color: var(--fe-orange); background: #fff; box-shadow: 0 0 0 4px var(--fe-orange-bg); }
.fe-fld > svg { flex: none; width: 20px; height: 20px; color: var(--fe-muted); }
.fe-ov .fe-fld input { flex: 1; min-width: 0; height: 52px; border: 0; background: none; outline: 0; box-shadow: none; padding: 0; font: 600 16px var(--fe-fb); color: var(--fe-ink); }
.fe-fld input::placeholder { color: var(--fe-muted); font-weight: 500; }
.fe-fld .fe-ok { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--fe-green); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform .35s var(--fe-spring); }
.fe-fld .fe-ok svg { width: 13px; height: 13px; }
.fe-fld.fe-valid { border-color: var(--fe-green); }
.fe-fld.fe-valid .fe-ok { transform: scale(1); }
.fe-fld.fe-err { border-color: var(--fe-red); animation: feShake .4s; }
@keyframes feShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.fe-msg { margin: 6px 4px 0; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--fe-red); text-align: left; }
.fe-msg:empty { display: none; }

/* l'entrée des blocs à chaque étape */
.fe-sc.fe-in > * { animation: fePIn .5s var(--fe-spring) both; }
.fe-sc.fe-in > :nth-child(2) { animation-delay: .06s; } .fe-sc.fe-in > :nth-child(3) { animation-delay: .1s; }
.fe-sc.fe-in > :nth-child(4) { animation-delay: .14s; } .fe-sc.fe-in > :nth-child(5) { animation-delay: .18s; }
.fe-sc.fe-in > :nth-child(6) { animation-delay: .22s; } .fe-sc.fe-in > :nth-child(7) { animation-delay: .26s; }
.fe-sc.fe-in > :nth-child(8) { animation-delay: .3s; }
.fe-sc.fe-in > .fe-art { animation: feArtIn .6s var(--fe-spring) both; }
.fe-sc.fe-in > .fe-art .fe-bdg { animation: fePop .45s var(--fe-spring) .45s both; }
.fe-sc.fe-in .fe-front .fe-ic { animation: feTurn .9s var(--fe-spring) .55s both; }
@keyframes fePIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes feArtIn { from { opacity: 0; transform: scale(.4) rotate(-14deg); } }
@keyframes feTurn { 0% { transform: none; } 40% { transform: rotate(-80deg) scale(1.08); } 100% { transform: none; } }
.fe-cf { position: absolute; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; z-index: 9; }

/* téléphone : feuille du bas */
@media (max-width: 600px) {
  .fe-ov { place-items: end stretch; padding: 0; }
  .fe { width: 100%; max-height: calc(100dvh - 24px); padding: 10px 20px calc(28px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; animation: feShIn .55s var(--fe-spring) both; }
  .fe-ov.fe-out .fe { animation: feShOut .25s var(--fe-out) both; }
  .fe-g { display: block; }
  .fe-hd { margin-top: -4px; }
}
@keyframes feShIn { from { transform: translateY(100%); } }
@keyframes feShOut { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  .fe-ov *, .fe-ov *::before, .fe-ov *::after, .fe-ov { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
