/* =============================================================
   style_app.css
   Styles complémentaires pour les pages introduites par la
   refonte MVC (auth, contact, profil, messagerie, admin,
   commentaires, erreurs, flash). Respecte la charte du portfolio.
   ============================================================= */

:root {
  --c-primary: #4f52ba;
  --c-primary-dark: #3b3e99;
  --c-primary-light: #7c4dff;
  --c-accent: #8e2de2;
  --c-accent-2: #4a00e0;
  --c-bg-light: #f0f4ff;
  --c-bg-card: #ffffff;
  --c-bg-dark: #0c0c0c;
  --c-bg-dark-2: #1a1a1a;
  --c-bg-dark-3: #161a2d;
  --c-text: #161a2d;
  --c-text-muted: #6b7280;
  --c-text-dark: #d1d5db;
  --c-border: #e5e7eb;
  --c-border-dark: #2a2a2a;
  --c-success: #16a34a;
  --c-success-bg: #dcfce7;
  --c-error: #dc2626;
  --c-error-bg: #fee2e2;
  --c-warn: #d97706;
  --c-warn-bg: #fef3c7;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   Layout adjustments (applied to <main class="layout-main">)
   ========================================================= */
.layout-main {
  padding-left: 76px;
  transition: padding-left 0.3s ease;
  min-height: 100dvh;
  width: 100%;
  box-sizing: border-box;
}
@media (hover: hover) and (pointer: fine) {
  .sidebar:hover ~ .layout-main {
    padding-left: 260px;
  }
}

/* =========================================================
   MOBILE NAV — Topbar + Drawer
   Affiché en < 768px sur toutes les pages (la home partage la même sidebar
   + le même drawer mobile que le reste du site pour une nav cohérente).
   ========================================================= */

/* ── Drawer : styles applicables partout ── */
.mobile-drawer {
  display: none; /* override par @media (max-width: 768px) plus bas */
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}
.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 360px);
  background: #161a2d;
  color: #fff;
  padding: 1rem 1.25rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.24, 1);
  will-change: transform;
  pointer-events: auto;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}
.mobile-drawer.is-open {
  pointer-events: auto;
}
.mobile-drawer.is-open .mobile-drawer__backdrop {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer.is-open .mobile-drawer__panel {
  transform: translateX(0);
}

.mobile-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}
.mobile-drawer__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mobile-drawer__avatar {
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-primary);
}
.mobile-drawer__user strong {
  display: block;
  font-size: 0.95rem;
}
.mobile-drawer__user span {
  display: block;
  font-size: 0.78rem;
  color: #aaa;
}
.mobile-drawer__user a {
  color: var(--c-primary-light);
  text-decoration: none;
}

.mobile-drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-drawer__close:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-drawer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-drawer__sep {
  font-size: 0.7rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1rem 0 0.4rem;
  padding: 0 0.5rem;
}
.mobile-drawer__links li a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.6rem;
  color: #ddd;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  transition:
    background 0.15s,
    color 0.15s;
}
.mobile-drawer__links li a:hover {
  background: rgba(79, 82, 186, 0.15);
  color: #fff;
}
.mobile-drawer__links .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--c-primary-light);
}
.mobile-drawer__footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.85rem;
  color: #888;
}
.mobile-drawer__footer a {
  color: #ccc;
  text-decoration: none;
  margin: 0 0.4rem;
}
.mobile-drawer__footer a:hover {
  color: #fff;
}

/* ── Topbar mobile (caché par défaut, affiché en mobile) ── */
.mobile-topbar {
  display: none;
}
.mobile-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}
.mobile-topbar__brand img {
  border-radius: 50%;
  object-fit: cover;
}
.mobile-burger {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.mobile-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
}
.mobile-burger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-burger.is-active span:nth-child(2) {
  opacity: 0;
}
.mobile-burger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Bascule mobile : sidebar OUT, mobile-nav IN ── */
@media (max-width: 768px) {
  .sidebar {
    display: none !important;
  }
  .layout-main {
    padding-left: 0 !important;
    padding-top: 56px;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 16px;
    background: rgba(22, 26, 45, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-drawer {
    display: block;
  }
}

/* =========================================================
   Toast notifications
   ========================================================= */
.toast-region {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(380px, calc(100vw - 2.5rem));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  pointer-events: all;
  position: relative;
  overflow: hidden;
  animation: toast-in 0.38s cubic-bezier(0.32, 0.72, 0.24, 1) both;
  will-change: transform, opacity;
}
.toast.is-hiding {
  animation: toast-out 0.28s ease forwards;
}

.toast__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}
.toast__msg {
  margin: 0;
  line-height: 1.45;
}
.toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  opacity: 0.55;
  transition:
    opacity 0.15s,
    background 0.15s;
  flex-shrink: 0;
  padding: 0;
  color: inherit;
}
.toast__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.07);
}
.toast__close .material-symbols-outlined {
  font-size: 1rem;
  line-height: 1;
}
.toast__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toast-bar var(--toast-duration, 5000ms) linear forwards;
}

/* Variantes */
.toast--success {
  background: var(--c-success-bg);
  color: var(--c-success);
  border-left: 3px solid var(--c-success);
}
.toast--success .toast__bar {
  background: var(--c-success);
}

.toast--error {
  background: var(--c-error-bg);
  color: var(--c-error);
  border-left: 3px solid var(--c-error);
}
.toast--error .toast__bar {
  background: var(--c-error);
}

.toast--warn {
  background: var(--c-warn-bg);
  color: var(--c-warn);
  border-left: 3px solid var(--c-warn);
}
.toast--warn .toast__bar {
  background: var(--c-warn);
}

.toast--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-left: 3px solid #3b82f6;
}
.toast--info .toast__bar {
  background: #3b82f6;
}

/* Animations */
@keyframes toast-in {
  from {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
    max-height: 120px;
    padding-block: 0.9rem;
  }
  to {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    max-height: 0;
    padding-block: 0;
  }
}
@keyframes toast-bar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-hiding {
    animation: none;
  }
  .toast__bar {
    animation: none;
    display: none;
  }
}
@media (max-width: 640px) {
  .toast-region {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: 100%;
  }
  @keyframes toast-in {
    from {
      transform: translateY(0.75rem);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  @keyframes toast-out {
    from {
      transform: translateY(0);
      opacity: 1;
      max-height: 120px;
      padding-block: 0.9rem;
    }
    to {
      transform: translateY(0.75rem);
      opacity: 0;
      max-height: 0;
      padding-block: 0;
    }
  }
}

/* =========================================================
   Boutons utilitaires
   ========================================================= */
.btn-primary,
.btn-secondary,
button.btn-primary,
button.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s,
    transform 0.1s;
  line-height: 1.2;
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-primary-dark);
}
.btn-secondary {
  background: #fff;
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn-secondary:hover {
  background: var(--c-primary);
  color: #fff;
}
.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.btn-icon:hover {
  background: rgba(79, 82, 186, 0.1);
}

/* Boutons d'action admin – version light de .ct-btn */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.adm-btn:hover {
  background: rgba(79, 82, 186, 0.08);
  color: var(--c-primary);
}
.adm-btn--del:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.adm-btn--ok:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.btn-reset {
  background: #e5e7eb;
  color: #4b5563;
  padding: 0.75rem 1.4rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 500;
  border: none;
}
.btn-reset:hover {
  background: #d1d5db;
}

/* =========================================================
   Conteneurs de formulaires "auth" (login, inscription, profil, contact)
   ========================================================= */
.auth-container {
  min-height: calc(100dvh - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--c-bg-light);
}

.auth-box {
  width: 100%;
  max-width: 480px;
  background: var(--c-bg-card);
  padding: 2.5rem;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.auth-box h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--c-text);
  font-weight: 700;
}
.auth-box .lead {
  text-align: center;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.auth-box label,
.admin-form label {
  display: block;
  font-weight: 500;
  margin: 1rem 0 0.4rem;
  color: var(--c-text);
  font-size: 0.95rem;
}

.auth-box input,
.auth-box textarea,
.auth-box select,
.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 1rem;
  background: #f9fafb;
  color: var(--c-text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
}
.auth-box input:focus,
.auth-box textarea:focus,
.auth-box select:focus,
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 82, 186, 0.1);
}
.auth-box textarea {
  resize: vertical;
  min-height: 120px;
}
.auth-box input[type="file"],
.admin-form input[type="file"] {
  padding: 0.5rem;
  background: #fff;
  cursor: pointer;
}
.auth-box button[type="submit"],
.admin-form button[type="submit"] {
  margin-top: 1.5rem;
  width: 100%;
}
.auth-box .auth-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--c-text-muted);
}
.auth-box .auth-link a {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-box .auth-link a:hover {
  text-decoration: underline;
}

/* Password show/hide */
.password-container {
  position: relative;
}
.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--c-primary);
  padding: 4px;
  line-height: 1;
}
.toggle-password .material-symbols-outlined {
  font-size: 1.3rem;
  vertical-align: middle;
}

/* =========================================================
   Auth pages v2 — connexion, inscription, contact
   ========================================================= */

/* Wrapper plein écran avec fond teinté + orbes */
.auth-wrap {
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #eef1ff 0%, #ede8ff 45%, #f5f0ff 100%);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.auth-orb--1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(
    circle,
    rgba(142, 45, 226, 0.28) 0%,
    transparent 65%
  );
  top: -120px;
  right: -80px;
  animation: auth-orb 11s ease-in-out infinite alternate;
}
.auth-orb--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(79, 82, 186, 0.22) 0%,
    transparent 65%
  );
  bottom: -100px;
  left: -60px;
  animation: auth-orb 15s ease-in-out infinite alternate-reverse;
}
@keyframes auth-orb {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(22px, 18px);
  }
}

/* Card */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--c-bg-card);
  border-radius: var(--r-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: auth-card-in 0.48s cubic-bezier(0.32, 0.72, 0.24, 1) both;
}
.auth-card--wide {
  max-width: 520px;
}

@keyframes auth-card-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Barre accent en haut */
.auth-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--c-accent),
    var(--c-accent-2),
    var(--c-primary)
  );
}

/* En-tête */
.auth-card__head {
  text-align: center;
  padding: 2rem 2.5rem 1.75rem;
}
.auth-card__badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 18px rgba(142, 45, 226, 0.28);
}
.auth-card__badge .material-symbols-outlined {
  font-size: 1.9rem;
  color: #fff;
}
.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 0.35rem;
}
.auth-card__sub {
  color: var(--c-text-muted);
  font-size: 0.88rem;
  margin: 0;
}

/* Corps du formulaire */
.auth-form {
  padding: 0 2.5rem 2rem;
  display: flex;
  flex-direction: column;
}

/* Ligne 2 colonnes (prénom / nom) */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Champ avec label fixe au-dessus */
.auth-field {
  margin-bottom: 1rem;
}

.auth-field > label,
.auth-field--select > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-muted);
  margin-bottom: 0.38rem;
  transition: color 0.18s;
}
.auth-field:focus-within > label,
.auth-field--select:focus-within > label {
  color: var(--c-primary);
}
.auth-field__hint {
  font-weight: 400;
  color: var(--c-text-muted);
  font-size: 0.75rem;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.78rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 0.97rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--c-text);
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.auth-field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}
.auth-field input:focus,
.auth-field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 82, 186, 0.11);
}

/* Wrapper pour input + toggle (password) */
.auth-field__pwd-wrap {
  position: relative;
}
.auth-field__pwd-wrap input[type="password"],
.auth-field__pwd-wrap input[type="text"] {
  padding-right: 2.75rem;
}

/* Bouton toggle mot de passe */
.auth-field__toggle {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  line-height: 1;
}
.auth-field__toggle:hover {
  color: var(--c-primary);
}
.auth-field__toggle .material-symbols-outlined {
  font-size: 1.15rem;
}

/* Champ select */
.auth-field--select {
  margin-bottom: 1rem;
}
.auth-field--select select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.82rem 2.5rem 0.82rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 1rem;
  background-color: #f9fafb;
  color: var(--c-text);
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.auth-field--select select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 82, 186, 0.11);
}

/* Zone upload photo */
.auth-upload {
  margin-bottom: 0.5rem;
}
.auth-upload__label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1.5px dashed var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  user-select: none;
}
.auth-upload__label:hover {
  border-color: var(--c-primary);
  background: var(--c-bg-light);
}
.auth-upload__label .material-symbols-outlined {
  font-size: 1.5rem;
  color: var(--c-primary);
  flex-shrink: 0;
}
.auth-upload__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.auth-upload__text strong {
  font-size: 0.875rem;
  color: var(--c-text);
  font-weight: 600;
}
.auth-upload__text small {
  font-size: 0.76rem;
  color: var(--c-text-muted);
}
.auth-upload input[type="file"] {
  display: none;
}

/* Bouton submit */
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 1.5rem;
  box-shadow: 0 4px 18px rgba(142, 45, 226, 0.28);
  transition:
    opacity 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.auth-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(142, 45, 226, 0.38);
}
.auth-submit:active {
  transform: translateY(0);
}
.auth-submit .material-symbols-outlined {
  font-size: 1.1rem;
  transition: transform 0.2s;
}
.auth-submit:hover .material-symbols-outlined {
  transform: translateX(3px);
}

/* Lien de switch (bas de carte) */
.auth-card__switch {
  text-align: center;
  padding: 1.2rem 2.5rem 1.75rem;
  font-size: 0.88rem;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
  margin: 0;
}
.auth-card__switch a {
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-card__switch a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .auth-card__head {
    padding: 1.75rem 1.5rem 1.5rem;
  }
  .auth-form {
    padding: 0 1.5rem 1.75rem;
  }
  .auth-card__switch {
    padding: 1rem 1.5rem 1.5rem;
  }
  .auth-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
  .auth-orb {
    animation: none;
  }
  .auth-submit .material-symbols-outlined {
    transition: none;
  }
}

/* Profil — fieldset password */
.password-fieldset {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 1rem;
  margin-top: 1.5rem;
  background: #fafbfd;
}
.password-fieldset legend {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  padding: 0 0.5rem;
}
.user-meta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}
.user-meta dt {
  font-weight: 600;
  color: var(--c-text-muted);
}
.user-meta dd {
  color: var(--c-text);
  margin: 0;
}

/* =========================================================
   Page profil — v2 (panneau sombre + formulaire)
   ========================================================= */

.profil-wrap {
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #eef1ff 0%, #ede8ff 45%, #f5f0ff 100%);
}

.profil-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  border-radius: var(--r-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: auth-card-in 0.48s cubic-bezier(0.32, 0.72, 0.24, 1) both;
}
.profil-card > form {
  display: flex;
  width: 100%;
  min-height: 520px;
}

/* ── Panneau latéral sombre ── */
.profil-panel {
  width: 255px;
  flex-shrink: 0;
  background: linear-gradient(170deg, var(--c-bg-dark-3) 0%, #0c101e 100%);
  padding: 2.75rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--c-text-dark);
}

/* Avatar */
.profil-avatar-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}
.profil-avatar-img {
  width: 108px;
  height: 108px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid rgba(142, 45, 226, 0.55);
  box-shadow:
    0 0 0 6px rgba(142, 45, 226, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.45);
  background: #1e1e2e;
}
.profil-avatar-edit {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  border: 2.5px solid #0c101e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.profil-avatar-edit:hover {
  transform: scale(1.12);
  box-shadow: 0 3px 14px rgba(142, 45, 226, 0.55);
}
.profil-avatar-edit .material-symbols-outlined {
  font-size: 0.9rem;
  color: #fff;
  line-height: 1;
}
.profil-panel input[type="file"] {
  display: none;
}

/* Nom + badge rôle */
.profil-panel__info {
  width: 100%;
}
.profil-panel__name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem;
  line-height: 1.3;
}
.profil-panel__role {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  background: rgba(142, 45, 226, 0.18);
  border: 1px solid rgba(142, 45, 226, 0.38);
  font-size: 0.7rem;
  font-weight: 600;
  color: #c084fc;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  margin-bottom: 1.75rem;
}

/* Meta */
.profil-panel__meta {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}
.profil-panel__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.profil-panel__meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(209, 213, 219, 0.38);
}
.profil-panel__meta-value {
  font-size: 0.82rem;
  color: var(--c-text-dark);
}
.profil-panel__meta-value--ok {
  color: #4ade80;
}
.profil-panel__meta-value--wait {
  color: #fbbf24;
}

/* Supprimer photo */
.profil-panel__remove {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1.5rem;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 0.75rem;
  color: rgba(209, 213, 219, 0.4);
  transition: color 0.15s;
  text-align: left;
}
.profil-panel__remove:hover {
  color: #f87171;
}
.profil-panel__remove input {
  accent-color: #f87171;
  flex-shrink: 0;
}

/* ── Corps du formulaire ── */
.profil-body {
  flex: 1;
  background: var(--c-bg-card);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.profil-section {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--c-border);
}
.profil-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.profil-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 1.5rem;
}
.profil-section__title .material-symbols-outlined {
  font-size: 1.1rem;
  color: var(--c-primary);
}
.profil-section__hint {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin: -1.1rem 0 1.25rem;
}

.profil-actions {
  margin-top: auto;
  padding-top: 1.75rem;
}
.profil-actions .auth-submit {
  margin-top: 0;
  max-width: 340px;
}

/* ── Responsive tablette ── */
@media (max-width: 860px) {
  .profil-card > form {
    flex-direction: column;
  }

  .profil-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    text-align: left;
    padding: 1.5rem 1.75rem;
    gap: 0 1.25rem;
  }
  .profil-avatar-wrap {
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .profil-panel__info {
    flex: 1;
    align-self: center;
  }
  .profil-panel__role {
    margin-bottom: 0;
  }
  .profil-panel__meta {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }
  .profil-panel__remove {
    margin-top: 0;
    padding-top: 0.75rem;
    border-top: none;
  }
  .profil-body {
    padding: 1.75rem;
  }
  .profil-actions .auth-submit {
    max-width: 100%;
  }
}

/* ── Responsive mobile ── */
@media (max-width: 520px) {
  .profil-wrap {
    padding: 0.75rem;
  }
  .profil-panel {
    padding: 1.25rem;
  }
  .profil-body {
    padding: 1.25rem;
  }
  .profil-avatar-img {
    width: 80px;
    height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profil-card {
    animation: none;
  }
  .profil-avatar-edit {
    transition: none;
  }
}

/* =========================================================
   Messagerie (visiteur / évaluateur)
   ========================================================= */
.messagerie {
  background: var(--c-bg-light);
  height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.75rem 1rem;
}
.messagerie header {
  flex-shrink: 0;
  margin-bottom: 0.6rem;
}
.messagerie header h1 {
  font-size: 1.5rem;
  color: var(--c-text);
  margin: 0 0 0.4rem;
}
.messagerie .info-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #e8edff;
  color: #2d3580;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-sm);
  font-size: 0.83rem;
  line-height: 1.4;
}
.messagerie .info-banner small {
  opacity: 0.7;
  margin-left: auto;
  white-space: nowrap;
}
.messagerie .empty {
  margin: auto;
  text-align: center;
  color: var(--c-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.messagerie .empty svg {
  opacity: 0.3;
}
.messagerie .empty p {
  font-size: 0.93rem;
}

/* ── Fil de messages ── */
.messagerie .message-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

/* ── Bulles ── */
.message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 68%;
}
.message-wrapper.recu {
  align-self: flex-start;
}
.message-wrapper.envoye {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.message-wrapper .avatar img {
  width: 32px;
  height: 32px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.message-wrapper .message {
  background: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: var(--c-text);
  font-size: 0.93rem;
  line-height: 1.55;
}
.message-wrapper.envoye .message {
  background: var(--c-primary);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}
.message-wrapper .message strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 3px;
  opacity: 0.7;
}
.message-wrapper .message p {
  margin: 0;
  word-break: break-word;
}
.message-wrapper .message small {
  display: block;
  font-size: 0.67rem;
  opacity: 0.55;
  margin-top: 5px;
  text-align: right;
}

/* ── Zone de saisie (partagée visiteur + admin) ── */
.message-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  margin-top: 0.6rem;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.message-form:focus-within {
  border-color: var(--c-primary);
}
.message-form textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--c-text);
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
  background: transparent;
  padding: 0.15rem 0;
}
.message-form textarea::placeholder {
  color: var(--c-text-muted);
}
.msg-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--c-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    transform 0.1s;
}
.msg-send-btn:hover {
  background: var(--c-primary-dark);
}
.msg-send-btn:active {
  transform: scale(0.92);
}

/* =========================================================
   Messagerie ADMIN (concepteur)
   ========================================================= */
.messagerie-admin {
  background: #fff;
  border-radius: var(--r-lg);
  height: calc(100dvh - 100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.messagerie-admin > header {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.messagerie-admin > header h1 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--c-text);
}

.messagerie-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Liste des conversations ── */
.conversations-list {
  border-right: 1px solid var(--c-border);
  overflow-y: auto;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.conversations-search {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: #fafbfd;
  z-index: 1;
}
.conversations-search input {
  width: 100%;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.conversations-search input:focus {
  border-color: var(--c-primary);
}
.conversations-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.conv-item a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  transition: background 0.15s;
}
.conv-item a:hover {
  background: #f0f4ff;
}
.conv-item.active a {
  background: #e8edff;
  border-left: 3px solid var(--c-primary);
  padding-left: calc(1rem - 3px);
}
.conv-item img {
  width: 42px;
  height: 42px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.conv-meta {
  flex: 1;
  min-width: 0;
}
.conv-meta strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-meta .conv-role {
  display: inline-block;
  font-size: 0.68rem;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #e8edff;
  padding: 1px 6px;
  border-radius: 3px;
  margin: 2px 0;
}
.conv-meta .conv-preview {
  display: block;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.conv-badge {
  background: var(--c-error);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}

/* ── Volet conversation ── */
.conversation-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  min-width: 0;
}
.conversation-pane .empty {
  margin: auto;
  color: var(--c-text-muted);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.conversation-pane .empty svg {
  opacity: 0.25;
}

/* ── En-tête conversation ── */
.conv-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  background: #fff;
}
.conv-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--c-text-muted);
  text-decoration: none;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}
.conv-back:hover {
  background: #f0f4ff;
  color: var(--c-primary);
}
.conv-header-avatar {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.conv-header-info {
  flex: 1;
  min-width: 0;
}
.conv-header-info strong {
  display: block;
  font-size: 0.93rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-header-info span {
  font-size: 0.78rem;
  color: var(--c-text-muted);
}

.conversation-pane .message-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--c-bg-light);
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.conversation-pane .message-form {
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--c-border);
  box-shadow: none;
  padding: 0.7rem 1.25rem;
  background: #fff;
}
.conversation-pane .message-form:focus-within {
  border-top-color: var(--c-primary);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .messagerie {
    padding: 0.75rem 0.85rem 0.65rem;
  }
  .messagerie .info-banner small {
    display: none;
  }
  .message-wrapper {
    max-width: 88%;
  }

  .messagerie-admin {
    height: calc(100dvh - 56px);
    border-radius: 0;
  }

  /* Abandon du grid : block + height 100% sur chaque panneau */
  .messagerie-layout {
    display: block;
    overflow: hidden;
    /* flex: 1 est conservé par l'héritage de la règle desktop */
  }

  /* Navigation panneau : liste OU conversation, un seul visible à la fois */
  .messagerie-layout.has-active .conversations-list {
    display: none;
  }
  .messagerie-layout:not(.has-active) .conversation-pane {
    display: none;
  }

  .conversations-list {
    border-right: none;
    height: 100%;
    overflow-y: auto;
  }
  .conversation-pane {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .conv-back {
    display: flex;
  }
  .conv-header {
    padding: 0.6rem 0.85rem;
  }
  .conversation-pane .message-container {
    padding: 1rem 0.85rem;
  }
  .conversation-pane .message-form {
    padding: 0.6rem 0.85rem;
  }
}

/* =========================================================
   Commentaires (page projet, fond sombre)
   ========================================================= */
.comments-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Titre + compteur */
.comments-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1.75rem;
}
.comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  background: rgba(142, 45, 226, 0.25);
  border: 1px solid rgba(142, 45, 226, 0.4);
  color: #c084fc;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
}
.comments-empty-text {
  color: #6b7280;
  font-style: italic;
  padding: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

/* ── État vide + formulaire fusionnés ── */
.comments-empty-box {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
}
.comments-empty-box__msg {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0 0 1.1rem;
}
.comments-empty-box__msg svg {
  flex-shrink: 0;
  color: #4b5563;
}
.comments-empty-box__form {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.comments-empty-box__form:focus-within {
  border-color: rgba(142, 45, 226, 0.45);
  box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.1);
}
.comments-empty-box__form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.93rem;
  resize: none;
  min-height: 80px;
  outline: none;
}
.comments-empty-box__form textarea::placeholder {
  color: #4b5563;
}
.comments-empty-box__form button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-end;
  margin: 0 0.75rem 0.75rem;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(120deg, #8e2de2, #4a00e0);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.comments-empty-box__form button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────
   Fil de discussion (thread)
   ───────────────────────────────────────────────────── */
.comments-thread {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.ct-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 0 14px;
}

/* Colonne avatar + ligne verticale */
.ct-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ct-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}
.ct-item--own .ct-avatar {
  border-color: rgba(142, 45, 226, 0.55);
}
.ct-line {
  flex: 1;
  width: 2px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0;
  border-radius: 1px;
  min-height: 16px;
}

/* Contenu */
.ct-content {
  padding-bottom: 1.5rem;
  min-width: 0;
}
.ct-item--last .ct-content {
  padding-bottom: 0;
}

/* Méta */
.ct-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.35rem;
  padding-top: 6px;
}
.ct-author {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.ct-you {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a78bfa;
  background: rgba(142, 45, 226, 0.15);
  padding: 1px 7px;
  border-radius: 999px;
}
.ct-time {
  font-size: 0.78rem;
  color: #6b7280;
}
.ct-edited {
  font-size: 0.74rem;
  color: #4b5563;
  font-style: italic;
}

/* Actions — masquées, révélées au hover */
.ct-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}
.ct-item:hover .ct-actions,
.ct-item:focus-within .ct-actions {
  opacity: 1;
}

.ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  padding: 0;
}
.ct-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}
.ct-btn--del:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}

/* Texte */
.ct-text {
  margin: 0;
  line-height: 1.65;
  color: #d1d5db;
  font-size: 0.93rem;
  word-break: break-word;
}

/* Édition inline */
.ct-edit-form {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ct-edit-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.93rem;
  resize: vertical;
  min-height: 70px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.ct-edit-form textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 82, 186, 0.18);
}
.ct-edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.ct-cancel {
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  transition:
    background 0.15s,
    color 0.15s;
}
.ct-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.ct-submit {
  padding: 0.4rem 1rem;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: var(--c-primary);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.ct-submit:hover {
  background: var(--c-primary-dark);
}

/* Formulaire d'ajout */
.comment-form {
  margin-top: 0.25rem;
}
.comment-form__inner {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.comment-form__inner:focus-within {
  border-color: rgba(142, 45, 226, 0.5);
  box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.12);
}
.comment-form__inner textarea {
  width: 100%;
  padding: 1rem 1.1rem;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  min-height: 80px;
  outline: none;
}
.comment-form__inner textarea::placeholder {
  color: #4b5563;
}
.comment-form__submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
  margin: 0 0.75rem 0.75rem;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(120deg, #8e2de2, #4a00e0);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.comment-form__submit:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

/* ── Responsive mobile ── */
@media (max-width: 600px) {
  .ct-item {
    grid-template-columns: 32px 1fr;
    gap: 0 10px;
  }
  .ct-avatar {
    width: 32px;
    height: 32px;
  }
  .ct-actions {
    opacity: 1;
  }
  .ct-btn {
    width: 32px;
    height: 32px;
  }
  .comment-form__submit {
    width: calc(100% - 1.5rem);
    justify-content: center;
  }
  .comments-empty-box__form button {
    width: calc(100% - 1.5rem);
    justify-content: center;
  }
}

/* =========================================================
   Admin layout
   ========================================================= */
body.admin {
  background: var(--c-bg-light);
}
.admin-main {
  padding-top: 2rem;
  padding-right: 2rem;
  padding-bottom: 2rem;
  /* padding-left géré par .layout-main (76px sidebar, 260px hover) */
}
.admin-main > section {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.admin-main > section header,
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.admin-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ========= Filtres admin ========= */
.admin-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fafbfd;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.admin-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.admin-filters__row--search input {
  flex: 1 1 100%;
  padding: 8px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fff;
}
.admin-filters__row--search input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(79, 82, 186, 0.15);
}
.admin-filters select {
  flex: 1 1 140px;
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fff;
  cursor: pointer;
}
.admin-filters select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(79, 82, 186, 0.15);
}
.admin-filters button,
.admin-filters .btn-secondary {
  padding: 7px 14px;
  font-size: 0.88rem;
}
.admin-filters__count {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--c-text-muted);
}
.admin-filters__count strong {
  color: var(--c-text);
}

/* Badge "mise en avant" dans le tableau */
.badge-featured {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff;
  border-radius: 10px;
  white-space: nowrap;
}

/* ========= Page Mise en avant ========= */
.featured-page__intro {
  margin: 0 0 1.5rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  max-width: 700px;
}
.featured-page__intro em {
  color: var(--c-primary);
  font-style: normal;
  font-weight: 500;
}
.featured-page__hint {
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  color: #78350f;
}

.featured-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 0 0 1.5rem;
}
.featured-slot {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.featured-slot:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.featured-slot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.featured-slot__pos {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  padding: 4px 10px;
  background: #f0f4ff;
  border-radius: 12px;
}
.featured-slot__preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: #f3f4f6;
}
.featured-slot__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.featured-slot__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  background: repeating-linear-gradient(
    45deg,
    #f3f4f6,
    #f3f4f6 6px,
    #e5e7eb 6px,
    #e5e7eb 12px
  );
}
.featured-slot__placeholder--empty {
  background: repeating-linear-gradient(
    45deg,
    #f9fafb,
    #f9fafb 6px,
    #f3f4f6 6px,
    #f3f4f6 12px
  );
  font-style: italic;
}
.featured-slot__select {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fff;
  cursor: pointer;
}
.featured-slot__select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(79, 82, 186, 0.15);
}
.featured-slot__info {
  margin: 0;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.featured-slot__info strong {
  color: var(--c-text);
  font-size: 0.95rem;
}
.featured-slot__info small {
  color: var(--c-text-muted);
}
.featured-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.admin-main h1 {
  color: var(--c-text);
  font-size: 1.7rem;
  margin: 0;
}
.admin-main .empty {
  text-align: center;
  color: var(--c-text-muted);
  padding: 3rem;
  font-style: italic;
}
.admin-main .back-link {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 500;
}
.admin-main .back-link:hover {
  text-decoration: underline;
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #f9fafb;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  text-align: center;
  text-decoration: none;
  color: var(--c-text);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: block;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--c-primary);
  font-weight: 700;
}
.stat-card span {
  color: var(--c-text-muted);
  font-size: 0.9rem;
}
.stat-card.alert {
  background: var(--c-warn-bg);
  border-color: var(--c-warn);
}
.stat-card.alert strong {
  color: var(--c-warn);
}
.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}

/* Tables admin */
/* Wrapper scrollable : la table garde sa largeur, on scroll horizontalement
   plutôt que de tasser les colonnes. role/aria/tabindex pour l'a11y clavier. */
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
  border-radius: var(--r-md);
}
.admin-table-wrap:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.admin-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.admin-table thead {
  background: #f9fafb;
}
.admin-table th,
.admin-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.admin-table th {
  font-weight: 600;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table td.actions {
  vertical-align: middle;
}
.admin-table .actions-inner {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.admin-table .actions-inner form {
  display: contents;
}
/* Colonnes à largeur fixe : pas de wrap parasite */
.admin-table td[data-label="Type"],
.admin-table td[data-label="Visibilité"],
.admin-table td[data-label="Date"],
.admin-table td[data-label="Statut"],
.admin-table td[data-label="Rôle"],
.admin-table td[data-label="Inscrit le"] {
  white-space: nowrap;
}
.admin-table tr:hover {
  background: #fafbfd;
}

/* ═════════ Responsive admin (tablette + mobile) ═════════ */
@media (max-width: 768px) {
  /* Header : titre au-dessus, actions en bas, en pleine largeur */
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .admin-header__actions {
    display: flex;
    gap: 0.5rem;
  }
  .admin-header__actions .btn-primary,
  .admin-header__actions .btn-secondary {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
  }

  /* Filtres : tout passe en 1 colonne, plus de min-width qui casse le wrap */
  .admin-filters {
    padding: 0.6rem 0.75rem;
  }
  .admin-filters__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .admin-filters__row--search {
    flex-direction: row; /* la search reste seule sur sa ligne */
  }
  .admin-filters select {
    flex: none;
    width: 100%;
  }
  .admin-filters button,
  .admin-filters .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* Indicateur de scroll horizontal sur la table */
@media (max-width: 900px) {
  .admin-table-wrap {
    /* Ombrage progressif pour suggérer qu'il y a du contenu à droite */
    background:
      linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)),
      linear-gradient(to right, rgba(255, 255, 255, 0), #fff 70%) 100% 0,
      radial-gradient(
        farthest-side at 0 50%,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0)
      ),
      radial-gradient(
          farthest-side at 100% 50%,
          rgba(0, 0, 0, 0.15),
          rgba(0, 0, 0, 0)
        )
        100% 0;
    background-repeat: no-repeat;
    background-size:
      40px 100%,
      40px 100%,
      14px 100%,
      14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

.badge-vis,
.badge-ok,
.badge-warn {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-vis.vis-portfolio_public {
  background: var(--c-success-bg);
  color: var(--c-success);
}
.badge-vis.vis-portfolio_academique {
  background: #ddd6fe;
  color: #6b21a8;
}
.badge-vis.vis-prive {
  background: var(--c-error-bg);
  color: var(--c-error);
}
.badge-ok {
  background: var(--c-success-bg);
  color: var(--c-success);
}
.badge-warn {
  background: var(--c-warn-bg);
  color: var(--c-warn);
}

/* Form admin (ajout/édition trace) */
.admin-form form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.admin-form .req {
  color: var(--c-error);
}
.admin-form select.multi {
  min-height: 240px;
  padding: 0.5rem !important;
}
.admin-form select.multi option {
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}
.admin-form .check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-weight: normal !important;
  cursor: pointer;
}
.admin-form .check input {
  width: auto;
  margin: 0;
}
.admin-form .hint {
  color: var(--c-text-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

/* Grid 2 colonnes du form trace */
.admin-form .form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-form .form-col-main,
.admin-form .form-col-side {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (max-width: 900px) {
  .admin-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Fieldsets (médias, AC) */
.media-fieldset,
.ac-fieldset {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin: 1rem 0;
  background: #fafbfd;
}
.media-fieldset > legend,
.ac-fieldset > legend,
.competence-fieldset > legend {
  font-weight: 700;
  color: var(--c-primary);
  padding: 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Liens externes — liste dynamique (sidebar du form admin) */
.liens-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0.4rem 0 0.5rem;
}
.lien-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 6px;
  align-items: center;
}
.lien-row input {
  margin: 0;
  padding: 6px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fff;
}
.lien-row input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(79, 82, 186, 0.15);
}
.lien-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--c-border);
  background: #fff;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--c-text-muted);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.lien-remove:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}
.lien-add {
  align-self: flex-start;
  margin: 4px 0 1rem;
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.lien-add:hover {
  background: #f0f4ff;
  border-color: var(--c-primary);
  border-style: solid;
}

/* Sélecteur multi-compétences (sidebar du form admin) */
.competence-fieldset {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem 1rem;
  margin: 0.5rem 0 1rem;
  background: #fafbfd;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.competence-fieldset > legend {
  font-size: 0.85rem;
}
.competence-fieldset .check {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 4px 12px;
  background: #f0f4ff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  font-size: 0.85rem;
  color: var(--c-text);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  user-select: none;
}
.competence-fieldset .check:hover {
  border-color: var(--c-primary);
  background: #e8edff;
}
.competence-fieldset .check input[type="checkbox"] {
  /* Checkbox masquée visuellement, mais le label entier reste cliquable et focusable */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.competence-fieldset .check:has(input:checked) {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}
.competence-fieldset .check:has(input:focus-visible) {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Galerie médias existants */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 1rem 0;
}
.media-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #000;
  border: 2px solid var(--c-border);
  transition:
    border-color 0.2s,
    transform 0.15s;
  /* Drag & drop : curseur "grab" + désactivation de la sélection texte qui parasite le drag */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.media-thumb:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.media-thumb.dragging {
  cursor: grabbing;
  opacity: 0.5;
}
.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Empêche le drag natif de l'image/vidéo qui vole l'événement au parent.
     Combiné avec l'attribut HTML draggable="false", garantit que le drag part
     toujours du parent .media-thumb (et fonctionne donc sur toutes les images). */
  -webkit-user-drag: none;
  pointer-events: none;
}
.media-thumb .media-type {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.media-thumb .media-order {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
/* Bouton corbeille : positionné en haut-droite de la vignette.
   - Surface 28×28 et fond rouge pour être bien visible
   - Apparaît au survol de la thumb pour ne pas polluer le visuel
   - z-index au-dessus de l'image (qui a pointer-events: none) pour rester cliquable */
.media-thumb .media-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s, transform 0.15s, background 0.15s;
}
.media-thumb:hover .media-delete-btn,
.media-thumb:focus-within .media-delete-btn {
  opacity: 1;
}
.media-thumb .media-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
  color: #fff;
}
.media-thumb .media-delete-btn:focus-visible {
  opacity: 1;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* === Tags picker (checkboxes en pills) === */
.tags-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.tags-group {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.5rem 0.75rem;
  background: #fff;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tags-group legend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.5rem;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #f0f4ff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  font-size: 0.85rem;
  color: var(--c-text);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  user-select: none;
}
.tag-pill:hover {
  border-color: var(--c-primary);
  background: #e8edff;
}
.tag-pill input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--c-primary);
}
.tag-pill input[type="checkbox"]:checked + span {
  color: var(--c-primary);
  font-weight: 600;
}
.tag-pill:has(input:checked) {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.tag-pill:has(input:checked) span {
  color: #fff !important;
  font-weight: 600;
}
.tags-group-pole .tag-pill:has(input:checked) {
  background: #311b92;
  border-color: #311b92;
}
.tags-group-outil .tag-pill:has(input:checked) {
  background: #2a2a2a;
  border-color: #2a2a2a;
}
.new-tag-block {
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  background: #fafbfd;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-sm);
}
.new-tag-block summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--c-primary);
  font-size: 0.9rem;
}
.new-tag-form {
  display: flex;
  gap: 6px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.new-tag-form input[type="text"] {
  flex: 2;
  min-width: 140px;
}
.new-tag-form select {
  flex: 1;
  min-width: 110px;
}
.new-tag-form button {
  padding: 0.55rem 1rem !important;
  font-size: 0.9rem !important;
  margin: 0 !important;
}

/* Drag & drop zone */
.dropzone {
  display: block;
  border: 2px dashed #c4b5fd;
  border-radius: var(--r-md);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  margin: 1rem 0;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--c-primary);
  background: #f0f4ff;
  transform: scale(1.005);
}
.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}
.dropzone-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.dropzone strong {
  font-size: 1.05rem;
  color: var(--c-text);
}
.dropzone span {
  color: var(--c-text-muted);
  font-size: 0.95rem;
}
.dropzone small {
  color: var(--c-text-muted);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

/* Preview des fichiers sélectionnés */
.upload-preview {
  margin: 1rem 0;
  padding: 1rem;
  background: #fff;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}
.preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.preview-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: #fafbfd;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
}
.preview-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
}
.preview-video {
  background: #311b92;
}
.preview-name {
  flex: 1;
  font-weight: 500;
  word-break: break-all;
}
.preview-size {
  color: var(--c-text-muted);
  font-size: 0.85rem;
}

.miniature-label {
  margin-top: 1.5rem;
  font-weight: 600;
}
.miniature-current {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #fafbfd;
  border-radius: var(--r-sm);
}

/* Actions du form */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}
.form-actions .btn-primary,
.form-actions .btn-secondary {
  padding: 0.75rem 1.5rem;
}
.ac-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.ac-groups fieldset {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  background: #fafbfd;
}
.ac-groups legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-primary);
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ac-groups .check {
  font-size: 0.85rem;
}

/* Création utilisateur (collapsible) */
.admin-create {
  margin-bottom: 1.5rem;
  background: #fafbfd;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.5rem 1rem;
}
.admin-create summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--c-primary);
  padding: 0.5rem 0;
}
.admin-create form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-create form label,
.admin-main form label {
  display: block;
  font-weight: 500;
  margin: 0.6rem 0 0.25rem;
  color: var(--c-text);
  font-size: 0.95rem;
}
.admin-create form input,
.admin-create form select,
.admin-main form input,
.admin-main form select,
.admin-main form textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  background: #fff;
  box-sizing: border-box;
  color: var(--c-text);
  font-family: inherit;
  display: block;
}
.admin-create form input:focus,
.admin-create form select:focus,
.admin-main form input:focus,
.admin-main form select:focus,
.admin-main form textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79, 82, 186, 0.1);
}
.admin-create form button[type="submit"],
.admin-main form button[type="submit"] {
  background: var(--c-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 1rem;
  width: auto;
  align-self: flex-start;
}
.admin-create form button[type="submit"]:hover,
.admin-main form button[type="submit"]:hover {
  background: var(--c-primary-dark);
}

/* Inline form (édition utilisateur en place) */
.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: #f0f4ff;
  border-radius: var(--r-sm);
}
.inline-form input,
.inline-form select {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  width: auto;
  margin: 0;
}

/* =========================================================
   Pages d'erreur (404, 500) — version modernisée
   ========================================================= */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--c-text);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Orbes décoratifs */
.error-page::before,
.error-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.error-page::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(
    circle,
    rgba(142, 45, 226, 0.13) 0%,
    transparent 70%
  );
  top: -120px;
  right: -120px;
  animation: ep-orb 9s ease-in-out infinite alternate;
}
.error-page::after {
  width: 360px;
  height: 360px;
  background: radial-gradient(
    circle,
    rgba(74, 0, 224, 0.1) 0%,
    transparent 70%
  );
  bottom: -100px;
  left: -100px;
  animation: ep-orb 12s ease-in-out infinite alternate-reverse;
}

.error-page > * {
  position: relative;
  z-index: 1;
}

.error-page__code {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(
    135deg,
    var(--c-accent) 0%,
    var(--c-accent-2) 55%,
    var(--c-primary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 0.4rem;
  animation: ep-reveal 0.65s cubic-bezier(0.32, 0.72, 0.24, 1) both;
}

.error-page__title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 0.75rem;
  animation: ep-up 0.55s 0.12s ease both;
}

.error-page__desc {
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 400px;
  margin: 0 0 2.25rem;
  animation: ep-up 0.55s 0.22s ease both;
}

.error-page__actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: ep-up 0.55s 0.32s ease both;
}

.error-page__btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: #fff;
  padding: 0.8rem 1.75rem;
  border-radius: 32px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.2s;
  box-shadow: 0 4px 20px rgba(142, 45, 226, 0.3);
}
.error-page__btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}
.error-page__btn-primary .material-symbols-outlined {
  font-size: 1.1rem;
}

.error-page__btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--c-text-muted);
  padding: 0.8rem 1.75rem;
  border-radius: 32px;
  font-weight: 500;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.error-page__btn-secondary:hover {
  color: var(--c-text);
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.error-page__btn-secondary .material-symbols-outlined {
  font-size: 1.1rem;
}

/* Animations */
@keyframes ep-orb {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(24px, 18px) scale(1.07);
  }
}
@keyframes ep-reveal {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes ep-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-page__code,
  .error-page__title,
  .error-page__desc,
  .error-page__actions {
    animation: none;
  }
  .error-page::before,
  .error-page::after {
    animation: none;
  }
}

/* =========================================================
   Container générique (utilisé par /projets, /admin, etc.)
   ========================================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* =========================================================
   CARTES PROJET (.trace-card) — partagées entre home et /projets.
   Ces règles sont aussi en double dans les CSS spécifiques par page,
   mais on les met ici pour être sûr qu'elles s'appliquent toujours.
   ========================================================= */
.cards-grid,
.traces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
  margin: 0 auto 40px;
}

.trace-card {
  background: #1a1a1a;
  border: 1px solid #232323;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.3s,
    box-shadow 0.3s,
    border-color 0.3s;
  height: 100%;
}
.trace-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 32px rgba(0, 0, 0, 0.6);
  border-color: #4f52ba;
}

.trace-card .card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #0c0c0c;
}
.trace-card .card-image img,
.trace-card .card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.trace-card:hover .card-image img,
.trace-card:hover .card-image video {
  transform: scale(1.05);
}

.trace-card .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #4f52ba;
  color: #fff;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.trace-card .card-body {
  padding: 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trace-card .card-body h3 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.trace-card .card-body .dot {
  color: #8e2de2;
}
.trace-card .card-body .excerpt,
.trace-card .card-body p {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  flex-grow: 1;
}

/* =========================================================
   MINI-TAGS (sur les cartes) — TOUJOURS chargés
   ========================================================= */
.card-tags {
  display: flex !important;
  /* nowrap + overflow:hidden : la ligne de tags reste sur une seule ligne.
     Les noms longs sont tronqués avec ellipsis, les tags qui ne rentrent pas
     sont masqués par overflow. Le pill "+N" reste toujours visible. */
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 8px;
  overflow: hidden;
  align-items: center;
}
.mini-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 4px 9px;
  border-radius: 6px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.4;
  /* Pas de troncature : le nom du tag est toujours affiché en entier.
     Le JS (fitTagsToOneLine) masque entièrement les tags qui ne rentrent pas. */
  flex-shrink: 0;
}
.mini-tag.pole {
  background: #311b92;
  border: 1px solid #4f52ba;
  color: #ddd;
}
.mini-tag.competence {
  background: #4f52ba;
  color: #fff;
}
.mini-tag.outil {
  background: #2a2a2a;
  color: #ddd;
  border: 1px solid #3a3a3a;
}
.mini-tag.more {
  background: transparent;
  color: #888;
  border: 1px solid #333;
  /* Le "+N" reste toujours intact, jamais tronqué */
  flex-shrink: 0;
}

/* =========================================================
   TAG BADGES (sur la page détail trace) — fond sombre
   ========================================================= */
.trace-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}
.tag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    filter 0.2s,
    transform 0.15s;
  text-decoration: none;
  background: #512da8;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tag-badge.tag-type-pole {
  background: #311b92;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid #673ab7;
}
.tag-badge.tag-type-outil {
  background: #2a2a2a;
  color: #ccc;
  border: 1px solid #444;
}
.tag-badge.tag-type-competence {
  background: #4f52ba;
}
.tag-badge:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

/* =========================================================
   PAGE DÉTAIL TRACE — top nav, hero, galerie, infos
   (Doublon avec style_trace.css pour fiabilité — chargé partout
    mais ne s'applique qu'aux pages qui ont ces classes)
   ========================================================= */
.trace-detail.container,
.container.trace-detail {
  max-width: 1100px;
  margin: 30px auto;
  padding: 32px;
  background: #111;
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
  color: #e5e5e5;
}

.trace-detail .top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -32px -32px 30px -32px;
  padding: 15px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(17, 17, 17, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.trace-detail .top-nav .back-link {
  color: #aaa;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.trace-detail .top-nav .back-link:hover {
  color: #fff;
}
.trace-detail .nav-arrows {
  display: flex;
  gap: 10px;
}
.trace-detail .nav-btn {
  background: #1a1a1a;
  padding: 8px 16px;
  border-radius: 30px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid #333;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.trace-detail .nav-btn:hover:not(.disabled) {
  background: #4f52ba;
  border-color: #4f52ba;
}
.trace-detail .nav-btn.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.trace-detail .trace-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 40px;
}
.trace-detail .hero-media-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid #2a2a2a;
  position: relative;
}
.trace-detail .hero-media-container img,
.trace-detail .hero-media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.trace-detail .hero-media-container.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
}
.trace-detail .hero-content h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 15px 0;
  color: #fff;
  font-weight: 700;
}
.trace-detail .trace-type {
  font-size: 1rem;
  color: #4f52ba;
  font-weight: 700;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-block;
}
.trace-detail .hero-content time {
  font-size: 0.95rem;
  color: #888;
  display: block;
  margin-top: 10px;
}

.trace-detail .gallery-slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  gap: 10px;
}
.trace-detail .gallery-slider {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 10px 2px;
  width: 100%;
  scroll-snap-type: x mandatory;
}
.trace-detail .gallery-slider::-webkit-scrollbar {
  display: none;
}
.trace-detail .slider-item,
.trace-detail .simple-item {
  flex: 0 0 280px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid #333;
  transition:
    transform 0.2s,
    border-color 0.2s;
  background: #000;
  scroll-snap-align: center;
}
.trace-detail .simple-item {
  flex: 1;
}
.trace-detail .slider-item:hover,
.trace-detail .simple-item:hover {
  transform: scale(1.02);
  border-color: #4f52ba;
}
.trace-detail .slider-item img,
.trace-detail .slider-item video,
.trace-detail .simple-item img,
.trace-detail .simple-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trace-detail .slider-nav {
  background: rgba(20, 20, 20, 0.8);
  color: #fff;
  border: 1px solid #444;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trace-detail .slider-nav:hover {
  background: #4f52ba;
  border-color: #4f52ba;
}
.trace-detail .gallery-simple {
  display: flex;
  gap: 15px;
  width: 100%;
  margin-bottom: 40px;
  flex-wrap: nowrap;
}
.trace-detail .video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.trace-detail .trace-argumentaire h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 20px 0;
  color: #fff;
}
.trace-detail .trace-argumentaire p {
  max-width: 85ch;
  line-height: 1.8;
  font-size: 1.05rem;
  color: #d1d5db;
  margin-bottom: 40px;
}

.trace-detail .trace-infos {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 30px 0;
}
.trace-detail .info-box {
  background: rgba(21, 21, 21, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 15px 20px;
  flex: 1 1 calc(50% - 15px);
  min-width: 200px;
  color: #e5e5e5;
}
.trace-detail .info-box.full {
  flex: 1 1 100%;
}
.trace-detail .info-box.cta {
  background: transparent;
  border: none;
  padding: 0;
  text-align: center;
}
.trace-detail .info-box strong {
  display: block;
  color: #7c4dff;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.trace-detail .info-box-value {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
}
.trace-detail .ac-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}
.trace-detail .ac-badge {
  background: rgba(124, 77, 255, 0.15);
  color: #b388ff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid rgba(124, 77, 255, 0.3);
  font-family: "Courier New", monospace;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trace-detail .ac-badge small {
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  color: #d1c4e9;
  font-size: 0.8rem;
}
.trace-detail .portfolio-btn {
  background: #4f52ba;
  color: #fff;
  padding: 14px 28px;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition:
    background 0.2s,
    transform 0.1s;
  width: 100%;
}
.trace-detail .portfolio-btn:hover {
  background: #3b41a1;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .trace-detail.container,
  .container.trace-detail {
    margin: 20px;
    padding: 20px;
  }
  .trace-detail .top-nav {
    margin: -20px -20px 20px -20px;
    padding: 10px 15px;
  }
  .trace-detail .trace-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .trace-detail .hero-content h1 {
    font-size: 1.8rem;
  }
  .trace-detail .slider-nav {
    display: none;
  }
  .trace-detail .gallery-simple {
    flex-wrap: wrap;
  }
  .trace-detail .simple-item {
    flex: 1 1 100%;
    margin-bottom: 10px;
  }
  .trace-detail .info-box {
    flex: 1 1 100%;
  }
}

/* =========================================================
   Filtres /projets
   ========================================================= */
.filter-header {
  margin-bottom: 1rem;
}
.toggle-filter-btn {
  background: var(--c-primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}
.filter-form.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
}
.filter-form select,
.filter-form input {
  padding: 0.6rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--c-text);
  font-size: 0.95rem;
  flex: 1 1 160px;
}
.filter-form button[type="submit"] {
  background: var(--c-primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 600;
}
.filter-form .btn-reset {
  padding: 0.6rem 1.4rem;
}

/* =========================================================
   Footer du site
   ========================================================= */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #888;
  font-size: 0.9rem;
  background: var(--c-bg-dark);
  border-top: 1px solid var(--c-border-dark);
  margin-top: 2rem;
}
.site-footer a {
  color: #ccc;
  text-decoration: none;
  margin: 0 0.5rem;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* =========================================================
   Responsive
   ========================================================= */

/* ── Tablette (sidebar cachée, tables larges) ── */
@media (max-width: 1100px) and (min-width: 769px) {
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .admin-table th,
  .admin-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .auth-box {
    padding: 1.5rem;
  }
  .messagerie {
    padding: 0.75rem 1rem;
  }
  .message-wrapper {
    max-width: 92%;
  }

  /* Sidebar disparaît → recalibrage padding admin */
  .admin-main {
    padding-top: 72px; /* topbar 56px + marge */
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
  }
  .admin-main > section {
    padding: 1rem;
  }
  .filter-form {
    flex-direction: column;
  }
  .filter-form select,
  .filter-form input {
    flex: 1 1 100%;
  }

  /* ── Card layout : chaque ligne devient une carte ── */
  .admin-table {
    display: block;
    overflow-x: unset;
    white-space: normal;
  }
  .admin-table thead {
    display: none;
  }
  .admin-table tbody,
  .admin-table tr {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  .admin-table tr:hover {
    background: #fafbfd;
  }
  .admin-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    border: none;
    font-size: 0.875rem;
    gap: 0.5rem;
  }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-muted);
    flex-shrink: 0;
    min-width: 80px;
  }
  .admin-table td.actions {
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--c-border);
  }
  .admin-table .actions-inner {
    justify-content: flex-end;
    gap: 0.5rem;
  }

  /* Admin header : bouton pleine largeur sous le titre */
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .admin-header .btn-primary {
    width: 100%;
    text-align: center;
  }
}
