/* Effets du portail (charte, section 6, 08/10/2026). Voir effects.js.
   Tout ce qui bouge est rangé sous « no-preference » : avec le réglage « réduire les
   animations » du poste, le portail reste identique, sans mouvement. */

/* ── Silhouettes de chargement ── */
.fx-skel { cursor: default; pointer-events: none; }
.fx-skel-line {
  display: block; height: 10px; border-radius: 5px;
  background: color-mix(in srgb, var(--ink-faint) 22%, transparent);
}
.fx-skel-row { padding: 6px 0; }

/* Carte dont le détail est ouvert */
.kcard.fx-picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ── Palette de commandes (Ctrl+K) ── */
.fx-palette {
  width: min(620px, 92vw); margin-top: 12vh; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.fx-palette::backdrop { background: rgba(0, 0, 0, .35); }
.fx-pal-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-faint); }
.fx-pal-box input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--ink); font-size: 15px; font-family: inherit; }
.fx-palette kbd, .fx-kbd {
  font: 600 10.5px/1 inherit; color: var(--ink-faint); border: 1px solid var(--line);
  border-radius: 5px; padding: 3px 6px; background: var(--surface); white-space: nowrap;
}
.fx-pal-list { max-height: min(420px, 55vh); overflow-y: auto; padding: 6px; }
.fx-pal-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.fx-pal-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.fx-pal-item.on { background: var(--card-hover); box-shadow: inset 2px 0 0 var(--accent); }
.fx-pal-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-faint); }
.fx-pal-text { display: flex; flex-direction: column; min-width: 0; }
.fx-pal-label { color: var(--ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pal-sub { color: var(--ink-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pal-empty { padding: 18px 10px; color: var(--ink-faint); font-size: 13px; }
.fx-pal-foot { padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-faint); }

/* Bouton d'accès à la palette, sous le logo */
.fx-search-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-faint);
  font-size: 12.5px; cursor: pointer;
}
.fx-search-btn:hover { border-color: var(--border-hover); color: var(--ink-soft); }
.fx-search-btn .fx-kbd { margin-left: auto; }
.sidebar.collapsed .fx-search-btn { justify-content: center; padding: 0; }
.sidebar.collapsed .fx-search-btn span, .sidebar.collapsed .fx-search-btn .fx-kbd { display: none; }

/* ── Halo aux couleurs du logo : connexion et zone du logo seulement ── */
.login-screen { position: relative; overflow: hidden; isolation: isolate; }
.login-screen::before {
  content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(28% 32% at var(--fx-x, 45%) var(--fx-y, 40%), rgba(41, 198, 253, .16), transparent 70%),
    radial-gradient(30% 34% at calc(var(--fx-x, 45%) + 12%) calc(var(--fx-y, 40%) + 10%), rgba(91, 58, 240, .14), transparent 70%),
    radial-gradient(26% 30% at calc(var(--fx-x, 45%) - 10%) calc(var(--fx-y, 40%) + 18%), rgba(250, 93, 0, .10), transparent 70%);
  transition: background-position .2s;
}
.login-card { position: relative; background: color-mix(in srgb, var(--panel) 92%, transparent); }
.brand { position: relative; isolation: isolate; }
.brand::before {
  content: ""; position: absolute; left: -6px; top: -10px; width: 64px; height: 56px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(41, 198, 253, .16), rgba(91, 58, 240, .08) 55%, transparent);
  opacity: .7; transition: opacity .2s;
}
.brand:hover::before { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  /* Silhouettes : pulsation douce, seulement le temps du chargement */
  .fx-skel-line { animation: fx-pulse 1.2s ease-in-out infinite alternate; }

  /* Transitions entre écrans : fondu de toute la page. Nommer le panneau principal
     (view-transition-name sur .main) figeait Chrome sur un tableau de plusieurs centaines
     de cartes, en business unit (10/10/2026) : ne pas le remettre. */
  ::view-transition-old(fx-main) { animation: fx-fade-out .14s ease both; }
  ::view-transition-new(fx-main) { animation: fx-fade-in .22s cubic-bezier(.2, .8, .2, 1) both; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

  /* Connexion : le logo apparaît une fois, puis le contenu monte en cascade */
  .login-mark { animation: fx-logo-in .7s cubic-bezier(.2, .8, .2, 1) both; }
  .login-card > :not(.login-mark) { animation: fx-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
  .login-card > :nth-child(2) { animation-delay: .25s; }
  .login-card > :nth-child(3) { animation-delay: .32s; }
  .login-card > :nth-child(4) { animation-delay: .38s; }
  .login-card > :nth-child(n+5) { animation-delay: .44s; }

  /* Survol des cartes : légère élévation (transform seulement) */
  .kcard, .needcard { transition: background .15s, border-color .15s, transform .15s; }
  .kcard:not(.fx-skel):hover, .needcard:hover { transform: translateY(-1px); }
}

@keyframes fx-pulse { from { opacity: .45; } to { opacity: 1; } }
@keyframes fx-fade-out { to { opacity: 0; } }
@keyframes fx-fade-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fx-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fx-logo-in {
  0% { opacity: 0; transform: translateY(10px) scale(.7); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
