/* ==========================================================================
   NEXOO APP — FINITIONS UX MOBILE (Lots 1, 2 & 3)
   100 % CSS/SVG natif, léger sur mobile, Dark Mode haute performance
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SPLASH SCREEN EXPRESS (~0,8 s, 1 fois par session — Logo transparent)
   -------------------------------------------------------------------------- */
.nx-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      circle at 50% 48%,
      rgba(57, 255, 20, 0.12) 0%,
      rgba(34, 197, 94, 0.04) 30%,
      rgba(8, 14, 28, 0.99) 68%
    ),
    #080e1c;
  opacity: 1;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.nx-splash.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.nx-splash-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 28px;
  animation: nxSplashPop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Halo néon diffus centré directement derrière les lettres */
.nx-splash-halo {
  position: absolute;
  inset: -6px -18px;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(57, 255, 20, 0.34) 0%,
    rgba(34, 197, 94, 0.14) 44%,
    rgba(57, 255, 20, 0) 74%
  );
  filter: blur(18px);
  animation: nxSplashHalo 0.85s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Logo transparent : le drop-shadow suit exactement le tracé de l'écriture */
.nx-splash-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(240px, 70vw, 340px);
  max-height: 45dvh;
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 12px rgba(57, 255, 20, 0.45))
    drop-shadow(0 0 30px rgba(34, 197, 94, 0.28));
}

@media (min-width: 860px) {
  .nx-splash-logo {
    width: clamp(340px, 34vw, 460px);
  }
}
/* --------------------------------------------------------------------------
   2. DASHBOARD — OPTION A (« PERFORMANCE GLOW » ADAPTATIF + TRAME RADAR)
   -------------------------------------------------------------------------- */
#tab-dashboard {
  position: relative;
  background-color: #080e1c;
  background-repeat: no-repeat, no-repeat;
  background-position: top center, top center;
  background-size: 100% 340px, 420px 300px;
  transition: background-image 0.4s ease;
}

/* Halo vert néon (bilan du jour validé / état nominal) */
#tab-dashboard.dash-ambient-green {
  background-image:
    radial-gradient(
      ellipse 85% 58% at 50% -10%,
      rgba(57, 255, 20, 0.13) 0%,
      rgba(34, 197, 94, 0.06) 44%,
      rgba(8, 14, 28, 0) 78%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='300' viewBox='0 0 420 300' fill='none'%3E%3Cg stroke='%2339ff14' stroke-opacity='0.065' stroke-width='1'%3E%3Ccircle cx='210' cy='24' r='68'/%3E%3Ccircle cx='210' cy='24' r='126'/%3E%3Ccircle cx='210' cy='24' r='186'/%3E%3Ccircle cx='210' cy='24' r='246' stroke-dasharray='3 6'/%3E%3Cline x1='210' y1='0' x2='210' y2='275'/%3E%3Cline x1='10' y1='24' x2='410' y2='24'/%3E%3C/g%3E%3C/svg%3E");
}

/* Halo ambre (bilan du jour en attente ou alerte charge) */
#tab-dashboard.dash-ambient-amber {
  background-image:
    radial-gradient(
      ellipse 85% 58% at 50% -10%,
      rgba(250, 204, 21, 0.14) 0%,
      rgba(245, 158, 11, 0.06) 44%,
      rgba(8, 14, 28, 0) 78%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='300' viewBox='0 0 420 300' fill='none'%3E%3Cg stroke='%23f59e0b' stroke-opacity='0.07' stroke-width='1'%3E%3Ccircle cx='210' cy='24' r='68'/%3E%3Ccircle cx='210' cy='24' r='126'/%3E%3Ccircle cx='210' cy='24' r='186'/%3E%3Ccircle cx='210' cy='24' r='246' stroke-dasharray='3 6'/%3E%3Cline x1='210' y1='0' x2='210' y2='275'/%3E%3Cline x1='10' y1='24' x2='410' y2='24'/%3E%3C/g%3E%3C/svg%3E");
}

/* Glassmorphism léger et lisible sur les cartes du Dashboard */
#tab-dashboard .dash-card,
#tab-dashboard .dash-plan-card,
#tab-dashboard .dash-quick-btn,
#tab-dashboard .dash-coach-btn {
  background: rgba(17, 26, 46, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#tab-dashboard .dash-radar-card.is-todo {
  border-color: rgba(245, 158, 11, 0.28);
}

#tab-dashboard .dash-radar-card.is-done {
  border-color: rgba(34, 197, 94, 0.28);
}

/* Entrée en cascade fluide des cartes du Dashboard */
.dash-wrap.dash-cascade .dash-header,
.dash-wrap.dash-cascade .dash-coach-btn:not(.hidden),
.dash-wrap.dash-cascade .dash-radar-card,
.dash-wrap.dash-cascade .dash-reprise-card,
.dash-wrap.dash-cascade .dash-quick-grid,
.dash-wrap.dash-cascade .dash-plan-card {
  animation: nxDashFadeUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash-wrap.dash-cascade .dash-header {
  animation-delay: 0ms;
}
.dash-wrap.dash-cascade .dash-coach-btn:not(.hidden) {
  animation-delay: 45ms;
}
.dash-wrap.dash-cascade .dash-radar-card {
  animation-delay: 85ms;
}
.dash-wrap.dash-cascade .dash-reprise-card {
  animation-delay: 140ms;
}
.dash-wrap.dash-cascade .dash-quick-grid {
  animation-delay: 195ms;
}
.dash-wrap.dash-cascade .dash-plan-card {
  animation-delay: 250ms;
}

@keyframes nxDashFadeUp {
  from {
    opacity: 0;
    transform: translateY(11px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   3. BOUTON JAUNE « FAIRE MON BILAN » ANIMÉ (disparaît dès validation)
   -------------------------------------------------------------------------- */
#tab-dashboard .dash-bilan-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  color: #080e1c;
  font-weight: 800;
  border: 1px solid rgba(254, 240, 138, 0.65);
  box-shadow:
    0 0 0 0 rgba(250, 204, 21, 0.55),
    0 6px 18px rgba(245, 158, 11, 0.28);
  animation: nxBilanPulse 2.4s ease-in-out infinite;
  will-change: box-shadow, transform;
}

#tab-dashboard .dash-bilan-cta::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -70%;
  width: 48%;
  height: 140%;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  animation: nxBilanSheen 3.6s ease-in-out infinite;
}

#tab-dashboard .dash-bilan-cta:active {
  transform: scale(0.97);
}

/* Badge vert calme une fois le bilan validé */
#tab-dashboard .dash-done-pill {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.34);
  animation: none;
}

@keyframes nxBilanPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(250, 204, 21, 0.45),
      0 6px 18px rgba(245, 158, 11, 0.26);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(250, 204, 21, 0),
      0 8px 22px rgba(245, 158, 11, 0.38);
  }
}

@keyframes nxBilanSheen {
  0%,
  68% {
    left: -70%;
    opacity: 0;
  }
  74% {
    opacity: 1;
  }
  96% {
    left: 135%;
    opacity: 0.9;
  }
  100% {
    left: 135%;
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   4. LOT 2 — BOUTON « 📅 ÉVÉNEMENTS » (.js-back-link)
   -------------------------------------------------------------------------- */
.js-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.js-back-link:hover {
  border-color: rgba(57, 255, 20, 0.35);
  color: #f8fafc;
}

/* --------------------------------------------------------------------------
   5. LOT 3 — BILAN QUOTIDIEN : PUCES 1–10 DYNAMIQUES & VALIDATION GUIDÉE
   -------------------------------------------------------------------------- */
.b-step1-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.b-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.26);
  transition: all 0.25s ease;
}

.b-progress-pill.is-complete {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.42);
}

/* Carte de chaque critère (Sommeil / Stress / Motivation / Focus) */
.b-slider-group {
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 14, 28, 0.35);
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.b-slider-group.is-active-pillar {
  border-color: rgba(57, 255, 20, 0.34);
  background: rgba(24, 36, 63, 0.62);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.1), 0 6px 18px rgba(0, 0, 0, 0.22);
}

.b-slider-group.is-answered {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(17, 26, 46, 0.45);
}

.b-slider-group.is-missing-flash {
  border-color: rgba(245, 158, 11, 0.72);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
  animation: nxShake 0.34s ease;
}

/* Badge valeur vide "— / 10" */
.b-slider-val.tone-empty {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

/* Onde lumineuse d'invitation sur la ligne active non encore renseignée */
.b-slider-group.is-active-pillar .b-dot-btn:not(.filled) .b-dot-circle {
  animation: nxDotInviteWave 2.1s ease-in-out infinite;
  animation-delay: calc(var(--dot-idx, 0) * 75ms);
}

@keyframes nxDotInviteWave {
  0%,
  70%,
  100% {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
    transform: scale(1);
  }
  22% {
    border-color: rgba(57, 255, 20, 0.62);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.28);
    transform: scale(1.06);
  }
}

/* Remplissage en cascade fluide au clic */
.b-dot-btn.just-filled .b-dot-circle {
  animation: nxDotCascadePop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--dot-idx, 0) * 26ms);
}

@keyframes nxDotCascadePop {
  0% {
    transform: scale(0.84);
    opacity: 0.72;
  }
  65% {
    transform: scale(1.13);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Message discret + bouton Continuer verrouillé tant que < 4/4 */
.b-guide-hint {
  font-size: 12.5px;
  color: #fbbf24;
  text-align: center;
  margin-top: -2px;
  min-height: 18px;
  transition: opacity 0.2s ease;
}

.b-guide-hint.is-ok {
  color: #86efac;
}

.b-btn.primary.is-locked {
  opacity: 0.48;
  filter: grayscale(0.25);
  cursor: not-allowed;
}

.b-btn.primary.is-locked:hover {
  transform: none;
}

@keyframes nxShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

/* --------------------------------------------------------------------------
   6. ACCESSIBILITÉ — RÉDUCTION DES MOUVEMENTS
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .nx-splash,
  .nx-splash-logo-wrap,
  .nx-splash-halo,
  .nx-splash-brand,
  .dash-wrap.dash-cascade *,
  #tab-dashboard .dash-bilan-cta,
  #tab-dashboard .dash-bilan-cta::after,
  .b-slider-group.is-active-pillar .b-dot-btn .b-dot-circle,
  .b-dot-btn.just-filled .b-dot-circle {
    animation: none !important;
    transition: none !important;
  }
}