/* ============================================================
   NDÎ-NCHOUT PÂMOM — Tableau Noir
   Composition d'une annonce, grille des annonces et liste de
   participants. S'appuie sur les variables de style.css.
   ============================================================ */

/* ══ 0. NORMALISATION ════════════════════════════════════════
   Materialize dessine ses propres ronds de radio en ::before /
   ::after sur tout <span> frère d'un input, et pousse le contenu
   de 35 px. Nos vignettes sont des div — hors de portée de ces
   sélecteurs — mais la neutralisation reste un garde-fou.
   Il masque aussi les cases à cocher : celles que l'on veut voir
   sont rétablies explicitement.
   ============================================================ */

.tnf-page .material-icons,
.tnb-page .material-icons {
  float: none !important;
  margin-right: 0;
  line-height: inherit;
  vertical-align: middle;
}

.tnf-choice > input + span::before,
.tnf-choice > input + span::after,
.tnf-switch > input + span::before,
.tnf-switch > input + span::after { content: none !important; }


/* ══ 1. ANIMATIONS ═══════════════════════════════════════════ */

@keyframes tnfRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes tnfPop {
  0%   { transform: scale(.86); opacity: 0; }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes tnfPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,143,0,.42); }
  70%      { box-shadow: 0 0 0 13px rgba(255,143,0,0); }
}
@keyframes tnfSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes tnfShimmer {
  from { background-position: -420px 0; }
  to   { background-position: 420px 0; }
}

/* Entrée en cascade des sections du formulaire */
.tnf-card { animation: tnfRise .5s cubic-bezier(.22,.9,.3,1) both; }
.tnf-card:nth-child(1) { animation-delay: .04s; }
.tnf-card:nth-child(2) { animation-delay: .10s; }
.tnf-card:nth-child(3) { animation-delay: .16s; }
.tnf-card:nth-child(4) { animation-delay: .22s; }
.tnf-card:nth-child(5) { animation-delay: .28s; }
.tnf-card:nth-child(6) { animation-delay: .34s; }

@media (prefers-reduced-motion: reduce) {
  .tnf-card, .tnb-card, .tnf-choice-box, .tni-row {
    animation: none !important;
    transition: none !important;
  }
}

/* ══ 2. FORMULAIRE — STRUCTURE ═══════════════════════════════ */

.tnf-page { padding-bottom: var(--sp-xl); }

.tnf-shell { max-width: 880px; margin: 0 auto; }

.tnf-topbar {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm);
  align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.tnf-card {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
}

.tnf-card:hover { box-shadow: var(--shadow-md); }

/* La carte en cours de saisie se détache légèrement du reste */
.tnf-card:focus-within {
  border-color: var(--c-primary-light);
  box-shadow: 0 6px 26px rgba(255,143,0,.16);
  transform: translateY(-2px);
}

.tnf-card-head {
  display: flex; gap: .85rem; align-items: flex-start;
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-md);
  border-bottom: 1px solid var(--c-border);
}

.tnf-step {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; font-size: 1.05rem; font-weight: 700;
  box-shadow: 0 3px 10px rgba(255,143,0,.32);
  transition: transform var(--t-base);
}

.tnf-card:focus-within .tnf-step { transform: scale(1.08) rotate(-6deg); }

.tnf-card-head h5 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.16rem;
  color: var(--c-secondary);
}

.tnf-card-head p {
  margin: .25rem 0 0;
  font-size: .85rem; color: var(--c-text-muted); line-height: 1.55;
}

.tnf-optional {
  margin-left: auto;
  align-self: center;
  padding: .18rem .6rem;
  background: var(--c-cream);
  border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700;
  color: #9A8B72; letter-spacing: .6px; text-transform: uppercase;
  white-space: nowrap;
}

/* ══ 3. CHAMPS ═══════════════════════════════════════════════ */

.tnf-field { margin-bottom: var(--sp-md); }
.tnf-field:last-child { margin-bottom: 0; }

.tnf-field > label {
  display: block;
  margin-bottom: .45rem;
  font-size: .82rem; font-weight: 700;
  color: var(--c-secondary);
  letter-spacing: .4px; text-transform: uppercase;
}

.tnf-req { color: var(--c-primary); }

.tnf-field input[type="text"],
.tnf-field input[type="url"],
.tnf-field input[type="number"],
.tnf-field input[type="datetime-local"],
.tnf-field select,
.tnf-field textarea {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: .8rem .9rem;
  background: #FCFAF6;
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: .94rem;
  color: var(--c-text);
  box-shadow: none !important;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.tnf-field input:not([type="checkbox"]):not([type="radio"]) { height: 48px; }

.tnf-field textarea {
  min-height: 132px;
  line-height: 1.7;
  resize: vertical;
}

.tnf-field input:focus,
.tnf-field select:focus,
.tnf-field textarea:focus {
  outline: none;
  background: var(--c-white);
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px rgba(255,143,0,.14) !important;
}

.tnf-field small {
  display: block;
  margin-top: .4rem;
  font-size: .79rem; color: var(--c-text-muted); line-height: 1.5;
}

.tnf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }

.tnf-counter {
  float: right;
  font-size: .75rem; font-weight: 700;
  color: #B5AA9A;
  transition: color var(--t-fast);
}
.tnf-counter.is-near { color: var(--c-primary-dark); }
.tnf-counter.is-max  { color: #C62828; }

.tnf-hint {
  display: flex; gap: .6rem; align-items: flex-start;
  margin: var(--sp-sm) 0 0;
  padding: .78rem .95rem;
  background: var(--c-cream);
  border-radius: var(--r-sm);
  font-size: .83rem; color: #7A6248; line-height: 1.6;
}
.tnf-hint > i { color: var(--c-primary); font-size: 1.05rem; flex: 0 0 auto; line-height: 1.6; }

/* ══ 4. VIGNETTES DE CHOIX (catégorie, cursus) ═══════════════ */

/* Quatre colonnes plutôt qu'un auto-fill : la liste des catégories
   s'allonge au fil des créations, et un remplissage automatique laissait
   une rangée orpheline dès que le compte tombait mal. */
.tnf-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
}

.tnf-choice > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tnf-choice-box {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; gap: .4rem;
  padding: .95rem .55rem;
  background: #FCFAF6;
  border: 2px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer; text-align: center;
  overflow: hidden;
  transition: transform var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), box-shadow var(--t-fast);
}

/* Halo qui balaie la vignette au survol */
.tnf-choice-box::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .55s ease;
  pointer-events: none;
}
.tnf-choice-box:hover::after { transform: translateX(120%); }

.tnf-choice-box:hover {
  transform: translateY(-3px);
  border-color: var(--c, var(--c-primary));
  box-shadow: 0 6px 18px rgba(78,52,46,.13);
}

.tnf-choice-emoji {
  display: flex; align-items: center; justify-content: center;
  height: 2rem;
  font-size: 1.55rem; line-height: 1.3;
  transition: transform var(--t-base);
}
.tnf-choice-box:hover .tnf-choice-emoji { transform: scale(1.16) rotate(-5deg); }

.tnf-choice-icon { font-size: 1.5rem !important; color: var(--c, var(--c-primary)); }

.tnf-choice-label {
  font-size: .82rem; font-weight: 700;
  color: var(--c-text-muted);
  letter-spacing: .2px;
  transition: color var(--t-fast);
}

.tnf-choice > input:checked + .tnf-choice-box {
  background: color-mix(in srgb, var(--c, #FF8F00) 10%, white);
  border-color: var(--c, var(--c-primary));
  box-shadow: 0 5px 18px color-mix(in srgb, var(--c, #FF8F00) 30%, transparent);
  animation: tnfPop .32s cubic-bezier(.3,1.4,.5,1) both;
}
.tnf-choice > input:checked + .tnf-choice-box .tnf-choice-label { color: var(--c, var(--c-primary)); }

/* Coche d'état */
.tnf-choice > input:checked + .tnf-choice-box::before {
  content: "✓";
  position: absolute; top: 5px; right: 7px;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c, var(--c-primary));
  color: #fff; border-radius: 50%;
  font-size: .7rem; font-weight: 700;
  animation: tnfPop .3s ease both;
}

.tnf-choice > input:focus-visible + .tnf-choice-box {
  outline: 2px solid var(--c, var(--c-primary));
  outline-offset: 2px;
}

/* Bouton « ajouter une catégorie » */
.tnf-choice-add {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .35rem;
  padding: .95rem .55rem;
  background: transparent;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  font-family: var(--font-body); font-size: .82rem; font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}
.tnf-choice-add:hover {
  border-color: var(--c-primary);
  color: var(--c-primary-dark);
  background: var(--c-cream);
  transform: translateY(-3px);
}
.tnf-choice-add i { font-size: 1.5rem !important; }

/* ══ 5. INTERRUPTEUR (liste de participants) ═════════════════ */

.tnf-switch {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #FFFBF2, #FFF6E3);
  border: 1.5px solid var(--c-cream-dark);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.tnf-switch:hover { border-color: var(--c-primary-light); }

.tnf-switch > input { position: absolute; opacity: 0; pointer-events: none; }

.tnf-switch-track {
  position: relative; flex: 0 0 auto;
  width: 46px; height: 25px;
  margin-top: 2px;
  background: #D8CDBB;
  border-radius: var(--r-full);
  transition: background var(--t-base);
}

.tnf-switch-track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
  transition: transform var(--t-base);
}

.tnf-switch > input:checked + .tnf-switch-track { background: var(--c-primary); }
.tnf-switch > input:checked + .tnf-switch-track::after { transform: translateX(21px); }
.tnf-switch > input:checked ~ .tnf-switch-text strong { color: var(--c-primary-dark); }

.tnf-switch:has(input:checked) {
  border-color: var(--c-primary);
  box-shadow: 0 4px 16px rgba(255,143,0,.16);
}

.tnf-switch-text strong {
  display: flex; align-items: center; gap: .4rem;
  font-size: .96rem; color: var(--c-secondary);
  transition: color var(--t-fast);
}
.tnf-switch-text em {
  display: block; margin-top: .2rem;
  font-style: normal; font-size: .83rem;
  color: var(--c-text-muted); line-height: 1.6;
}

/* Bloc révélé par l'interrupteur */
.tnf-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .38s cubic-bezier(.22,.9,.3,1), opacity .3s ease, margin-top .3s ease;
  margin-top: 0;
}
.tnf-reveal > div { overflow: hidden; }

.tnf-reveal.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--sp-sm);
}

/* Réglage du nombre de places */
.tnf-seats {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
  padding: 1rem 1.1rem;
  background: #FCFAF6;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.tnf-seats .tnf-field { margin: 0; flex: 0 0 auto; width: 160px; }

.tnf-seats-preview {
  flex: 1 1 190px;
  padding: .7rem .9rem;
  background: var(--c-white);
  border: 1px dashed var(--c-cream-dark);
  border-radius: var(--r-sm);
  font-size: .85rem; color: #7A6248; line-height: 1.6;
}
.tnf-seats-preview strong { color: var(--c-primary-dark); }

/* ══ 6. DÉPÔT DE FICHIERS ════════════════════════════════════ */

.tnf-drops { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }

.tnf-drop {
  display: flex; flex-direction: column;
  align-items: center; gap: .3rem;
  padding: 1.5rem 1rem;
  background: #FCFAF6;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-md);
  text-align: center; cursor: pointer;
  transition: all var(--t-base);
}

.tnf-drop:hover,
.tnf-drop.is-over {
  border-color: var(--c-primary);
  background: var(--c-cream);
  transform: translateY(-2px);
}
.tnf-drop.is-over { animation: tnfPulse 1.1s ease infinite; }

.tnf-drop-emoji { font-size: 1.9rem; line-height: 1.3; transition: transform var(--t-base); }
.tnf-drop:hover .tnf-drop-emoji { transform: scale(1.14) translateY(-2px); }

.tnf-drop strong { font-size: .92rem; color: var(--c-secondary); }
.tnf-drop span   { font-size: .79rem; color: var(--c-text-muted); line-height: 1.5; }

.tnf-drop-file {
  margin-top: .5rem;
  padding: .25rem .75rem;
  background: var(--c-cream-dark);
  border-radius: var(--r-full);
  font-size: .74rem !important; color: #8A7355 !important;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tnf-drop-file.is-set {
  background: #E8F5E9; color: #2E7D32 !important; font-weight: 700;
  animation: tnfPop .3s ease both;
}

.tnf-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: .5rem;
  margin-top: var(--sp-sm);
}
.tnf-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--c-border);
  animation: tnfPop .3s ease both;
}
.tnf-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ══ 7. ACTIONS DU FORMULAIRE ════════════════════════════════ */

.tnf-actions {
  display: flex; flex-wrap: wrap; gap: .6rem;
  align-items: center; justify-content: flex-end;
  padding: var(--sp-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  position: sticky; bottom: 12px;
  animation: tnfRise .5s .4s cubic-bezier(.22,.9,.3,1) both;
}

.tnf-actions .tnf-status {
  margin-right: auto;
  display: flex; align-items: center; gap: .45rem;
  font-size: .84rem; color: var(--c-text-muted);
}
.tnf-actions .tnf-status i { color: var(--c-primary); font-size: 1.1rem; }

.tnf-submit {
  position: relative;
  overflow: hidden;
}
.tnf-submit::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.tnf-submit:hover::after { transform: translateX(120%); }

/* ══ 8. BLOC PARTICIPANTS (page annonce) ═════════════════════ */

.tni-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--sp-md);
  animation: tnfRise .45s ease both;
}

.tni-head {
  display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: center;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, var(--c-secondary), #6D4C41);
  color: #fff;
}

.tni-head h5 {
  margin: 0;
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-size: 1.1rem;
}

.tni-count {
  margin-left: auto;
  display: flex; align-items: baseline; gap: .2rem;
  padding: .3rem .8rem;
  background: rgba(255,255,255,.16);
  border-radius: var(--r-full);
  font-size: .85rem; font-weight: 700;
}
.tni-count strong { font-size: 1.15rem; }
.tni-count.is-full { background: rgba(198,40,40,.85); }

.tni-body { padding: 1.2rem; }

/* Jauge des places */
.tni-gauge {
  height: 9px;
  background: #F0E7D8;
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: .5rem;
}
.tni-gauge span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-light));
  border-radius: var(--r-full);
  transition: width .55s cubic-bezier(.22,.9,.3,1), background .3s ease;
}
.tni-gauge.is-full span { background: linear-gradient(90deg, #C62828, #E53935); }
.tni-gauge.is-warn span { background: linear-gradient(90deg, #EF6C00, #FB8C00); }

.tni-gauge-legend {
  display: flex; justify-content: space-between;
  font-size: .8rem; color: var(--c-text-muted);
  margin-bottom: var(--sp-md);
}
.tni-gauge-legend strong { color: var(--c-secondary); }

/* Bouton d'inscription */
.tni-cta {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: center;
  margin-bottom: var(--sp-md);
}

.tni-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .8rem 1.6rem;
  border: none; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: .93rem; font-weight: 700;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.tni-btn--join {
  background: var(--c-primary); color: #fff;
  box-shadow: 0 4px 14px rgba(255,143,0,.32);
}
.tni-btn--join:hover { background: var(--c-primary-dark); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(255,143,0,.42); }

.tni-btn--leave { background: #F1EBE6; color: var(--c-secondary); }
.tni-btn--leave:hover { background: #E6DDD5; }

.tni-btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }
.tni-btn.is-busy { pointer-events: none; opacity: .7; }

.tni-state {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem;
  border-radius: var(--r-full);
  font-size: .84rem; font-weight: 700;
  animation: tnfPop .32s ease both;
}
.tni-state--in    { background: #E8F5E9; color: #2E7D32; }
.tni-state--full  { background: #FFEBEE; color: #C62828; }
.tni-state--guest { background: var(--c-cream); color: #8A5200; }

/* Liste des participants */
.tni-list { display: flex; flex-direction: column; gap: .4rem; }

.tni-row {
  display: flex; gap: .7rem; align-items: center;
  padding: .55rem .7rem;
  background: #FCFAF6;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  animation: tnfSlideIn .35s ease both;
  transition: background var(--t-fast), transform var(--t-fast);
}
.tni-row:hover { background: var(--c-cream); transform: translateX(3px); }
.tni-row.is-me { border-color: var(--c-primary); background: #FFFBF2; }

.tni-rank {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-cream-dark);
  border-radius: 50%;
  font-size: .74rem; font-weight: 700; color: #8A7355;
}
.tni-row.is-me .tni-rank { background: var(--c-primary); color: #fff; }

.tni-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

.tni-who { min-width: 0; flex: 1; }
.tni-who strong {
  display: block; font-size: .89rem; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tni-who em {
  display: block; font-style: normal; font-size: .76rem; color: var(--c-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tni-when { font-size: .75rem; color: #9A8B72; white-space: nowrap; }

.tni-remove {
  background: none; border: none; cursor: pointer;
  color: #C9BCA6; padding: .2rem;
  border-radius: 50%;
  transition: color var(--t-fast), background var(--t-fast);
}
.tni-remove:hover { color: #C62828; background: #FFEBEE; }

.tni-empty {
  padding: var(--sp-lg) var(--sp-md);
  text-align: center; color: var(--c-text-muted);
}
.tni-empty-emoji { font-size: 2.4rem; display: block; margin-bottom: .4rem; }

/* Export */
.tni-export {
  display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
  margin-top: var(--sp-md);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--c-border);
}
.tni-export-label {
  font-size: .78rem; font-weight: 700; color: #9A8B72;
  letter-spacing: .8px; text-transform: uppercase;
  margin-right: auto;
}
.tni-export a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem;
  background: #FCFAF6;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: .82rem; font-weight: 700; color: var(--c-secondary);
  text-decoration: none;
  transition: all var(--t-fast);
}
.tni-export a:hover {
  border-color: var(--c-primary);
  background: var(--c-cream);
  color: var(--c-primary-dark);
  transform: translateY(-2px);
}
.tni-export a span { font-size: .95rem; }

/* ══ 10. RESPONSIVE ══════════════════════════════════════════ */

@media (max-width: 768px) {
  .tnf-choices { grid-template-columns: repeat(3, 1fr); }
  .tnf-grid-2,
  .tnf-drops { grid-template-columns: 1fr; }
  .tnf-seats .tnf-field { width: 100%; }
  .tnf-actions { flex-direction: column-reverse; align-items: stretch; position: static; }
  .tnf-actions .tnf-status { margin: 0 0 .4rem; justify-content: center; }
  .tnf-actions .btn-bamoun,
  .tnf-actions .cal-btn { width: 100%; justify-content: center; }
}

@media (max-width: 600px) {
  .tnf-choices { grid-template-columns: repeat(2, 1fr); }
  .tnf-choice-emoji { height: 1.8rem; font-size: 1.35rem; }
  .tnf-choice-label { font-size: .76rem; }
  .tni-when { display: none; }
  .tni-export-label { flex: 1 0 100%; margin-bottom: .3rem; }
  .tni-export a { flex: 1; justify-content: center; }
}

/* ============================================================
   GRILLE DES ANNONCES — page /tableau-noir
   ============================================================ */

/* ══ A. EN-TÊTE ══════════════════════════════════════════════ */

.tnb-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--sp-xl) + 10px) 0 var(--sp-lg);
  background: linear-gradient(135deg, #2E1B14 0%, var(--c-secondary) 45%, #7A4A25 100%);
  color: #fff;
}

/* Halo ambré qui donne du relief au bandeau */
.tnb-hero-glow {
  position: absolute;
  top: -180px; right: -140px;
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(255,143,0,.42), transparent 62%);
  pointer-events: none;
  animation: tnbFloat 15s ease-in-out infinite;
}

/* Trame discrète, dans l'esprit du motif bamoun du pied de page */
.tnb-hero-grain {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.05) 1.5px, transparent 1.5px),
    radial-gradient(circle at 70% 65%, rgba(255,255,255,.04) 1.5px, transparent 1.5px);
  background-size: 46px 46px, 62px 62px;
  pointer-events: none;
}

@keyframes tnbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-28px, 22px) scale(1.07); }
}

.tnb-hero-inner {
  position: relative;
  display: flex; flex-wrap: wrap; gap: var(--sp-lg);
  align-items: center; justify-content: space-between;
}

.tnb-hero-text { flex: 1 1 380px; min-width: 0; animation: tnfRise .55s ease both; }

.tnb-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .9rem .3rem .7rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-full);
  font-size: .73rem; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--c-primary-light);
}

.tnb-eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 0 0 rgba(255,143,0,.7);
  animation: tnfPulse 2.4s ease-out infinite;
}

.tnb-hero-title {
  margin: .8rem 0 .4rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 700; line-height: 1.1;
}

.tnb-hero-sub {
  margin: 0 0 var(--sp-md);
  max-width: 46ch;
  font-size: 1rem; line-height: 1.65;
  color: rgba(255,255,255,.76);
}

.tnb-hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ── Boutons ─────────────────────────────────────────────── */

.tnb-cta {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .8rem 1.5rem;
  background: var(--c-primary); color: #fff !important;
  border: none; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: .92rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 18px rgba(255,143,0,.34);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.tnb-cta:hover {
  background: var(--c-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255,143,0,.45);
}
/* Reflet qui balaie le bouton au survol */
.tnb-cta::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.38) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.tnb-cta:hover::after { transform: translateX(120%); }

.tnb-cta--ghost {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: none;
}
.tnb-cta--ghost:hover { background: rgba(255,255,255,.19); box-shadow: none; }

.tnb-cta--dark { background: var(--c-secondary); box-shadow: 0 5px 18px rgba(78,52,46,.3); }
.tnb-cta--dark:hover { background: #6D4C41; box-shadow: 0 10px 26px rgba(78,52,46,.4); }

.tnb-cta--sm { padding: .55rem 1.1rem; font-size: .85rem; }

/* ── Chiffres du tableau ─────────────────────────────────── */

.tnb-hero-stats {
  display: flex; flex-wrap: wrap; gap: .7rem;
  animation: tnfRise .55s .12s ease both;
}

.tnb-stat {
  min-width: 116px;
  padding: 1rem 1.2rem;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-md);
  text-align: center;
  backdrop-filter: blur(6px);
  transition: transform var(--t-base), background var(--t-base);
}
.tnb-stat:hover { transform: translateY(-4px); background: rgba(255,255,255,.15); }

.tnb-stat-emoji { display: block; font-size: 1.3rem; line-height: 1.4; }
.tnb-stat strong {
  display: block;
  font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1;
}
.tnb-stat em {
  display: block; margin-top: .1rem;
  font-style: normal; font-size: .74rem;
  color: rgba(255,255,255,.62);
  letter-spacing: .5px; text-transform: uppercase;
}
.tnb-stat--accent { border-color: rgba(255,143,0,.55); background: rgba(255,143,0,.15); }

/* ══ B. MESSAGE ÉPHÉMÈRE ═════════════════════════════════════ */

.tnb-flash {
  display: flex; align-items: center; gap: .6rem;
  margin: var(--sp-md) 0 0;
  padding: .85rem 1.1rem;
  background: #E8F5E9;
  border-left: 4px solid #43A047;
  border-radius: var(--r-sm);
  font-size: .92rem; color: #2E7D32;
  animation: tnfSlideIn .4s ease both;
}
.tnb-flash span { font-size: 1.15rem; }
.tnb-flash--info { background: var(--c-cream); border-left-color: var(--c-primary); color: #8A5200; }

/* ══ C. FILTRES ══════════════════════════════════════════════ */

.tnb-filters {
  position: sticky; top: var(--nav-h); z-index: 20;
  padding: var(--sp-sm) 0;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow var(--t-base);
}
.tnb-filters.is-stuck { box-shadow: 0 6px 20px rgba(78,52,46,.12); }

.tnb-filters-row {
  display: flex; flex-wrap: wrap; gap: .7rem;
  align-items: center; justify-content: space-between;
  margin-bottom: .6rem;
}

.tnb-search {
  position: relative;
  flex: 1 1 260px; max-width: 420px;
  display: flex; align-items: center;
}
.tnb-search > i {
  position: absolute; left: .8rem;
  color: #B5AA9A; font-size: 1.2rem; pointer-events: none;
}
/* Le champ porte « browser-default » pour échapper au soulignement que
   Materialize impose à tout input[type=text] ; le padding est forcé afin
   que le texte ne passe pas sous la loupe. */
.tnb-search input {
  box-sizing: border-box;
  width: 100%; height: 44px;
  margin: 0 !important;
  padding: 0 2.4rem 0 2.5rem !important;
  background: #FAF6F0;
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-full);
  font-family: var(--font-body); font-size: .9rem; color: var(--c-text);
  box-shadow: none !important;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.tnb-search input:focus {
  background: #fff;
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px rgba(255,143,0,.13) !important;
}
.tnb-search-clear {
  position: absolute; right: .7rem;
  display: flex; color: #B5AA9A;
  transition: color var(--t-fast);
}
.tnb-search-clear:hover { color: var(--c-primary-dark); }
.tnb-search-clear i { font-size: 1.1rem; }

.tnb-filters-tools { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; }

.tnb-sort {
  height: 40px;
  width: auto; min-width: 150px; max-width: 220px;
  padding: 0 .8rem;
  background: #FAF6F0;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: .86rem; color: var(--c-text);
  cursor: pointer; outline: none;
  transition: border-color var(--t-fast);
}
.tnb-sort:focus { border-color: var(--c-primary); }

/* ── Interrupteurs ───────────────────────────────────────── */

.tnb-switch {
  display: inline-flex; align-items: center; gap: .45rem;
  cursor: pointer; user-select: none;
  font-size: .84rem; color: var(--c-text-muted);
}
.tnb-switch > input { position: absolute; opacity: 0; pointer-events: none; }

.tnb-switch-track {
  position: relative; flex: 0 0 auto;
  width: 36px; height: 20px;
  background: #D8CDBB;
  border-radius: var(--r-full);
  transition: background var(--t-base);
}
/* Materialize dessine sa case en ::before sur le frère de l'input et met le
   ::after à scale(0) ; ses sélecteurs sont plus spécifiques que les nôtres,
   seul !important les désarme. */
.tnb-switch > input + .tnb-switch-track::before { content: none !important; }
.tnb-switch > input + .tnb-switch-track::after {
  content: "" !important;
  position: absolute !important;
  top: 3px !important; left: 3px !important;
  width: 14px !important; height: 14px !important;
  border: 0 !important; border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.24) !important;
  transform: translateX(0) !important;
  transition: transform .22s ease !important;
}
.tnb-switch > input:checked + .tnb-switch-track { background: var(--c-primary); }
.tnb-switch > input:checked + .tnb-switch-track::after { transform: translateX(16px) !important; }
.tnb-switch > input:checked ~ .tnb-switch-label { color: var(--c-primary-dark); font-weight: 700; }

/* ── Catégories ──────────────────────────────────────────── */

.tnb-cats {
  display: flex; gap: .4rem;
  overflow-x: auto;
  padding-bottom: .2rem;
  scrollbar-width: none;
}
.tnb-cats::-webkit-scrollbar { display: none; }

.tnb-cat {
  position: relative;
  display: inline-flex; align-items: center; gap: .35rem;
  flex: 0 0 auto;
  padding: .42rem .95rem;
  background: #F5F0EA;
  border: 1.5px solid transparent;
  border-radius: var(--r-full);
  font-family: var(--font-body); font-size: .85rem; font-weight: 600;
  color: var(--c-text-muted);
  white-space: nowrap; cursor: pointer;
  transition: all var(--t-fast);
}
.tnb-cat:hover {
  background: #fff;
  border-color: var(--cc, var(--c-primary));
  color: var(--cc, var(--c-primary-dark));
  transform: translateY(-2px);
}
.tnb-cat.is-on {
  background: var(--cc, var(--c-secondary));
  border-color: var(--cc, var(--c-secondary));
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cc, #4E342E) 38%, transparent);
}
.tnb-cat i { font-size: 1rem !important; }
.tnb-cat-emoji { font-size: .98rem; line-height: 1.3; }

.tnb-cat-n {
  padding: .05rem .42rem;
  background: rgba(0,0,0,.09);
  border-radius: var(--r-full);
  font-size: .72rem; font-weight: 700;
}
.tnb-cat.is-on .tnb-cat-n { background: rgba(255,255,255,.26); }
.tnb-cat-bell { font-size: .72rem; }

/* ── Abonnements aux rubriques ───────────────────────────── */

.tnb-subs { margin-top: .5rem; }

.tnb-subs summary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem 0;
  font-size: .8rem; font-weight: 700; color: var(--c-text-muted);
  cursor: pointer; list-style: none;
  transition: color var(--t-fast);
}
.tnb-subs summary::-webkit-details-marker { display: none; }
.tnb-subs summary::marker { content: ""; }
.tnb-subs summary:hover { color: var(--c-primary-dark); }
.tnb-subs summary i { font-size: 1rem !important; color: var(--c-primary); }
.tnb-subs summary::after {
  content: "expand_more";
  font-family: "Material Icons"; font-size: 1.1rem; font-weight: 400;
  transition: transform var(--t-fast);
}
.tnb-subs[open] summary::after { transform: rotate(180deg); }

.tnb-subs-n {
  padding: .04rem .45rem;
  background: var(--c-primary);
  border-radius: var(--r-full);
  color: #fff; font-size: .7rem;
}

.tnb-subs-list {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .5rem 0 .2rem;
  animation: tnfSlideIn .3s ease both;
}

.tnb-sub {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .75rem;
  background: #F5F0EA;
  border: 1.5px solid transparent;
  border-radius: var(--r-full);
  font-family: var(--font-body); font-size: .78rem; font-weight: 600;
  color: var(--c-text-muted); cursor: pointer;
  transition: all var(--t-fast);
}
.tnb-sub:hover { border-color: var(--cc, var(--c-primary)); transform: translateY(-1px); }
.tnb-sub.is-on {
  background: color-mix(in srgb, var(--cc, #FF8F00) 13%, white);
  border-color: var(--cc, var(--c-primary));
  color: var(--cc, var(--c-primary-dark));
}
.tnb-sub i { font-size: .95rem !important; }

/* ══ D. GRILLE ═══════════════════════════════════════════════ */

.tnb-board { padding: var(--sp-lg) 0 var(--sp-xl); background: var(--c-bg); }

.tnb-board-head {
  display: flex; flex-wrap: wrap; gap: var(--sp-sm);
  align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-md);
}
.tnb-count { font-size: .92rem; color: var(--c-text-muted); }
.tnb-count strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--c-secondary); }

.tnb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: var(--sp-md);
}

.tnb-card {
  display: flex; flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: tnfRise .5s cubic-bezier(.22,.9,.3,1) both;
  animation-delay: var(--d, 0s);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.tnb-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 38px rgba(78,52,46,.18);
  border-color: var(--cc, var(--c-primary));
}
.tnb-card.is-expired { opacity: .72; }
.tnb-card.is-expired:hover { opacity: 1; }

/* ── Visuel ──────────────────────────────────────────────── */

.tnb-card-visual {
  position: relative; display: block;
  height: 168px; overflow: hidden;
  background: linear-gradient(140deg, var(--cc, #4E342E), color-mix(in srgb, var(--cc, #4E342E) 58%, black));
}
.tnb-card-visual img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .55s cubic-bezier(.22,.9,.3,1);
}
.tnb-card:hover .tnb-card-visual img { transform: scale(1.07); }

.tnb-card-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.1rem; opacity: .55;
  transition: transform var(--t-base);
}
.tnb-card-fallback i { font-size: 3rem !important; color: rgba(255,255,255,.8); }
.tnb-card:hover .tnb-card-fallback { transform: scale(1.1) rotate(-4deg); }

.tnb-card-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.42), transparent 52%);
  pointer-events: none;
}

.tnb-card-cat {
  position: absolute; top: .65rem; left: .65rem;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .7rem;
  background: rgba(255,255,255,.95);
  border-radius: var(--r-full);
  font-size: .74rem; font-weight: 700;
  color: var(--cc, var(--c-secondary));
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.tnb-card-cat i { font-size: .9rem !important; }

.tnb-card-flags {
  position: absolute; top: .65rem; right: .65rem;
  display: flex; flex-direction: column; gap: .25rem; align-items: flex-end;
}
.tnb-flag {
  padding: .22rem .6rem;
  border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.tnb-flag--new  { background: #43A047; color: #fff; }
.tnb-flag--soon { background: #EF6C00; color: #fff; }
.tnb-flag--old  { background: rgba(0,0,0,.6); color: rgba(255,255,255,.9); }

/* ── Corps ───────────────────────────────────────────────── */

.tnb-card-body { flex: 1; padding: .95rem 1.05rem .7rem; }

.tnb-card-title { margin: 0 0 .4rem; font-size: 1.06rem; line-height: 1.35; }
.tnb-card-title a {
  font-family: var(--font-display);
  color: var(--c-secondary); text-decoration: none;
  transition: color var(--t-fast);
}
.tnb-card:hover .tnb-card-title a { color: var(--cc, var(--c-primary-dark)); }

.tnb-card-desc {
  margin: 0 0 .65rem;
  font-size: .86rem; line-height: 1.6; color: var(--c-text-muted);
}

.tnb-card-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.tnb-card-meta span {
  padding: .2rem .55rem;
  background: #FAF6F0;
  border-radius: var(--r-full);
  font-size: .74rem; color: #7A6E62;
  white-space: nowrap;
}

/* ── Places ──────────────────────────────────────────────── */

.tnb-card-seats {
  display: flex; align-items: center; gap: .45rem;
  margin-top: .65rem;
  padding-top: .6rem;
  border-top: 1px dashed var(--c-border);
}
.tnb-seats-badge {
  padding: .2rem .55rem;
  background: var(--c-cream);
  border-radius: var(--r-full);
  font-size: .76rem; font-weight: 700; color: var(--c-primary-dark);
  white-space: nowrap;
}
.tnb-card-seats.is-full .tnb-seats-badge { background: #FFEBEE; color: #C62828; }

.tnb-seats-track {
  flex: 1; height: 6px;
  background: #F0E7D8;
  border-radius: var(--r-full);
  overflow: hidden;
}
.tnb-seats-track > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-light));
  border-radius: var(--r-full);
  transition: width .6s cubic-bezier(.22,.9,.3,1);
}
.tnb-card-seats.is-full .tnb-seats-track > span { background: linear-gradient(90deg, #C62828, #E53935); }

.tnb-seats-text { font-size: .73rem; font-weight: 600; color: var(--c-text-muted); white-space: nowrap; }

/* ── Pied de carte ───────────────────────────────────────── */

.tnb-card-foot {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1.05rem .8rem;
  border-top: 1px solid var(--c-border);
}
.tnb-card-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.tnb-card-author { min-width: 0; flex: 1; line-height: 1.3; }
.tnb-card-author strong {
  display: block; font-size: .82rem; color: var(--c-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tnb-card-author em { font-style: normal; font-size: .72rem; color: #9A8B72; }

.tnb-card-save {
  background: none; border: none; cursor: pointer;
  color: #C9BCA6; padding: .25rem;
  border-radius: 50%;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.tnb-card-save:hover { color: var(--c-primary); background: var(--c-cream); transform: scale(1.12); }
.tnb-card-save.is-on { color: var(--c-primary); }
.tnb-card-save i { font-size: 1.15rem !important; }

.tnb-card-go {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: #F5F0EA;
  border-radius: 50%;
  color: var(--c-secondary);
  transition: all var(--t-fast);
}
.tnb-card-go:hover {
  background: var(--cc, var(--c-primary));
  color: #fff;
  transform: translateX(3px);
}
.tnb-card-go i { font-size: 1.05rem !important; }

/* ══ E. AUCUN RÉSULTAT ═══════════════════════════════════════ */

.tnb-empty {
  padding: var(--sp-2xl) var(--sp-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-align: center;
  animation: tnfRise .5s ease both;
}
.tnb-empty-emoji {
  display: block; font-size: 3.4rem; line-height: 1.3;
  animation: tnbBob 3.2s ease-in-out infinite;
}
@keyframes tnbBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
.tnb-empty h3 {
  margin: .6rem 0 .3rem;
  font-family: var(--font-display); font-size: 1.4rem; color: var(--c-secondary);
}
.tnb-empty p { margin: 0 0 var(--sp-md); color: var(--c-text-muted); font-size: .93rem; }

/* ══ F. RESPONSIVE ═══════════════════════════════════════════ */

@media (max-width: 992px) {
  .tnb-hero { padding: var(--sp-lg) 0; }
  .tnb-hero-inner { gap: var(--sp-md); }
  .tnb-hero-stats { width: 100%; }
  .tnb-stat { flex: 1; min-width: 96px; padding: .8rem .6rem; }
  .tnb-stat strong { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .tnb-filters { top: var(--nav-h-mobile); }
  .tnb-filters-row { flex-direction: column; align-items: stretch; }
  .tnb-search { max-width: none; }
  .tnb-filters-tools { justify-content: space-between; }
  .tnb-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-sm); }
}

@media (max-width: 600px) {
  .tnb-hero-title { font-size: 2rem; }
  .tnb-hero-actions .tnb-cta { flex: 1; justify-content: center; }
  .tnb-grid { grid-template-columns: 1fr; }
  .tnb-card-visual { height: 152px; }
  .tnb-sort { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tnb-hero-glow, .tnb-eyebrow-dot, .tnb-empty-emoji,
  .tnb-card { animation: none !important; }
}
