/* =====================================================================
   « صوّر الورقة ديالك » — preuve photo (js/preuve.js)
   ===================================================================== */
.pv-bloque{ overflow:hidden; }
.pv-zone{ margin:18px auto 0; max-width:470px; width:100%; text-align:start; }
.pv-zone svg{ width:1em; height:1em; }

/* ---------- le bouton ---------- */
.pv-cta{ position:relative; width:100%; display:flex; align-items:center; gap:14px; padding:14px 16px; border-radius:22px; cursor:pointer;
  color:var(--papier); text-align:start; font:inherit;
  background:linear-gradient(135deg, rgba(155,77,224,.24), rgba(255,217,0,.07)); border:1.5px dashed rgba(255,217,0,.5);
  transition:transform .35s var(--spring), border-color .2s, box-shadow .3s; }
.pv-cta:hover{ transform:translateY(-2px); border-style:solid; box-shadow:0 18px 40px -22px rgba(255,217,0,.55); }
.pv-cta:active{ transform:scale(.98); }
.pv-cta-ico{ position:relative; flex:0 0 52px; height:52px; border-radius:50%; display:grid; place-items:center; overflow:hidden;
  background:var(--jaune); color:#140f00; box-shadow:0 0 0 6px rgba(255,217,0,.14); font-size:26px; }
.pv-flash{ position:absolute; inset:0; background:#fff; opacity:0; animation:pv-flash 3.6s 1.2s infinite; }
@keyframes pv-flash{ 0%,86%,100%{ opacity:0 } 88%{ opacity:.95 } 92%{ opacity:0 } }
.pv-cta-txt{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.pv-cta-txt b{ font:700 16px/1.25 var(--f-titre); }
.pv-cta-txt small{ font:500 12.5px/1.5 var(--f-ar-texte); color:var(--gris); text-align:start; }
.pv-xp{ flex:0 0 auto; padding:5px 10px; border-radius:99px; font:700 12px/1 var(--f-mono); color:var(--jaune-txt, #FFD900);
  background:rgba(255,217,0,.12); border:1px solid rgba(255,217,0,.35); white-space:nowrap; }
.pv-note{ margin:8px 2px 0; font:500 12px/1.6 var(--f-ar-texte); color:var(--gris); text-align:center; }

/* ---------- l'état après l'envoi ---------- */
.pv-etat{ display:flex; align-items:flex-start; gap:16px; padding:14px; border-radius:22px; background:rgba(var(--fg),.04); border:1px solid rgba(var(--fg),.1); }
.pv-polaroid{ position:relative; flex:0 0 88px; padding:6px 6px 18px; background:#fff; border:0; border-radius:4px; cursor:zoom-in;
  transform:rotate(-3deg); box-shadow:0 14px 28px -12px rgba(0,0,0,.7); transition:transform .35s var(--spring); }
.pv-polaroid:hover{ transform:rotate(0) scale(1.04); }
.pv-polaroid img{ display:block; width:100%; aspect-ratio:3/4; object-fit:cover; background:#eee; border-radius:2px; }
.pv-nb{ position:absolute; top:-8px; inset-inline-end:-8px; min-width:22px; height:22px; padding:0 6px; border-radius:99px; display:grid; place-items:center;
  background:var(--violet-clair); color:#fff; font:700 12px/1 var(--f-mono); font-style:normal; }
.pv-tampon{ position:absolute; inset-inline-end:-10px; bottom:-6px; width:40px; height:40px; border-radius:50%; display:grid; place-items:center;
  font:900 22px/1 var(--f-titre); font-style:normal; color:#16a34a; background:rgba(255,255,255,.92); border:3px double currentColor;
  transform:rotate(-14deg); animation:pv-tamponner .55s .2s var(--spring) both; }
.pv-tampon-r{ color:#ea7a0a; }
@keyframes pv-tamponner{ from{ opacity:0; transform:rotate(-14deg) scale(2.6) } to{ opacity:1; transform:rotate(-14deg) scale(1) } }
.pv-etat-txt{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.pv-pill{ display:inline-flex; align-items:center; gap:8px; padding:7px 12px; border-radius:99px; font:600 13px/1.45 var(--f-ar-texte);
  background:rgba(155,77,224,.16); color:#d6b8ff; border:1px solid rgba(155,77,224,.35); }
.pv-auto .pv-pill, .pv-ok .pv-pill{ background:rgba(37,211,102,.12); color:#7ee8a6; border-color:rgba(37,211,102,.35); }
.pv-refaire .pv-pill{ background:rgba(255,145,40,.13); color:#ffbe7a; border-color:rgba(255,145,40,.4); }
.pv-pouls{ width:8px; height:8px; border-radius:50%; background:#c79bff; box-shadow:0 0 0 0 rgba(199,155,255,.7); animation:pv-pouls 1.6s infinite; }
@keyframes pv-pouls{ 70%{ box-shadow:0 0 0 9px rgba(199,155,255,0) } 100%{ box-shadow:0 0 0 0 rgba(199,155,255,0) } }
.pv-bulle{ position:relative; margin:0; padding:10px 13px; border-radius:4px 16px 16px 16px; background:rgba(var(--fg),.07); font-size:14px; line-height:1.6; color:var(--papier); }
.pv-bulle b{ display:block; font:700 12px/1.4 var(--f-ar-titre); color:var(--jaune-txt, #FFD900); margin-bottom:2px; }
.pv-lien{ display:inline-flex; align-items:center; gap:7px; padding:7px 12px; border-radius:99px; border:1px solid rgba(var(--fg),.18); background:transparent;
  color:var(--papier); font:600 13px/1.2 var(--f-texte); cursor:pointer; }
.pv-lien svg{ width:16px; height:16px; }
.pv-lien-fort{ background:var(--jaune); color:#140f00; border-color:transparent; }

/* ---------- voile + feuille ---------- */
.pv-voile{ position:fixed; inset:0; z-index:10050; display:flex; align-items:flex-end; justify-content:center;
  background:rgba(8,5,14,.66); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); opacity:0; transition:opacity .3s; }
.pv-voile.on{ opacity:1; }
.pv-feuille{ position:relative; width:min(100%, 520px); max-height:94vh; overflow:auto; padding:10px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius:28px 28px 0 0; color:var(--papier);
  background:radial-gradient(120% 70% at 50% -10%, rgba(155,77,224,.32), transparent 60%), var(--encre-2, #140F1E);
  border:1px solid rgba(var(--fg),.1); border-bottom:0; box-shadow:0 -30px 80px -20px rgba(0,0,0,.7);
  transform:translateY(105%); transition:transform .55s var(--ease); }
.pv-voile.on .pv-feuille{ transform:none; }
@media (min-width:700px){ .pv-voile{ align-items:center; } .pv-feuille{ border-radius:28px; border-bottom:1px solid rgba(var(--fg),.1); transform:translateY(40px) scale(.96); opacity:0; transition:transform .5s var(--spring), opacity .3s; }
  .pv-voile.on .pv-feuille{ opacity:1; } }
.pv-poignee{ display:block; width:44px; height:5px; border-radius:9px; margin:0 auto 10px; background:rgba(var(--fg),.22); }
.pv-tete{ display:flex; align-items:center; gap:12px; }
.pv-tete-ico{ flex:0 0 44px; height:44px; border-radius:14px; display:grid; place-items:center; background:var(--jaune); color:#140f00; font-size:22px; transform:rotate(-6deg); }
.pv-tete > div{ flex:1; min-width:0; }
.pv-tete h2{ margin:0; font:800 18px/1.45 var(--f-ar-titre); text-align:start; }
.pv-tete p{ margin:2px 0 0; font-size:12.5px; color:var(--gris); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pv-fermer{ flex:0 0 38px; width:38px; height:38px; border-radius:50%; display:grid; place-items:center; border:0; cursor:pointer;
  background:rgba(var(--fg),.08); color:var(--papier); font-size:18px; }
.pv-fermer svg{ width:18px; height:18px; }

/* le viseur (avant la première photo) */
.pv-scene{ margin:16px 0 10px; }
.pv-viseur{ position:relative; width:100%; height:min(46vh, 330px); border-radius:24px; border:0; cursor:pointer; overflow:hidden; color:var(--papier);
  display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:10px; padding-bottom:26px; font:inherit;
  background:radial-gradient(90% 70% at 50% 40%, rgba(255,217,0,.07), transparent 70%),
    repeating-linear-gradient(0deg, rgba(var(--fg),.035) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(var(--fg),.035) 0 1px, transparent 1px 28px), #0b0811; }
.pv-coin{ position:absolute; width:34px; height:34px; border:3.5px solid var(--jaune); animation:pv-respire 2.4s var(--ease) infinite; }
.pv-coin.a{ top:18px; left:18px; border-right:0; border-bottom:0; border-radius:12px 0 0 0; }
.pv-coin.b{ top:18px; right:18px; border-left:0; border-bottom:0; border-radius:0 12px 0 0; }
.pv-coin.c{ bottom:18px; left:18px; border-right:0; border-top:0; border-radius:0 0 0 12px; }
.pv-coin.d{ bottom:18px; right:18px; border-left:0; border-top:0; border-radius:0 0 12px 0; }
@keyframes pv-respire{ 50%{ transform:scale(.86); opacity:.7 } }
.pv-feuille-fantome{ position:absolute; top:30px; left:50%; width:44%; aspect-ratio:3/4; translate:-50% 0; rotate:-5deg; border-radius:6px;
  background:linear-gradient(rgba(255,255,255,.11), rgba(255,255,255,.05)); border:1px solid rgba(255,255,255,.14); padding:18% 12%; display:flex; flex-direction:column; gap:12%; }
.pv-feuille-fantome i{ display:block; height:3px; border-radius:3px; background:rgba(255,255,255,.18); }
.pv-feuille-fantome i:nth-child(2){ width:80% } .pv-feuille-fantome i:nth-child(3){ width:92% } .pv-feuille-fantome i:nth-child(4){ width:55% }
.pv-scan{ position:absolute; left:0; right:0; top:0; height:70px; pointer-events:none; opacity:.9;
  background:linear-gradient(180deg, transparent, rgba(255,217,0,.16) 70%, rgba(255,217,0,.85) 98%, transparent);
  animation:pv-scan 2.6s var(--ease) infinite; }
@keyframes pv-scan{ from{ transform:translateY(-80px) } to{ transform:translateY(calc(min(46vh, 330px) + 10px)) } }
.pv-declencheur{ position:relative; z-index:1; width:76px; height:76px; border-radius:50%; display:grid; place-items:center; font-size:30px;
  background:#fff; color:#140f00; box-shadow:0 0 0 6px rgba(255,217,0,.4), 0 18px 40px -10px rgba(255,217,0,.6); animation:pv-appel 2.2s infinite; }
@keyframes pv-appel{ 0%,100%{ box-shadow:0 0 0 6px rgba(255,217,0,.4), 0 18px 40px -10px rgba(255,217,0,.6) } 50%{ box-shadow:0 0 0 14px rgba(255,217,0,.12), 0 18px 40px -10px rgba(255,217,0,.6) } }
.pv-viseur b{ position:relative; z-index:1; font:700 15px/1.2 var(--f-titre); }
.pv-viseur:active .pv-declencheur{ transform:scale(.92); }

/* les polaroïds */
.pv-pola-liste{ display:flex; flex-wrap:wrap; justify-content:center; gap:16px; padding:6px 0 4px; }
.pv-pola{ position:relative; margin:0; width:clamp(104px, 30%, 136px); padding:8px 8px 26px; border-radius:5px; background:#fff;
  transform:rotate(var(--r)); box-shadow:0 18px 34px -16px rgba(0,0,0,.8); animation:pv-pose .6s var(--spring) both; overflow:visible; }
.pv-pola img{ display:block; width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:2px; background:#eee; }
.pv-pola .pv-scan{ display:none; height:40px; }
@keyframes pv-pose{ from{ opacity:0; transform:translateY(-30px) rotate(calc(var(--r) * 4)) scale(1.25) } }
.pv-retirer{ position:absolute; top:-10px; inset-inline-end:-10px; width:28px; height:28px; border-radius:50%; border:0; display:grid; place-items:center; cursor:pointer;
  background:#1b1424; color:#fff; box-shadow:0 4px 12px rgba(0,0,0,.4); font-size:14px; }
.pv-retirer svg{ width:14px; height:14px; }
.pv-ajout{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:150px; cursor:pointer; font:inherit;
  background:transparent; border:2px dashed rgba(var(--fg),.25); box-shadow:none; color:var(--gris); }
.pv-ajout svg{ width:28px; height:28px; }
.pv-ajout small{ font:600 12px/1.3 var(--f-texte); }
.pv-encore{ margin:10px 0 0; text-align:center; font:500 12px/1.5 var(--f-ar-texte); color:var(--gris); }
.pv-astuce{ margin:4px 0 12px; text-align:center; font:500 12.5px/1.6 var(--f-ar-texte); color:var(--gris); }
.pv-barre{ height:6px; border-radius:9px; background:rgba(var(--fg),.1); overflow:hidden; margin:0 0 12px; }
.pv-barre i{ display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg, var(--violet-clair), var(--jaune)); transition:width .3s; }
.pv-erreur{ margin:0 0 12px; text-align:center; font:600 13px/1.6 var(--f-ar-texte); color:var(--rose-txt, #FFB3BB); }
.pv-envoyer{ width:100%; justify-content:center; gap:10px; font-size:16px; padding:15px 18px; }
.pv-envoyer svg{ width:20px; height:20px; }
.pv-envoyer:disabled{ opacity:.45; filter:saturate(.4); }

/* envoi : le scanner passe sur les photos, puis elles s'envolent vers le prof */
.pv-envoi .pv-pola .pv-scan{ display:block; animation-duration:1.3s; }
.pv-envoi .pv-pola{ animation:pv-flotte 1.4s ease-in-out infinite alternate; }
.pv-envoi .pv-retirer, .pv-envoi .pv-ajout, .pv-envoi .pv-encore{ visibility:hidden; }
@keyframes pv-flotte{ from{ transform:rotate(var(--r)) translateY(0) } to{ transform:rotate(calc(var(--r) * -1)) translateY(-6px) } }
.pv-envole .pv-pola{ animation:none; transition:transform .65s cubic-bezier(.5,0,.75,0), opacity .65s; transform:translate(30vw, -70vh) rotate(28deg) scale(.35); opacity:0; }
.pv-envole .pv-pola:nth-child(2){ transition-delay:.08s } .pv-envole .pv-pola:nth-child(3){ transition-delay:.16s }

/* bravo */
.pv-bravo{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:34px 10px 26px; animation:pv-apparait .45s var(--spring) both; }
@keyframes pv-apparait{ from{ opacity:0; transform:scale(.9) } }
.pv-bravo-ico{ width:92px; height:92px; color:#2ee07a; filter:drop-shadow(0 0 22px rgba(46,224,122,.45)); }
.pv-bravo-ico svg{ width:100%; height:100%; }
.pv-c{ stroke-dasharray:150; stroke-dashoffset:150; animation:pv-trait .6s .1s var(--ease) forwards; }
.pv-k{ stroke-dasharray:40; stroke-dashoffset:40; animation:pv-trait .4s .55s var(--ease) forwards; }
@keyframes pv-trait{ to{ stroke-dashoffset:0 } }
.pv-bravo h2{ margin:8px 0 0; font:800 22px/1.5 var(--f-ar-titre); }
.pv-bravo p{ margin:0; font:500 14px/1.6 var(--f-ar-texte); color:var(--gris); }
.pv-xp-gros{ margin-top:10px; font-size:15px; padding:8px 14px; animation:pv-pop .5s .8s var(--spring) both; }
@keyframes pv-pop{ from{ opacity:0; transform:scale(.4) } }

/* loupe */
.pv-loupe{ align-items:center; }
.pv-loupe-in{ max-width:94vw; max-height:88vh; overflow:auto; display:flex; flex-direction:column; gap:12px; border-radius:12px; }
.pv-loupe-in img{ display:block; max-width:94vw; max-height:84vh; object-fit:contain; border-radius:10px; background:#fff; }
.pv-loupe > .pv-fermer{ position:fixed; top:calc(14px + env(safe-area-inset-top)); inset-inline-end:14px; }

/* ---------- Mon espace : la réponse du prof ---------- */
.pv-voile-centre{ align-items:center; padding:18px; }
.pv-retour{ position:relative; width:min(100%, 400px); padding:26px 22px 22px; border-radius:30px; text-align:center; color:var(--papier);
  background:radial-gradient(110% 60% at 50% 0%, rgba(155,77,224,.4), transparent 65%), var(--encre-2, #140F1E); border:1px solid rgba(var(--fg),.12);
  box-shadow:0 40px 90px -30px rgba(0,0,0,.85); transform:translateY(30px) scale(.94); opacity:0; transition:transform .55s var(--spring), opacity .3s; }
.pv-voile.on .pv-retour{ transform:none; opacity:1; }
.pv-r-ok{ background:radial-gradient(110% 60% at 50% 0%, rgba(46,224,122,.26), transparent 65%), var(--encre-2, #140F1E); }
.pv-r-refaire{ background:radial-gradient(110% 60% at 50% 0%, rgba(255,145,40,.26), transparent 65%), var(--encre-2, #140F1E); }
.pv-r-photo{ position:relative; width:150px; margin:0 auto 18px; padding:8px 8px 26px; background:#fff; border-radius:5px; transform:rotate(-4deg);
  box-shadow:0 22px 40px -16px rgba(0,0,0,.8); animation:pv-impact .35s .62s ease-out both; }
.pv-r-photo img{ display:block; width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:2px; background:#eee; }
@keyframes pv-impact{ 0%{ transform:rotate(-4deg) } 30%{ transform:rotate(-4deg) translateY(5px) scale(.97) } 100%{ transform:rotate(-4deg) } }
.pv-r-tampon{ position:absolute; right:-26px; bottom:4px; width:78px; height:78px; border-radius:50%; display:grid; place-items:center;
  font:900 40px/1 var(--f-titre); font-style:normal; color:#16a34a; border:5px double currentColor; background:rgba(255,255,255,.9);
  transform:rotate(-16deg); animation:pv-claque .5s .45s cubic-bezier(.2,1.6,.4,1) both; box-shadow:0 0 0 3px rgba(255,255,255,.6); }
.pv-r-refaire .pv-r-tampon{ color:#ea7a0a; }
@keyframes pv-claque{ from{ opacity:0; transform:rotate(-30deg) scale(3.2) } 60%{ opacity:1 } to{ opacity:1; transform:rotate(-16deg) scale(1) } }
.pv-retour h2{ margin:0; font:800 20px/1.5 var(--f-ar-titre); }
.pv-r-ou{ margin:4px 0 0; font-size:12.5px; color:var(--gris); }
.pv-r-verdict{ display:inline-block; margin:14px 0 0; padding:7px 14px; border-radius:99px; font:700 14px/1.4 var(--f-ar-texte); background:rgba(37,211,102,.14); color:#7ee8a6; }
.pv-r-refaire .pv-r-verdict{ background:rgba(255,145,40,.15); color:#ffbe7a; }
.pv-r-bulle{ margin:14px 0 0; padding:12px 14px; border-radius:18px 18px 18px 4px; text-align:start; background:rgba(var(--fg),.07); font-size:15px; line-height:1.65; }
.pv-r-bulle b{ display:block; margin-bottom:3px; font:700 12px/1.4 var(--f-ar-titre); color:var(--jaune-txt, #FFD900); }
.pv-r-actions{ display:flex; flex-direction:column; gap:10px; margin-top:20px; }
.pv-r-actions .btn{ width:100%; justify-content:center; gap:8px; }
.pv-r-actions svg{ width:18px; height:18px; }

/* ---------- thème clair ---------- */
[data-theme="light"] .pv-feuille, [data-theme="light"] .pv-retour{ background-color:#fff; color:#1b1424; }
[data-theme="light"] .pv-cta{ color:#1b1424; }
[data-theme="light"] .pv-pill{ color:#6722A0; } [data-theme="light"] .pv-auto .pv-pill, [data-theme="light"] .pv-ok .pv-pill{ color:#14803c; }
[data-theme="light"] .pv-refaire .pv-pill{ color:#b45309; }
[data-theme="light"] .pv-bulle, [data-theme="light"] .pv-lien{ color:#1b1424; }
[data-theme="light"] .pv-viseur{ color:#fff; }

@media (prefers-reduced-motion: reduce){
  .pv-flash, .pv-coin, .pv-scan, .pv-declencheur, .pv-pouls, .pv-pola, .pv-envoi .pv-pola{ animation:none !important; }
  .pv-envole .pv-pola{ transition:none; }
  .pv-feuille, .pv-retour, .pv-voile{ transition:none; }
}
.pv-zone[dir="ltr"] .pv-cta-txt small{ text-align:left; }
/* (14/11) résumé : accord pour le prénom (« résumé de la semaine ») */
.pv-nomok{ display:flex; align-items:flex-start; gap:10px; margin:0 0 12px; padding:10px 12px; border-radius:14px; background:rgba(255,217,0,.07); border:1px solid rgba(255,217,0,.22);
  font:500 12.5px/1.6 var(--f-ar-texte); color:var(--papier); cursor:pointer; }
.pv-nomok input{ width:18px; height:18px; margin-top:2px; accent-color:#FFD900; flex:none; }
.pv-envoi .pv-nomok{ visibility:hidden; }
