/* ============================================
   SCANNING / ANALYZING SCREEN
   Full-screen overlay that plays on load,
   then transitions out to reveal Home.
   ============================================ */

.scanning-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--color-bg);
  border-radius: var(--frame-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.scanning-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.scanning-screen.exit {
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* « Thinking » pulse — subtle opacity breathe (ChatGPT-like) */
@keyframes scanning-label-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.58; }
}


/* ============================================
   SCANNING BLOBS
   Large, centered blobs — more prominent than Home.
   Positioned center-left per Figma (x:-275, y:-39).
   ============================================ */

.scanning-blobs {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.scanning-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* Positions calquées sur blob-1/2 (haut droite) et blob-3/4 (bas gauche) du Home */
.scanning-blob-1 {
  width: 390px;
  height: 390px;
  top: -160px;
  right: -100px;
  left: auto;
  background-color: rgba(100, 180, 255, 0.4);
  filter: blur(90px);
  animation: scan-drift-1 8s ease-in-out infinite;
  transition: background-color 0.9s ease;
}

.scanning-blob-2 {
  width: 255px;
  height: 255px;
  top: -80px;
  right: -40px;
  left: auto;
  background-color: rgba(100, 180, 255, 0.35);
  filter: blur(70px);
  animation: scan-drift-2 10s ease-in-out infinite;
  transition: background-color 0.9s ease 0.1s;
}

.scanning-blob-3 {
  width: 390px;
  height: 390px;
  bottom: -80px;
  left: -120px;
  background-color: rgba(100, 180, 255, 0.14);
  filter: blur(100px);
  animation: scan-drift-3 12s ease-in-out infinite;
  transition: background-color 0.9s ease 0.2s;
}

/* Couleurs de résultat — calquées exactement sur blob-1/2/3 du Home */
.scanning-screen.result-green  .scanning-blob-1 { background-color: rgba(43, 212, 153, 0.40); }
.scanning-screen.result-green  .scanning-blob-2 { background-color: rgba(43, 212, 153, 0.35); }
.scanning-screen.result-green  .scanning-blob-3 { background-color: rgba(43, 212, 153, 0.14); }

.scanning-screen.result-yellow .scanning-blob-1 { background-color: rgba(255, 189, 113, 0.55); }
.scanning-screen.result-yellow .scanning-blob-2 { background-color: rgba(255, 189, 113, 0.45); }
.scanning-screen.result-yellow .scanning-blob-3 { background-color: rgba(255, 189, 113, 0.20); }

.scanning-screen.result-red    .scanning-blob-1 { background-color: rgba(245, 10, 10, 0.22); }
.scanning-screen.result-red    .scanning-blob-2 { background-color: rgba(245, 10, 10, 0.18); }
.scanning-screen.result-red    .scanning-blob-3 { background-color: rgba(245, 10, 10, 0.08); }

@keyframes scan-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1);            opacity: 1; }
  33%      { transform: translate(30px, 20px) scale(1.08);   opacity: 0.5; }
  66%      { transform: translate(-15px, 10px) scale(0.95);  opacity: 0.8; }
}

@keyframes scan-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1);            opacity: 0.7; }
  40%      { transform: translate(-25px, -15px) scale(1.06); opacity: 1; }
  75%      { transform: translate(10px, 20px) scale(0.94);   opacity: 0.45; }
}

@keyframes scan-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1);            opacity: 0.35; }
  25%      { transform: translate(20px, -25px) scale(1.1);   opacity: 0.55; }
  50%      { transform: translate(-10px, 15px) scale(0.92);  opacity: 0.22; }
  80%      { transform: translate(8px, -8px) scale(1.03);    opacity: 0.42; }
}


/* ============================================
   LOGO
   ============================================ */

.scanning-logo {
  position: absolute;
  top: 220px;
  left: 50%;
  transform: translateX(-50%);
  animation: logo-appear 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  /* Reset bouton */
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.scanning-logo-img {
  width: 72px;
  height: 72px;
  animation: logo-breathe 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes logo-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.030); }
}

/* Scout par défaut ; logo SFR via html.logo-sfr ou html.usecase-branding */
.scanning-logo--default {
  display: block;
}

.scanning-logo--sfr {
  display: none;
}

html.logo-sfr .scanning-logo--default {
  display: none;
}

html.logo-sfr .scanning-logo--sfr {
  display: block;
}

@keyframes logo-appear {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ============================================
   SCANNING TEXT
   Deux lignes centrées : « Analyzing » puis phrase (italique)
   ============================================ */

.scanning-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* Deux lignes : libellé de statut (discret) + phrase principale en italique */
.scanning-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

.scanning-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 24px;
  letter-spacing: -0.02em;
  color: rgba(26, 26, 26, 0.62);
  flex-shrink: 0;
  text-align: center;
  animation: scanning-label-breathe 2.1s ease-in-out infinite;
  will-change: opacity;
}

@media (prefers-reduced-motion: reduce) {
  .scanning-label {
    animation: none;
  }
}

.scanning-word-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  height: auto;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.scanning-word {
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 20px;
  color: var(--color-text);
  line-height: 28px;
  display: block;
  white-space: nowrap;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.scanning-word.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.scanning-word.fade-in {
  opacity: 0;
  transform: translateY(10px);
}


/* ============================================
   PROGRESS BAR
   x:100, y:368, w:175, h:3
   Track: rgba(255,255,255,0.3), corner-radius 16
   Fill: green accent, animates 0→100%
   ============================================ */

.scanning-progress {
  width: 175px;
  max-width: calc(100% - 32px);
  height: 3px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

.scanning-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 16px;
  background: var(--green-accent);
  transition: width 3.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanning-progress-fill.running {
  width: 100%;
}


/* ============================================
   HOME SCREEN WRAPPER
   Sits behind scanning, revealed after exit.
   ============================================ */

.home-screen {
  position: absolute;
  inset: 0;
  border-radius: var(--frame-radius);
  overflow: hidden;
}
