/* HABYS — Transition fluide V4
   Aucun agrandissement d'image. Couche visuelle uniquement. */

html.habys-flow-lock,
html.habys-flow-lock body {
  overflow: hidden !important;
}

body.habys-flow-leaving > .header,
body.habys-flow-leaving > .cards-grid,
body.habys-flow-leaving > .footer {
  pointer-events: none;
  animation: habysFlowPageLeave 560ms cubic-bezier(.4, 0, .2, 1) both;
}

body.habys-flow-leaving > .cards-grid {
  animation-delay: 35ms;
}

body.habys-flow-leaving > .footer {
  animation-delay: 70ms;
}

@keyframes habysFlowPageLeave {
  from {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px);
  }
}

.habys-flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: all;
  color: #f8fbff;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .18), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(8, 145, 178, .12), transparent 36%),
    linear-gradient(135deg, #08172a 0%, #10233d 52%, #0b1c31 100%);
  transition: opacity 360ms ease;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.habys-flow-overlay.is-visible {
  opacity: 1;
}

.habys-flow-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .34;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.82), transparent 95%);
}

.habys-flow-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -24%;
  width: 18%;
  opacity: 0;
  transform: skewX(-12deg);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(143, 213, 255, .16), transparent);
}

.habys-flow-overlay.is-running::after {
  opacity: 1;
  animation: habysFlowLightSweep 1050ms cubic-bezier(.22,1,.36,1) 170ms both;
}

@keyframes habysFlowLightSweep {
  from { left: -24%; }
  to { left: 112%; }
}

.habys-flow-center {
  position: relative;
  z-index: 2;
  width: min(390px, calc(100vw - 48px));
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 380ms ease 90ms,
    transform 650ms cubic-bezier(.22,1,.36,1) 90ms;
}

.habys-flow-overlay.is-running .habys-flow-center {
  opacity: 1;
  transform: translateY(0);
}

.habys-flow-logo-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 25% 20%, rgba(67,199,255,.20), transparent 48%),
    rgba(255,255,255,.065);
  box-shadow:
    0 18px 45px rgba(0,0,0,.28),
    0 0 35px rgba(67,199,255,.08);
}

.habys-flow-logo-shell::after {
  content: "";
  position: absolute;
  inset: -60% -140%;
  opacity: 0;
  transform: translateX(-35%) rotate(10deg);
  background: linear-gradient(110deg, transparent 39%, rgba(255,255,255,.38) 50%, transparent 61%);
}

.habys-flow-overlay.is-running .habys-flow-logo-shell::after {
  animation: habysFlowLogoShine 950ms ease 330ms both;
}

@keyframes habysFlowLogoShine {
  0% { opacity: 0; transform: translateX(-36%) rotate(10deg); }
  30% { opacity: .75; }
  100% { opacity: 0; transform: translateX(36%) rotate(10deg); }
}

.habys-flow-logo {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 9px 18px rgba(0,0,0,.30));
}

.habys-flow-eyebrow {
  margin-bottom: 7px;
  color: rgba(214,237,251,.64);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.habys-flow-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 760;
  letter-spacing: -.025em;
}

.habys-flow-subtitle {
  margin: 9px 0 0;
  color: rgba(229,241,250,.69);
  font-size: .9rem;
  line-height: 1.5;
}

.habys-flow-progress {
  position: relative;
  width: min(260px, 74vw);
  height: 3px;
  margin: 25px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.11);
}

.habys-flow-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #77d8ff 0%, #8be8dc 52%, #b8a9ff 100%);
  box-shadow: 0 0 16px rgba(119,216,255,.34);
}

.habys-flow-overlay.is-running .habys-flow-progress::after {
  animation: habysFlowProgress 1250ms cubic-bezier(.2,.7,.2,1) 190ms both;
}

@keyframes habysFlowProgress {
  0% { width: 0; }
  72% { width: 78%; }
  100% { width: 100%; }
}

.habys-flow-caption {
  margin-top: 12px;
  color: rgba(207,224,236,.52);
  font-size: .72rem;
}

/* Arrivée sur le véritable tableau de bord */
html.habys-flow-dashboard-arrival body {
  animation: habysFlowDashboardBody 620ms ease both;
}

html.habys-flow-dashboard-arrival .sidebar {
  animation: habysFlowDashboardSidebar 650ms cubic-bezier(.22,1,.36,1) 35ms both;
}

html.habys-flow-dashboard-arrival .main-header {
  animation: habysFlowDashboardHeader 620ms cubic-bezier(.22,1,.36,1) 85ms both;
}

html.habys-flow-dashboard-arrival .filters-pro,
html.habys-flow-dashboard-arrival .filters {
  animation: habysFlowDashboardContent 660ms cubic-bezier(.22,1,.36,1) 125ms both;
}

html.habys-flow-dashboard-arrival .dashboard-grid,
html.habys-flow-dashboard-arrival .sections-column {
  animation: habysFlowDashboardContent 700ms cubic-bezier(.22,1,.36,1) 165ms both;
}

@keyframes habysFlowDashboardBody {
  from { opacity: .25; }
  to { opacity: 1; }
}

@keyframes habysFlowDashboardSidebar {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes habysFlowDashboardHeader {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  body.habys-flow-leaving > .header,
  body.habys-flow-leaving > .cards-grid,
  body.habys-flow-leaving > .footer,
  .habys-flow-overlay,
  .habys-flow-center,
  html.habys-flow-dashboard-arrival body,
  html.habys-flow-dashboard-arrival .sidebar,
  html.habys-flow-dashboard-arrival .main-header,
  html.habys-flow-dashboard-arrival .filters-pro,
  html.habys-flow-dashboard-arrival .filters,
  html.habys-flow-dashboard-arrival .dashboard-grid,
  html.habys-flow-dashboard-arrival .sections-column {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
