/* ── Scan sequence (phone) — 6s, 4 steps (no gaps between slides) ── */

.phone__screen .scan-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation-fill-mode: both;
}

.scan-slide--scan {
  opacity: 1;
  animation: scanShow1 6s infinite;
}

.scan-slide--import {
  animation: scanShow2 6s infinite;
}

.scan-slide--items {
  animation: scanShow3 6s infinite;
}

.scan-slide--report {
  animation: scanShow4 6s infinite;
}

@keyframes scanShow1 {
  0%, 24.99% { opacity: 1; z-index: 2; }
  25%, 100% { opacity: 0; z-index: 0; }
}

@keyframes scanShow2 {
  0%, 24.99% { opacity: 0; z-index: 0; }
  25%, 49.99% { opacity: 1; z-index: 2; }
  50%, 100% { opacity: 0; z-index: 0; }
}

@keyframes scanShow3 {
  0%, 49.99% { opacity: 0; z-index: 0; }
  50%, 74.99% { opacity: 1; z-index: 2; }
  75%, 100% { opacity: 0; z-index: 0; }
}

@keyframes scanShow4 {
  0%, 74.99% { opacity: 0; z-index: 0; }
  75%, 100% { opacity: 1; z-index: 2; }
}

/* Scan dots */
.scan-dots__dot {
  animation-fill-mode: both;
}

.scan-dots__dot--1 { animation: dotActive1 6s infinite; }
.scan-dots__dot--2 { animation: dotActive2 6s infinite; }
.scan-dots__dot--3 { animation: dotActive3 6s infinite; }
.scan-dots__dot--4 { animation: dotActive4 6s infinite; }

@keyframes dotActive1 {
  0%, 24.99% { background: #1959A6; transform: scale(1.25); }
  25%, 100% { background: #E2E8F0; transform: scale(1); }
}

@keyframes dotActive2 {
  0%, 24.99% { background: #E2E8F0; transform: scale(1); }
  25%, 49.99% { background: #1959A6; transform: scale(1.25); }
  50%, 100% { background: #E2E8F0; transform: scale(1); }
}

@keyframes dotActive3 {
  0%, 49.99% { background: #E2E8F0; transform: scale(1); }
  50%, 74.99% { background: #1959A6; transform: scale(1.25); }
  75%, 100% { background: #E2E8F0; transform: scale(1); }
}

@keyframes dotActive4 {
  0%, 74.99% { background: #E2E8F0; transform: scale(1); }
  75%, 100% { background: #1959A6; transform: scale(1.25); }
}

/* Desktop captions — scan */
@media (min-width: 900px) {
  .scan-caption {
    animation-fill-mode: both;
  }

  .scan-caption--1 { animation: captionActive1 6s infinite; }
  .scan-caption--2 { animation: captionActive2 6s infinite; }
  .scan-caption--3 { animation: captionActive3 6s infinite; }
  .scan-caption--4 { animation: captionActive4 6s infinite; }

  .scan-caption--1 .scan-caption__dot { animation: dotActive1 6s infinite; }
  .scan-caption--2 .scan-caption__dot { animation: dotActive2 6s infinite; }
  .scan-caption--3 .scan-caption__dot { animation: dotActive3 6s infinite; }
  .scan-caption--4 .scan-caption__dot { animation: dotActive4 6s infinite; }

  @keyframes captionActive1 {
    0%, 24.99% { opacity: 1; }
    25%, 100% { opacity: 0.35; }
  }

  @keyframes captionActive2 {
    0%, 24.99% { opacity: 0.35; }
    25%, 49.99% { opacity: 1; }
    50%, 100% { opacity: 0.35; }
  }

  @keyframes captionActive3 {
    0%, 49.99% { opacity: 0.35; }
    50%, 74.99% { opacity: 1; }
    75%, 100% { opacity: 0.35; }
  }

  @keyframes captionActive4 {
    0%, 74.99% { opacity: 0.35; }
    75%, 100% { opacity: 1; }
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .phone__screen .scan-slide {
    animation: none;
    opacity: 0;
  }

  .scan-slide--scan {
    opacity: 1;
    z-index: 2;
  }

  .scan-dots__dot,
  .scan-caption {
    animation: none;
  }

  .scan-dots__dot--1 {
    background: #1959A6;
    transform: scale(1.25);
  }

  .scan-caption--1 {
    opacity: 1;
  }

  .scan-caption--1 .scan-caption__dot {
    background: #1959A6;
  }

  .slide-import__progress-fill,
  .slide-scan__spinner {
    animation: none;
  }

  .slide-import__progress-fill {
    width: 70%;
  }
}
