/* DA des pages login / dashboard : fond toile 3D (assets/js/fx.js), cartes en verre,
   écran de chargement. Chargé après modern.css ; préfixe body.app-shell pour primer
   sur les styles inline des pages. */

body.app-shell {
  --fx-indigo: #818cf8;
  --fx-violet: #a78bfa;
  --fx-cyan: #22d3ee;
  --fx-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
  --fx-surface: linear-gradient(180deg, rgba(20, 24, 62, 0.9), rgba(9, 11, 32, 0.94));
  --fx-line: rgba(255, 255, 255, 0.07);
  --fx-ease: cubic-bezier(0.16, 1, 0.3, 1);
  background: #05061a;
  color: #e6e9ff;
  position: relative;
  overflow-x: hidden;
}
body.app-shell::before { /* lueurs colorées lentes derrière la toile */
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 25%, rgba(99, 102, 241, 0.28), transparent 70%),
    radial-gradient(35% 30% at 80% 70%, rgba(34, 211, 238, 0.16), transparent 70%),
    radial-gradient(30% 30% at 60% 15%, rgba(139, 92, 246, 0.18), transparent 70%);
  will-change: transform;
  animation: fx-aurora 22s ease-in-out infinite alternate;
}
@keyframes fx-aurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(3%, -2%, 0) rotate(8deg); }
}

#bg-web {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* Toile active : fond, lueurs et bords sont dessinés dans le canvas (un seul calque) */
body.app-shell.fx-canvas-on::before,
body.app-shell.fx-canvas-on .bg-vignette { display: none; }
.bg-vignette { /* assombrit les bords et le haut pour garder le texte lisible */
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 60%, transparent 40%, rgba(3, 4, 16, 0.85) 100%),
    linear-gradient(180deg, rgba(5, 6, 26, 0.75) 0%, transparent 35%);
}
body.app-shell #main,
body.app-shell .back-to-top { position: relative; z-index: 1; }

/* ----------------------------- en-tête ----------------------------- */
/* En-tête sans fond, aligné sur le contenu (.app-container). Largeur : --app-max (aucune limite sur
   le dashboard, 1440px sur le login), marges latérales : --app-gutter. */
body.app-shell {
  --app-gutter: clamp(16px, 2.5vw, 48px);
  --app-max: none;
}
body.app-shell.page-login { --app-max: 1440px; }
body.app-shell #header,
body.app-shell #header.header-scrolled,
body.app-shell #header.header-solid {
  height: auto;
  top: 14px;
  padding: 0 var(--app-gutter);
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: none;
}
body.app-shell #header > .container {
  max-width: var(--app-max);
  height: 64px;
  padding: 0;
}
body.app-shell #navbar a { cursor: pointer; }

/* Conteneur commun : même largeur que la barre d'en-tête */
.app-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--app-gutter);
}
body.app-shell.page-login .app-container { max-width: calc(var(--app-max) + 2 * var(--app-gutter)); }
@media (max-width: 767px) {
  body.app-shell #header { top: 10px; }
  body.app-shell #header > .container { height: 58px; padding: 0 10px 0 16px; }
}

/* ----------------------------- cartes ----------------------------- */
body.app-shell .fx-card {
  position: relative;
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  isolation: isolate;
}
body.app-shell .fx-card::before { /* liseré dégradé */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.55), rgba(255, 255, 255, 0.03) 38%, rgba(255, 255, 255, 0.03) 62%, rgba(34, 211, 238, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}
body.app-shell .fx-spot::after { /* reflet qui suit la souris */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(480px circle at var(--mx, -999px) var(--my, -999px), rgba(139, 92, 246, 0.13), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}
body.app-shell .fx-spot:hover::after { opacity: 1; }

.fx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
}
.fx-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: fx-ping 2s infinite;
}
@keyframes fx-ping {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  80%, 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
}
.fx-grad-text {
  background: var(--fx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Boutons principaux */
body.app-shell .fx-btn,
body.app-shell .form-card .btn-primary,
body.app-shell .add-btn,
body.app-shell .settings-trigger,
body.app-shell .settings-primary {
  position: relative;
  overflow: hidden;
  background: var(--fx-grad);
  background-size: 160% 160%;
  border: 0;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 34px -12px rgba(99, 102, 241, 0.9), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transition: transform 0.25s var(--fx-ease), box-shadow 0.25s var(--fx-ease), background-position 0.6s var(--fx-ease);
}
body.app-shell .fx-btn:hover,
body.app-shell .form-card .btn-primary:hover,
body.app-shell .add-btn:hover,
body.app-shell .settings-trigger:hover,
body.app-shell .settings-primary:hover {
  transform: translateY(-2px);
  background: var(--fx-grad);
  background-size: 160% 160%;
  background-position: 100% 50%;
  box-shadow: 0 18px 40px -12px rgba(139, 92, 246, 0.95), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  color: #fff;
}
body.app-shell .fx-btn::after,
body.app-shell .form-card .btn-primary::after,
body.app-shell .add-btn::after { /* éclat qui traverse le bouton au survol */
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s var(--fx-ease);
}
body.app-shell .fx-btn:hover::after,
body.app-shell .form-card .btn-primary:hover::after,
body.app-shell .add-btn:hover::after { left: 130%; }

/* Champs */
body.app-shell .form-card .form-control,
body.app-shell .add-url-form .form-control,
body.app-shell .settings-field input,
body.app-shell .settings-field select,
body.app-shell .search-input {
  background: rgba(4, 6, 22, 0.55);
  border: 1px solid rgba(148, 163, 255, 0.18);
  color: #f3f5ff;
}
body.app-shell .form-card .form-control:focus,
body.app-shell .add-url-form .form-control:focus,
body.app-shell .settings-field input:focus,
body.app-shell .settings-field select:focus,
body.app-shell .search-input:focus {
  background: rgba(4, 6, 22, 0.8);
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
  color: #fff;
}

/* ------------------------- apparition en cascade ------------------------- */
body.app-shell .fx-reveal {
  opacity: 0;
  transform: translateY(18px);
}
body.app-shell.is-ready .fx-reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--fx-ease), transform 0.8s var(--fx-ease);
  transition-delay: calc(var(--d, 0) * 110ms);
}

/* ============================== LOGIN ============================== */
body.app-shell.page-login main { min-height: 100vh; }
.login-copy h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.7rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 22px 0 18px;
}
.login-copy .lead-copy {
  font-size: 1.08rem;
  color: rgba(214, 220, 255, 0.72);
  max-width: 520px;
}
.login-features {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  gap: 12px;
  max-width: 460px;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--fx-line);
  color: rgba(226, 232, 255, 0.85);
  font-size: 0.95rem;
  text-align: left;
}
.login-features i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(34, 211, 238, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
body.app-shell .login-card {
  padding: 40px 36px 32px;
}
body.app-shell .login-card .card-gem {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(34, 211, 238, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.1);
}
body.app-shell .login-card .card-gem svg { width: 26px; height: 26px; }
body.app-shell .login-card h2 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.input-icon {
  position: relative;
}
.input-icon > i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(199, 210, 254, 0.5);
  pointer-events: none;
  transition: color 0.2s ease;
}
body.app-shell .input-icon .form-control { padding-left: 44px; }
body.app-shell .input-icon.has-toggle .form-control { padding-right: 48px; }
.input-icon:focus-within > i { color: var(--fx-violet); }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(199, 210, 254, 0.6);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.pw-toggle:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
body.app-shell .login-card .btn-primary {
  padding: 0.95rem;
  border-radius: 14px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
body.app-shell .login-card .btn-primary .bi { transition: transform 0.25s var(--fx-ease); }
body.app-shell .login-card .btn-primary:hover .bi { transform: translateX(4px); }
.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: fx-spin 0.7s linear infinite;
}
body.app-shell .login-card #message { margin-top: 16px; border-radius: 12px; font-size: 0.9rem; }
body.app-shell .login-card #message.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
  animation: fx-shake 0.4s ease;
}
@keyframes fx-shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
body.app-shell .login-card .support-hint {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--fx-line);
  font-size: 0.88rem;
  color: rgba(199, 210, 254, 0.6);
  text-align: center;
}

/* ============================ DASHBOARD ============================ */
body.app-shell.page-dashboard #main {
  margin-top: 0;
  padding: 112px 0 72px;
}
body.app-shell .app-main section { padding: 0; } /* style.css met 60px sur chaque section */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-head-copy h1 {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 14px 0 8px;
}
.page-head-copy p {
  margin: 0;
  max-width: 560px;
  color: rgba(214, 220, 255, 0.7);
  font-size: 1rem;
}
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px 0 6px;
  border-radius: 14px;
  background: rgba(10, 12, 36, 0.88);
  border: 1px solid var(--fx-line);
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--fx-grad);
  color: #fff;
}
.user-chip-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(199, 210, 254, 0.6);
}
.user-chip strong { color: #fff; font-size: 0.95rem; }
body.app-shell .settings-trigger {
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
body.app-shell .kpi {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
}
.kpi-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  font-size: 1.2rem;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.kpi-text { display: flex; flex-direction: column; min-width: 0; }
.kpi-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(199, 210, 254, 0.65);
}
.kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 22vw, 420px);
  grid-template-areas: "main side";
  gap: 24px;
  align-items: start;
}
.dash-main { grid-area: main; min-width: 0; }
.dash-side { grid-area: side; position: sticky; top: 104px; }

body.app-shell .dashboard-card {
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
body.app-shell .dashboard-card h3 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
body.app-shell .images-panel { min-height: 520px; }
body.app-shell .images-panel-header {
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--fx-line);
}
body.app-shell .images-panel-controls { min-width: min(100%, 280px); }
body.app-shell .images-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
  padding-right: 4px;
  overflow: visible;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--fx-grad);
  box-shadow: 0 10px 24px -10px rgba(139, 92, 246, 0.9);
}
body.app-shell .add-url-panel .lead {
  font-size: 0.9rem;
  margin-bottom: 20px;
}
body.app-shell .add-url-form {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #c7d2fe;
  margin-bottom: -4px;
}
body.app-shell .add-url-form .form-control { min-width: 0; width: 100%; }
body.app-shell #autobuySection { gap: 10px; }
body.app-shell .autobuy-price { min-width: 0; }
body.app-shell .add-btn {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  padding: 0;
}
.side-note {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--fx-line);
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(199, 210, 254, 0.55);
}

body.app-shell .image-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--fx-line);
  transition: transform 0.25s var(--fx-ease), box-shadow 0.25s var(--fx-ease), border-color 0.25s var(--fx-ease);
  animation: fx-card-in 0.6s var(--fx-ease) both;
}
body.app-shell .image-item:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 24px 50px -20px rgba(99, 102, 241, 0.7);
}
body.app-shell .image-item img { background: rgba(255, 255, 255, 0.95); }
body.app-shell .image-label {
  background: rgba(8, 10, 30, 0.92);
  color: #e6e9ff;
  border-top: 1px solid var(--fx-line);
}
@keyframes fx-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
}
body.app-shell .autobuy-toggle { background: rgba(4, 6, 22, 0.5); border-color: rgba(148, 163, 255, 0.18); }
body.app-shell .autobuy-toggle input { accent-color: #8b5cf6; }
body.app-shell .settings-card { background: rgba(6, 8, 26, 0.97); }
body.app-shell .settings-sidebar { background: rgba(3, 4, 16, 0.9); }
body.app-shell .settings-nav-item.active { border-left-color: var(--fx-violet); background: rgba(139, 92, 246, 0.12); }
body.app-shell .settings-section { background: rgba(255, 255, 255, 0.025); border-color: var(--fx-line); }
body.app-shell .modal-content { background: rgba(8, 10, 30, 0.96); border-color: var(--fx-line); }

/* Autobuy : prix max par carte */
body.app-shell .autobuy-price { gap: 8px; }
body.app-shell .modal-autobuy {
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--fx-line);
}
.modal-autobuy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-autobuy-title { font-weight: 700; color: #fff; }
.modal-autobuy-title i { color: var(--fx-violet); }
.modal-autobuy-status { font-size: 0.85rem; color: rgba(199, 210, 254, 0.7); }
.modal-autobuy-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.modal-autobuy-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c7d2fe;
}
.modal-autobuy-fields input {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(4, 6, 22, 0.55);
  border: 1px solid rgba(148, 163, 255, 0.18);
  color: #f3f5ff;
}
.modal-autobuy-fields input:focus { outline: none; border-color: rgba(139, 92, 246, 0.7); }

/* Focus clavier visible partout (accessibilité) */
body.app-shell a:focus-visible,
body.app-shell button:focus-visible,
body.app-shell input:focus-visible,
body.app-shell select:focus-visible {
  outline: 2px solid var(--fx-violet);
  outline-offset: 2px;
}

@media (max-width: 1099px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "side" "main";
  }
  .dash-side { position: static; }
}
@media (max-width: 767px) {
  body.app-shell.page-dashboard #main { padding-top: 104px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .user-chip { flex: 1; min-width: 0; }
  .kpi-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  body.app-shell .kpi { padding: 14px 16px; }
  body.app-shell .images-panel-header { flex-direction: column; align-items: stretch; }
  body.app-shell .dashboard-card { padding: 18px; }
}
@media (max-width: 991px) {
  .login-features { margin-left: auto; margin-right: auto; }
}

/* ============================ EN-TÊTE ============================ */
/* Logo à gauche, liens au centre, langue + bouton de connexion à droite. */
body.app-shell #header > .container { gap: 28px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  transition: transform 0.3s var(--fx-ease);
}
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }
.brand-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.brand-name span {
  background: var(--fx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.app-shell #navbar {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
body.app-shell .navbar a,
body.app-shell .navbar a:focus { font-family: 'Inter', sans-serif; }

@media (min-width: 992px) {
  body.app-shell #navbar > ul { flex: 1; gap: 6px; }
  body.app-shell #navbar > ul > li:first-child,
  body.app-shell #navbar > ul > li.language-switcher { margin-left: auto; }
  body.app-shell #navbar a.nav-link-item {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(214, 220, 255, 0.72);
    transition: color 0.2s ease, background 0.2s ease;
  }
  body.app-shell #navbar a.nav-link-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
  }
  body.app-shell #navbar a.nav-link-item.active {
    color: #fff;
    background: rgba(139, 92, 246, 0.16);
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.3);
  }
  body.app-shell #navbar .language-switcher > a {
    gap: 8px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--fx-line);
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(214, 220, 255, 0.8);
    transition: background 0.2s ease, color 0.2s ease;
  }
  body.app-shell #navbar .language-switcher:hover > a { background: rgba(255, 255, 255, 0.06); color: #fff; }
  body.app-shell #navbar .lang-flag { border-radius: 3px; }
  body.app-shell #navbar .dropdown ul {
    left: auto;
    right: 0;
    min-width: 170px;
    padding: 6px;
    border-radius: 12px;
    background: #0b0d26;
    border: 1px solid var(--fx-line);
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9);
  }
  body.app-shell #navbar .dropdown:hover > ul { top: calc(100% + 8px); }
  body.app-shell #navbar .dropdown ul li { min-width: 0; }
  body.app-shell #navbar .dropdown ul a {
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: rgba(214, 220, 255, 0.85);
  }
  body.app-shell #navbar .dropdown ul a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
  body.app-shell #navbar a.nav-cta {
    margin-left: 6px;
    padding: 9px 20px;
    border-radius: 11px;
    background: var(--fx-grad);
    background-size: 160% 160%;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 22px -10px rgba(139, 92, 246, 0.95), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.4s ease;
  }
  body.app-shell #navbar a.nav-cta:hover {
    transform: translateY(-1px);
    background-position: 100% 50%;
    box-shadow: 0 12px 28px -10px rgba(139, 92, 246, 1), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  }
}

/* Menu mobile */
@media (max-width: 991px) {
  body.app-shell .mobile-nav-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 24px;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fx-line);
  }
  body.app-shell .navbar-mobile { background: rgba(3, 4, 16, 0.88); z-index: 999; }
  body.app-shell .navbar-mobile .mobile-nav-toggle { top: 22px; right: 22px; }
  body.app-shell .navbar-mobile ul {
    top: 84px;
    left: 12px;
    right: 12px;
    bottom: auto;
    padding: 8px;
    border-radius: 16px;
    background: #0b0d26;
    border: 1px solid var(--fx-line);
  }
  body.app-shell .navbar-mobile a,
  body.app-shell .navbar-mobile a:focus {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1rem;
    color: rgba(214, 220, 255, 0.85);
  }
  body.app-shell .navbar-mobile a:hover,
  body.app-shell .navbar-mobile .active { color: #fff; background: rgba(139, 92, 246, 0.14); }
  body.app-shell .navbar-mobile a.nav-cta {
    justify-content: center;
    margin-top: 6px;
    background: var(--fx-grad);
    color: #fff;
    font-weight: 600;
  }
  body.app-shell .navbar-mobile .dropdown ul {
    margin: 4px 8px;
    padding: 4px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.app-shell .navbar-mobile .lang-flag { margin-right: 10px; }
}

/* ===================== ACCUEIL ET SERVICES ===================== */
body.app-shell.page-site { --app-max: 1280px; }
body.app-shell #hero,
body.app-shell #footer { position: relative; z-index: 1; }
body.app-shell.page-site #main .container,
body.app-shell.page-site #footer .container,
body.app-shell.page-site .features-grid,
body.app-shell.page-site .stats-grid {
  max-width: calc(var(--app-max) + 2 * var(--app-gutter));
  padding-left: var(--app-gutter);
  padding-right: var(--app-gutter);
}
/* La toile 3D remplace les fonds pleins et l'image du hero */
body.app-shell #hero { background: transparent; }
body.app-shell #hero::after,
body.app-shell .process-section::before { content: none; }
body.app-shell.page-site .process-section,
body.app-shell.page-site .features-section,
body.app-shell.page-site .faq-section,
body.app-shell.page-site .cta-section-wrap { background: transparent; }
body.app-shell .stats-strip {
  background: rgba(5, 6, 22, 0.7);
  border-color: var(--fx-line);
}
body.app-shell #hero h2 .grad-text,
body.app-shell .grad-text {
  background: var(--fx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.app-shell .hero-eyebrow {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(129, 140, 248, 0.28);
}

/* Cartes : même surface que le dashboard */
body.app-shell .d-card,
body.app-shell .feature-card,
body.app-shell .tcg-card,
body.app-shell .faq-item {
  background: var(--fx-surface);
  border: 1px solid var(--fx-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 70px -35px rgba(0, 0, 0, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.app-shell .d-card.hoverable:hover,
body.app-shell .feature-card:hover,
body.app-shell .tcg-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 24px 50px -22px rgba(99, 102, 241, 0.7);
}
body.app-shell .faq-item[open] { border-color: rgba(139, 92, 246, 0.4); }
body.app-shell .cta-card {
  background:
    radial-gradient(600px circle at 85% 0%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(500px circle at 0% 100%, rgba(34, 211, 238, 0.18), transparent 60%),
    linear-gradient(135deg, #15173f, #0a0c26);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Boutons des pages vitrines alignés sur ceux du dashboard */
body.app-shell .btn-d-primary,
body.app-shell #hero .btn-get-started:not(.btn-outline) {
  background: var(--fx-grad);
  background-size: 160% 160%;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 34px -12px rgba(99, 102, 241, 0.9), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
body.app-shell .btn-d-primary:hover,
body.app-shell #hero .btn-get-started:not(.btn-outline):hover { background-position: 100% 50%; }
body.app-shell .btn-d-ghost,
body.app-shell .hero-actions .btn-secondary {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--fx-line);
}

/* Titre de la page services (ancien fil d'Ariane) */
body.app-shell .breadcrumbs {
  padding: 120px 0 8px;
  border-bottom: 0;
}
body.app-shell .breadcrumbs h2 {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Cartes des jeux (services) : l'ancien thème leur met un corps blanc qui chevauche l'image */
body.app-shell .tcg-card .card-body {
  margin-top: 0;
  background: transparent;
  border-top: 0;
  box-shadow: none;
}
body.app-shell.page-site .tcg-grid {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
/* Grilles déjà dans un .container : pas de seconde marge intérieure */
body.app-shell.page-site .container .features-grid {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

body.app-shell #footer {
  background: rgba(4, 5, 18, 0.9);
  border-top: 1px solid var(--fx-line);
}
body.app-shell #footer .footer-links ul li i { color: var(--fx-violet); }

@media (prefers-reduced-motion: reduce) {
  body.app-shell::before,
  .fx-eyebrow .dot { animation: none !important; }
  body.app-shell .fx-reveal { transform: none; }
}

/* Panneau des paramètres et fiche carte : pas de flou d'arrière-plan (recalculé à
   chaque image, il rendait la navigation dans les paramètres lente). */
body.app-shell .settings-backdrop,
body.app-shell .modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.app-shell .settings-backdrop { background: rgba(3, 4, 16, 0.92); }
body.app-shell .modal { background-color: rgba(3, 4, 16, 0.9); }
