/* =====================================================================
   TGAlert - boîtes de dialogue et toasts (charte Toki Gourmandises)
   ===================================================================== */
html.tga-verrou{overflow:hidden}

.tga-fond{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;padding:16px;
  background:rgba(46,31,23,0);-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);transition:background .26s ease,backdrop-filter .26s ease}
.tga-fond.tga-visible{background:rgba(46,31,23,.45);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}

.tga-boite{width:100%;max-width:420px;background:var(--tg-blanc,#FFFDFB);color:var(--tg-choco,#4A3226);border-radius:14px;
  padding:34px 30px 26px;text-align:center;box-shadow:0 30px 70px rgba(46,31,23,.28);
  opacity:0;transform:translateY(16px) scale(.96);transition:opacity .26s cubic-bezier(.22,.61,.36,1),transform .32s cubic-bezier(.22,.61,.36,1)}
.tga-visible .tga-boite{opacity:1;transform:none}

.tga-icone{width:64px;height:64px;margin:0 auto 16px}
.tga-icone svg{width:100%;height:100%;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tga-icone circle:first-child{stroke:currentColor;opacity:.35}
.tga-trace{stroke:currentColor;stroke-width:2.2;stroke-dasharray:60;stroke-dashoffset:60}
.tga-point{fill:currentColor;stroke:none;opacity:0}
.tga-visible .tga-trace{animation:tgaTrace .55s .18s cubic-bezier(.22,.61,.36,1) forwards}
.tga-visible .tga-point{animation:tgaPoint .3s .45s forwards}
@keyframes tgaTrace{to{stroke-dashoffset:0}}
@keyframes tgaPoint{to{opacity:1}}

.tga-success{--tga-c:var(--tg-succes,#3F6B4E)}
.tga-error{--tga-c:var(--tg-erreur,#9B3B32)}
.tga-warning{--tga-c:var(--tg-alerte,#8A5A14)}
.tga-info{--tga-c:var(--tg-info,#3E5C76)}
.tga-question{--tga-c:var(--tg-choco,#4A3226)}
.tga-boite .tga-icone{color:var(--tga-c)}

.tga-titre{font-family:var(--tg-serif,Georgia,serif);font-size:1.85rem;font-weight:700;margin:0 0 8px;line-height:1.15}
.tga-texte{font-size:.95rem;line-height:1.6;color:var(--tg-texte-doux,#6B5046);margin:0 0 24px}
.tga-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.tga-btn{min-width:110px;min-height:38px;padding:8px 18px;border-radius:6px;border:1px solid var(--tg-choco,#4A3226);
  font-family:var(--tg-sans,system-ui,sans-serif);font-size:.82rem;letter-spacing:.1em;text-transform:uppercase;cursor:pointer;transition:all .25s ease;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.tga-btn i{font-size:1.2rem}
.tga-btn-ok{background:var(--tg-choco,#4A3226);color:var(--tg-creme,#F6EEE8)}
.tga-btn-ok:hover{background:var(--tg-choco-900,#2E1F17)}
.tga-btn-danger{background:var(--tg-erreur,#9B3B32);border-color:var(--tg-erreur,#9B3B32);color:#fff}
.tga-btn-danger:hover{background:#7E2F28;border-color:#7E2F28}
.tga-btn-annuler{background:var(--tg-rose-100,#F0E4D8);color:var(--tg-choco,#4A3226);border-color:var(--tg-trait,#E4D5CD)}
.tga-btn-annuler:hover{background:var(--tg-choco-900,#2E1F17);color:var(--tg-creme,#F6EEE8);border-color:var(--tg-choco-900,#2E1F17)}
.tga-btn:focus-visible{outline:2px solid var(--tg-rose,#C49E94);outline-offset:2px}

.tga-boite-chargement{max-width:260px;padding:30px}
.tga-boite-chargement .tga-texte{margin:14px 0 0}
.tga-spinner{display:inline-block;width:42px;height:42px;border-radius:50%;border:2px solid var(--tg-rose-300,#E2C9C1);border-top-color:var(--tg-choco,#4A3226);animation:tgaTourne .8s linear infinite}
@keyframes tgaTourne{to{transform:rotate(360deg)}}

/* ------------------------------ Toasts ------------------------------ */
.tga-toasts{position:fixed;top:16px;right:16px;z-index:2100;display:flex;flex-direction:column;gap:10px;width:min(380px,calc(100vw - 32px));pointer-events:none}
.tga-toast{position:relative;overflow:hidden;pointer-events:auto;display:flex;align-items:center;gap:12px;padding:14px 12px 14px 16px;border-radius:10px;
  background:var(--tg-blanc,#FFFDFB);color:var(--tg-choco,#4A3226);box-shadow:0 12px 32px rgba(46,31,23,.16);border:1px solid var(--tg-trait,#E4D5CD);
  opacity:0;transform:translateX(30px);transition:opacity .35s cubic-bezier(.22,.61,.36,1),transform .35s cubic-bezier(.22,.61,.36,1)}
.tga-toast.tga-visible{opacity:1;transform:none}
.tga-toast-icone{flex:0 0 28px;height:28px;color:var(--tga-c)}
.tga-toast-icone svg{width:100%;height:100%;fill:none;stroke-width:2;stroke-linecap:round}
.tga-toast-icone circle:first-child{stroke:currentColor;opacity:.35}
.tga-toast .tga-trace{stroke-dashoffset:0;stroke-width:2.6}
.tga-toast .tga-point{opacity:1}
.tga-toast-texte{flex:1;font-size:.9rem;line-height:1.45}
.tga-toast-fermer{flex:0 0 32px;height:32px;border:0;border-radius:50%;background:transparent;color:var(--tg-texte-leger,#7E5F52);font-size:1.3rem;line-height:1;cursor:pointer}
.tga-toast-fermer:hover{background:var(--tg-rose-100,#F3E6E1)}
.tga-toast-barre{position:absolute;left:0;bottom:0;height:2px;width:100%;background:var(--tga-c);transform-origin:left;animation:tgaBarre linear forwards}
.tga-toast.tga-pause .tga-toast-barre{animation-play-state:paused}
@keyframes tgaBarre{from{transform:scaleX(1)}to{transform:scaleX(0)}}

@media (max-width:575.98px){
  .tga-boite{padding:28px 20px 20px}
  .tga-actions{flex-direction:column-reverse}
  .tga-btn{width:100%}
  .tga-toasts{top:auto;bottom:16px;right:16px;left:16px;width:auto}
}
