/* Barre de chargement (js/loader.js) : barre fine en haut + écran de démarrage. Mouvement = transform uniquement (fluide, sans saccade). */

/* ---------------------------------------------------------------- barre du haut */
.ld-top { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.ld-top.on { opacity: 1; }
.ld-top.done { opacity: 0; transition-delay: .12s; }
/* 11/11 (Maël : « pourquoi 2 barres de chargement ») : pendant l'écran de démarrage, seule sa barre à lui s'affiche */
.boot ~ .ld-top { display: none; }
.ld-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); will-change: transform;
  background: linear-gradient(90deg, #8B5CF6, #5B6CF9 55%, #3B82F6, #8B5CF6); background-size: 200% 100%;
  animation: ldFlow 1.6s linear infinite; box-shadow: 0 0 10px rgba(124, 108, 250, .7); }
.ld-head { position: absolute; right: 0; top: -3px; width: 90px; height: 9px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(196, 181, 253, .95), rgba(139, 92, 246, 0)); filter: blur(1px); }
@keyframes ldFlow { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- écran de démarrage */
.boot { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; background: var(--bg, #0B0C10); overflow: hidden;
  transition: opacity .55s ease, visibility .55s; }
.boot.gone { opacity: 0; visibility: hidden; }
.boot.gone .boot-in { transform: scale(1.04); filter: blur(6px); }
.boot-glow { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(80px); opacity: .55;
  background: radial-gradient(circle at 35% 40%, rgba(139, 92, 246, .45), transparent 55%), radial-gradient(circle at 65% 60%, rgba(59, 130, 246, .35), transparent 55%);
  animation: bootDrift 8s ease-in-out infinite alternate; }
@keyframes bootDrift { to { transform: translate(4vmax, -3vmax) rotate(25deg) scale(1.08); } }
.boot-in { position: relative; width: min(340px, 82vw); display: flex; flex-direction: column; align-items: center; gap: 16px;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1), filter .55s ease; animation: bootIn .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bootIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* logo : il tourne en continu (la rotation est sur .boot-spin, sans filtre : le navigateur la fait tourner même pendant le chargement des données) dans le sens des aiguilles d'une montre, l'anneau lumineux tourne en même temps dans l'autre sens */
.boot-mark { position: relative; width: 100px; height: 100px; display: grid; place-items: center; }
.boot-mark::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 108, 250, .55), transparent 70%);
  filter: blur(14px); animation: bootPulse 1.6s ease-in-out infinite; }
.boot-spin { position: relative; width: 104px; height: 104px; will-change: transform; animation: bootTurn 1.8s linear infinite; }
.boot-logo { display: block; width: 104px; height: 104px; border-radius: 50%; object-fit: cover; clip-path: circle(40% at 50% 50%); }
.boot-ring { position: absolute; inset: 0; border-radius: 50%; will-change: transform;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(139, 92, 246, .15) 62%, #8B5CF6 82%, #60A5FA 97%, transparent 100%);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
          mask: radial-gradient(closest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: bootSpin 1.2s linear infinite reverse; }
@keyframes bootTurn { to { transform: rotate(360deg); } }
@keyframes bootSpin { to { transform: rotate(360deg); } }
@keyframes bootPulse { 50% { transform: scale(1.18); opacity: .65; } }

.boot-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--text, #EDEEF3); }
.boot-bar { position: relative; width: 100%; height: 6px; border-radius: 99px; overflow: hidden; background: var(--surface-2, rgba(255, 255, 255, .06)); }
.boot-fill { position: absolute; inset: 0; border-radius: 99px; transform-origin: 0 50%; transform: scaleX(0); will-change: transform;
  background: linear-gradient(90deg, #8B5CF6, #5B6CF9 55%, #3B82F6, #8B5CF6); background-size: 200% 100%; animation: ldFlow 1.6s linear infinite; }
/* reflet qui glisse en continu sur la barre */
.boot-fill b { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); background-size: 40% 100%; background-repeat: no-repeat;
  animation: bootShine 1.3s linear infinite; }
@keyframes bootShine { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.boot-row { width: 100%; display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3, #6C7182); }
.boot-pc { font-variant-numeric: tabular-nums; color: var(--text-2, #A3A7B5); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .boot-glow, .boot-mark::before, .boot-ring { animation: none; }
  .boot-spin { animation-duration: 4s; }
}

/* Outils actuels (Reels, Création AI) intégrés dans le nouveau design */
.embed-host { flex: 1; display: flex; min-height: calc(100vh - var(--topbar-h, 60px)); }
.embed-host iframe { flex: 1; width: 100%; border: 0; min-height: calc(100vh - var(--topbar-h, 60px)); background: var(--bg); }

/* Reels : interrupteur « Nouveau design / Design actuel » au-dessus de l'outil intégré */
.embed-host { flex-direction: column; }
.embed-host.has-bar iframe { min-height: calc(100vh - var(--topbar-h, 60px) - 52px); }
.embed-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  background: color-mix(in srgb, var(--bg, #0B0C10) 85%, transparent); backdrop-filter: blur(12px); }
.embed-bar .eb-lbl { font-size: 12px; color: var(--text-3, #6C7182); font-weight: 550; }
.eb-sw { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; border: 1px solid var(--border-strong, rgba(255,255,255,.12)); background: var(--surface, rgba(255,255,255,.03)); }
.eb-sw button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: none;
  justify-content: center; color: var(--text-2, #A3A7B5); font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; transition: color .25s; }
.eb-sw button:hover { color: var(--text, #EDEEF3); }
.eb-sw button.on { color: #fff; }
.eb-sw .eb-ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px;
  background: linear-gradient(135deg, #8B5CF6, #3B82F6); box-shadow: 0 6px 18px -8px rgba(99,102,241,.9); transition: transform .4s cubic-bezier(.2,.8,.2,1), background .3s; }
.embed-bar.is-old .eb-ind { transform: translateX(100%); background: rgba(255,255,255,.12); box-shadow: none; }
@media (max-width: 640px) { .embed-bar { padding: 8px 12px; } .embed-bar .eb-lbl { display: none; } .eb-sw { flex: 1; } .eb-sw button { flex: 1; justify-content: center; } }
