/* =====================================================================
   workinprogress-new.css — refonte de la page Projets (préversion)

   Chargé après style.css, index-new.css et assets-new.css : reprend
   l'en-tête, la barre d'outils, la grille et le bloc « suite » du
   catalogue. Ajoute ici le panneau de votes, l'état verrouillé, les
   sections par statut et le toast. Préfixe .nxw-, scopé body.wip-new.
   ===================================================================== */

body.wip-new {
  --nxw-finishing: #7FD3A0;   /* presque fini : vert doux */
  --nxw-wip:       var(--nx-orange-soft);
  --nxw-vote:      #FFD36B;   /* l'étoile des votes */
}

/* =====================================================================
   EN-TÊTE — pas de cover ici : une lueur orange façon lampe d'atelier
   ===================================================================== */

.nxw-top__glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(55% 70% at 78% 30%, rgba(234, 136, 69, .22), transparent 70%),
    radial-gradient(40% 50% at 15% 90%, rgba(255, 211, 107, .07), transparent 70%),
    linear-gradient(180deg, var(--nx-ink-950), var(--nx-ink-900));
}
/* quadrillage de plan, très discret */
.nxw-top__glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(250, 245, 240, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 245, 240, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 80% at 70% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 80% at 70% 40%, #000, transparent 75%);
}

/* --- Panneau (votes ou accès membre) --- */

.nxw-panel {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;
  padding: clamp(28px, 3.4vw, 44px);
  border: 1px solid var(--nx-line-2);
  border-radius: var(--nx-r-lg);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(234, 136, 69, .14), transparent 65%),
    rgba(26, 23, 27, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .45);
}

.nxw-panel__flag {
  display: inline-block;
  margin: 0 0 22px;
  padding: 4px 12px;
  border-radius: var(--nx-r-sm);
  background: var(--nx-orange);
  color: #17110C;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nxw-wallet {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  line-height: .9;
}
.nxw-wallet__left {
  display: inline-block;
  font-size: clamp(4rem, 8vw, 6.2rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--nx-white);
  font-variant-numeric: tabular-nums;
}
.nxw-wallet__quota {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--nx-mute-soft);
}
.nxw-wallet__label {
  margin: 12px 0 0;
  font-size: var(--nx-fs-micro);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nxw-vote);
}

/* Un repère par vote du quota : plein = disponible */
.nxw-pips {
  display: flex;
  gap: 6px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.nxw-pips li {
  flex: 1;
  max-width: 64px;
  height: 6px;
  border-radius: 3px;
  background: rgba(250, 245, 240, .12);
  transition: background-color .5s var(--nx-ease), box-shadow .5s;
}
.nxw-pips li.is-on {
  background: var(--nxw-vote);
  box-shadow: 0 0 14px rgba(255, 211, 107, .45);
}

.nxw-panel__text {
  margin: 22px 0 26px;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--nx-mute);
}
.nxw-panel__text strong { color: var(--nx-white); font-weight: 800; }

/* --- Variante verrouillée --- */

.nxw-panel--locked { border-color: rgba(234, 136, 69, .5); }
.nxw-panel--locked .nx-label { margin-bottom: 14px; }

.nxw-lock {
  position: absolute;
  top: clamp(24px, 3vw, 36px);
  right: clamp(24px, 3vw, 36px);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(234, 136, 69, .5);
  background: rgba(234, 136, 69, .1);
}
.nxw-lock svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--nx-orange-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.nxw-panel__title {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--nx-white);
}
.nxw-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin: 0;
}

/* =====================================================================
   BARRE — rappel compact des votes restants
   ===================================================================== */

.nxw-bar-votes {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(255, 211, 107, .4);
  border-radius: var(--nx-r-md);
  font-weight: 900;
  font-size: .95rem;
  color: var(--nx-white);
  font-variant-numeric: tabular-nums;
}
.nxw-star { color: var(--nxw-vote); }

.nxw-chip--finishing.is-active { background: var(--nxw-finishing); border-color: var(--nxw-finishing); }
.nxw-chip--vote.is-active      { background: var(--nxw-vote);      border-color: var(--nxw-vote); }

/* =====================================================================
   SECTIONS PAR STATUT
   ===================================================================== */

.nxw-group + .nxw-group { margin-top: clamp(56px, 7vw, 96px); }

.nxw-group__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--nx-line);
}

.nxw-group__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--nx-white);
}
.nxw-group__count {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 4px 9px;
  border: 1px solid var(--nx-line-2);
  border-radius: var(--nx-r-sm);
  color: var(--nx-mute);
  font-variant-numeric: tabular-nums;
}

/* Pastille de statut, qui « respire » */
.nxw-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--nxw-c, var(--nxw-wip));
}
.nxw-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid var(--nxw-c, var(--nxw-wip));
  opacity: 0;
  animation: nxw-pulse 2.4s var(--nx-ease-soft) infinite;
}
@keyframes nxw-pulse {
  0%   { transform: scale(.6); opacity: .8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.nxw-group--finishing { --nxw-c: var(--nxw-finishing); }
.nxw-group--wip       { --nxw-c: var(--nxw-wip); }
.nxw-group--vote      { --nxw-c: var(--nxw-vote); }

.nxw-group__text {
  margin: 12px 0 0;
  max-width: 60ch;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--nx-mute);
}
.nxw-group__hand { margin: 0; color: var(--nxw-c, var(--nx-orange-soft)); }

/* En tête du vote */
.nxw-leader {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px 16px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid rgba(255, 211, 107, .35);
  border-radius: var(--nx-r-md);
  background: rgba(255, 211, 107, .06);
}
.nxw-leader__label {
  grid-column: 1 / -1;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nx-mute-soft);
}
.nxw-leader__name {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--nx-white);
}
.nxw-leader__votes {
  justify-self: end;
  font-weight: 900;
  color: var(--nx-white);
  font-variant-numeric: tabular-nums;
}

/* Le liseré de la carte reprend la couleur de sa section */
body.wip-new .nxw-group .nxa-grid .card:not(.blur):hover .card-inner {
  border-color: var(--nxw-c, var(--nx-orange));
}

/* Compteurs qui sautillent après un vote */
body.wip-new .is-bump { animation: nxw-bump .55s var(--nx-ease); }
@keyframes nxw-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); color: var(--nxw-vote); }
  100% { transform: scale(1); }
}
body.wip-new .is-loading { opacity: .5; pointer-events: none; }

/* =====================================================================
   VISITEUR — cartes floutées par le partial : on ajoute un cadenas
   ===================================================================== */

body.wip-new.is-locked .nxa-grid .card.blur .card-inner > .title::before {
  content: '';
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 0 6px 20px;
  border-radius: 50%;
  border: 1px solid rgba(250, 245, 240, .25);
  background: rgba(11, 10, 12, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FBA66C' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='1.5'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") no-repeat center / 16px;
}

/* =====================================================================
   TOAST
   ===================================================================== */

.nxw-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  padding: 14px 22px;
  border-radius: var(--nx-r-md);
  border: 1px solid var(--nx-line-2);
  background: var(--nx-ink-700);
  color: var(--nx-white);
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .4s var(--nx-ease), transform .5s var(--nx-ease);
}
.nxw-toast:empty { display: none; }
.nxw-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.nxw-toast.is-ok    { border-color: rgba(255, 211, 107, .55); }
.nxw-toast.is-error { border-color: rgba(255, 66, 77, .6); }

/* =====================================================================
   RESPONSIVE / MOUVEMENT RÉDUIT
   ===================================================================== */

@media (max-width: 900px) {
  .nxw-panel { justify-self: stretch; max-width: none; }
  .nxw-bar-votes { position: absolute; top: 14px; right: calc(clamp(20px, 5.5vw, 88px) + 64px); padding: 9px 12px; }
  body.wip-new .nxa-bar__inner { position: relative; }
  body.wip-new .nxa-bar__inner:has(.nxw-bar-votes) .nxa-search { margin-right: 144px; }
}

@media (prefers-reduced-motion: reduce) {
  .nxw-dot::after { animation: none; }
  body.wip-new .is-bump { animation: none; }
}
