/* ============================================
   BACKGROUND BLOBS
   Soft radial blobs that change color per state.
   Positions match Figma Onde instances.
   ============================================ */

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

.blob {
  position: absolute;
  border-radius: 50%;
  transition: background-color 0.8s ease;
  will-change: transform, opacity;
}

/* Tous les blobs concentrés en haut à droite */
/* Durées « irrégulières » + délais très différents = cycles peu alignés (jamais synchros) */
.blob-1 {
  width: 390px;
  height: 390px;
  top: -160px;
  right: -100px;
  left: auto;
  background-color: rgba(43, 212, 153, 0.4);
  filter: blur(90px);
  animation:
    drift-1 25.4s cubic-bezier(0.42, 0, 0.58, 1) infinite,
    blob-fade-1 14.92s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  animation-delay: -2.4s, -9.44s;
}

.blob-2 {
  width: 255px;
  height: 255px;
  top: -80px;
  right: -40px;
  left: auto;
  background-color: rgba(43, 212, 153, 0.35);
  filter: blur(70px);
  animation:
    drift-2 32.6s cubic-bezier(0.33, 0.12, 0.25, 1) infinite,
    blob-fade-2 17.64s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: -21.6s, -2.96s;
}

.blob-3 {
  width: 390px;
  height: 390px;
  bottom: -80px;
  left: -120px;
  background-color: rgba(43, 212, 153, 0.14);
  filter: blur(100px);
  animation:
    drift-3 38.2s cubic-bezier(0.37, 0, 0.63, 1) infinite,
    blob-fade-3 12.68s cubic-bezier(0.48, 0.02, 0.52, 0.98) infinite;
  animation-delay: -10.8s, -7.56s;
}

.blob-4 {
  width: 266px;
  height: 266px;
  bottom: -20px;
  left: 20px;
  background-color: rgba(43, 212, 153, 0.12);
  filter: blur(80px);
  animation:
    drift-4 28.8s cubic-bezier(0.44, 0.08, 0.56, 0.92) infinite,
    blob-fade-4 19.44s cubic-bezier(0.43, 0, 0.57, 1) infinite;
  animation-delay: -27.4s, -16.48s;
}

/* Mouvement uniquement — l’opacité est gérée par blob-fade-* (plus lent, désynchronisé) */
@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(12px, 8px) scale(1.04); }
  66%      { transform: translate(-8px, 5px) scale(0.97); }
}

@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-10px, 6px) scale(1.03); }
  50%      { transform: translate(6px, 12px) scale(0.96); }
  75%      { transform: translate(-4px, -5px) scale(1.02); }
}

@keyframes drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%      { transform: translate(15px, -10px) scale(1.05); }
  70%      { transform: translate(-6px, 8px) scale(0.98); }
}

@keyframes drift-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30%      { transform: translate(-8px, -12px) scale(1.06); }
  60%      { transform: translate(10px, 4px) scale(0.95); }
  85%      { transform: translate(3px, -6px) scale(1.02); }
}

/* Opacité : lent, rythmes différents, pic max = 1 (jamais plus opaque qu’avant) */
@keyframes blob-fade-1 {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.38; }
}

@keyframes blob-fade-2 {
  0%, 100% { opacity: 0.72; }
  33%      { opacity: 1; }
  66%      { opacity: 0.42; }
}

@keyframes blob-fade-3 {
  0%, 100% { opacity: 0.30; }
  40%      { opacity: 0.18; }
  80%      { opacity: 0.55; }
}

@keyframes blob-fade-4 {
  0%, 100% { opacity: 0.26; }
  25%      { opacity: 0.50; }
  50%      { opacity: 0.19; }
  75%      { opacity: 0.37; }
}

/* Yellow state blobs */
[data-state="yellow"] .blob-1 { background-color: rgba(255, 189, 113, 0.55); }
[data-state="yellow"] .blob-2 { background-color: rgba(255, 189, 113, 0.45); }
[data-state="yellow"] .blob-3 { background-color: rgba(255, 189, 113, 0.20); }
[data-state="yellow"] .blob-4 { background-color: rgba(255, 189, 113, 0.14); }

/* Red state blobs */
[data-state="red"] .blob-1 { background-color: rgba(245, 10, 10, 0.25); }
[data-state="red"] .blob-2 { background-color: rgba(245, 10, 10, 0.2); }
[data-state="red"] .blob-3 { background-color: rgba(245, 10, 10, 0.10); }
[data-state="red"] .blob-4 { background-color: rgba(245, 10, 10, 0.07); }


/* ============================================
   HEADER ROW — Logo + Menu
   ============================================ */

/* Logo row + Menu — same horizontal line (Figma y=73) */
.logo-row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: max(30px, env(safe-area-inset-top, 0px));
  padding: 0 var(--side-padding);
}

.logo-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header-logo {
  display: block;
  object-fit: contain;
}

/* Cas Nagra (non branding) : wordmark 104px — hauteur auto selon le viewBox */
.header-logo--scout {
  width: 104px;
  height: auto;
  margin-left: 2px;
}

.header-logo--sfr {
  display: none;
  width: 40px;
  height: 40px;
}

/* Toggle logo marque blanche */
html.logo-sfr .header-logo--scout {
  display: none;
}

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

.menu-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn-icon {
  display: block;
  width: 24px;
  height: 24px;
}


/* ============================================
   TITLE BLOCK
   y:146, x:30, w:315, h:123
   Gap from header bottom (102) to 146 = 44px
   ============================================ */

.title-block {
  position: relative;
  z-index: 3;
  margin-top: 44px;
  padding: 0 var(--side-padding);
}

.title-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.52px;
  line-height: 41px;
  color: var(--color-text);
}

.title-network {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.52px;
  line-height: 41px;
  color: var(--color-text);
}

.title-status {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.52px;
  line-height: 41px;
  color: var(--green-accent);
  transition: color 0.5s ease;
}

.title-status.status-fade-in {
  animation: status-fade-in 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes status-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

[data-state="yellow"] .title-status { color: var(--yellow-accent); }
[data-state="red"] .title-status { color: var(--red-accent); }


/* ============================================
   STATS SUMMARY — phrase + pastilles (compteurs animés)
   ============================================ */

.stats-summary {
  position: relative;
  z-index: 3;
  margin-top: 40px;
  padding: 0 var(--side-padding) 12px;
  overflow: visible;
}

/* Frame Figma « Infos » : 2 lignes, texte 19px léger + pastilles 13px semibold */
.stats-summary-inner {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  overflow: visible;
}

.stats-summary-line--primary {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

/* Phrase continue + pastilles : interlignage (row-gap) + marge basse pour ne pas couper les ombres */
.stats-summary-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  row-gap: 10px;
  column-gap: 6px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 2px 0 16px;
  font: inherit;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  box-sizing: border-box;
}

.stats-summary-sentence {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: -0.2px;
  color: var(--color-text);
}

/* Défilement horizontal surtout utile jaune / rouge ; le padding bas garde les ombres visibles */
.phone-frame[data-state="green"] .stats-summary-flow {
  overflow-x: visible;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 10px 11px;
  border-radius: 60px;
  flex-shrink: 0;
  /* Glassmorphism — fond léger + flou (motif / dégradé visible derrière) */
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .stat-pill {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
}

/* Pastille : tout le libellé en 13px semibold (comme le texte unique Figma dans la capsule) */
.threat-count.stat-pill-num,
.stat-number.stat-pill-num {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  line-height: normal;
  font-style: normal;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 1ch;
  text-align: start;
  color: var(--color-text);
  transition: color 0.35s ease;
}

.threat-count.stat-pill-num {
  min-width: 3ch;
}

.stat-number.stat-pill-num:not(.stat-alerts) {
  min-width: 2ch;
}

.stat-alerts.stat-pill-num {
  min-width: 1ch;
}

.stat-pill-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  line-height: normal;
  letter-spacing: -0.2px;
  color: var(--color-text);
  transition: color 0.35s ease;
}

/* Suite « … alerts were found » : masquée en mode vert (aucune alerte) */
.phone-frame[data-state="green"] .stats-summary-alerts-only {
  display: none;
}

/* Orange / rouge uniquement sur le chiffre des alertes */
.phone-frame[data-state="yellow"] .stat-pill--alerts .stat-pill-num {
  color: var(--yellow-accent);
}

.phone-frame[data-state="red"] .stat-pill--alerts .stat-pill-num {
  color: var(--red-accent);
}


/* ============================================
   ACTIONS SECTION
   ============================================ */

.actions-title {
  position: relative;
  z-index: 3;
  margin-top: 50px;
  padding: 0 var(--side-padding);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 21px;
  line-height: 27px;
  letter-spacing: 0;
  color: var(--color-text);
}

.actions {
  position: relative;
  z-index: 3;
  margin-top: 22px;
  padding: 0 var(--side-padding);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-card {
  position: relative;
  width: 315px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-dark);
  border-top-color: var(--glass-border-light);
  border-left-color: rgba(255, 255, 255, 0.35);
  box-shadow: var(--glass-shadow);
  padding: 15px 17px 16px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0.6;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.action-card:hover {
  background: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 6px 20px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.action-card:hover::before {
  opacity: 1;
}

.action-text {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  color: var(--color-text);
  flex: 1;
}

.action-chevron {
  flex-shrink: 0;
}

/* Alert card (urgent action) */

.action-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-accent);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(220, 53, 69, 0.45);
  animation: alert-pulse 2s ease-in-out infinite;
}

@keyframes alert-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(220, 53, 69, 0.45); }
  50%      { box-shadow: 0 0 12px rgba(220, 53, 69, 0.7); }
}

.action-card-alert .action-text {
  font-weight: 500;
}

/* Scam Detector card icon */
.action-scam-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}


/* ============================================
   DISCUSSION BAR
   x:16, y:736 → bottom:20px
   w:344, h:77, corner-radius:30, glass
   ============================================ */

.discussion-bar {
  position: absolute;
  z-index: 4;
  bottom: 20px;
  left: 16px;
  width: 344px;
}

.discussion-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 77px;
  padding: 16px 17px 18px 19px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-border-dark);
  border-top-color: rgba(255, 255, 255, 0.60);
  border-left-color: rgba(255, 255, 255, 0.40);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.discussion-inner[data-open-scout-bot]:hover {
  background: rgba(255, 255, 255, 0.32);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.discussion-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 35%,
    rgba(255, 255, 255, 0) 55%
  );
  pointer-events: none;
}

.discussion-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discussion-text {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: #000000;
}

.discussion-mic {
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
  line-height: 0;
}

.discussion-mic-icon {
  display: block;
  width: 43px;
  height: 43px;
}

.discussion-mic:hover {
  transform: scale(1.05);
}
