/* ==========================================================================
   FLUXALVO — STICKY STACKING CARDS (SEÇÃO OPERAÇÃO / FLUXO)
   Desktop: Stacking Horizontal da esquerda para direita
   Mobile: Stacking Vertical de cima para baixo (como no vídeo de referência)
   ========================================================================== */

/* 1. SEÇÃO & CONTAINER */
.operation {
  overflow-x: clip; /* Impede scroll horizontal da página sem quebrar position: sticky */
  position: relative;
}

.operation .scene-sticky {
  overflow: visible !important;
}

/* 2. CONTAINER DO DECK (COLUNA 2) */
.op-deck {
  position: relative;
  width: 100%;
  height: 430px;
  perspective: 1200px;
}

/* Halo azul sutil atrás do deck */
.op-deck::before {
  content: '';
  position: absolute;
  inset: -12% -6% -18% -6%;
  background: radial-gradient(ellipse 65% 55% at 55% 45%, rgba(37, 99, 255, 0.065) 0%, rgba(37, 99, 255, 0.015) 45%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  filter: blur(28px);
}

/* 3. CARD DO DECK (BASE) */
.op-card {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 216px); /* Reserva 216px para os 6 degraus de 36px */
  min-width: 440px;
  height: 420px;
  border-radius: 8px;
  background: rgba(11, 15, 26, 0.78);
  background-image: linear-gradient(145deg, rgba(16, 28, 50, 0.72) 0%, rgba(9, 13, 22, 0.88) 100%);
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow:
    -10px 0 28px rgba(0, 0, 0, 0.60), /* Sombra física projetada para a esquerda sobre o card anterior */
    0 16px 36px -4px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(37, 99, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  will-change: transform, opacity;
  transform-origin: center center;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
  pointer-events: none;
}

/* Micro-reflexo de canto (top-left) e iluminação interna */
.op-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: radial-gradient(circle 240px at 0% 0%, rgba(147, 197, 253, 0.14) 0%, rgba(37, 99, 255, 0.03) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transition: opacity 0.35s ease;
}

/* Conteúdo acima do reflexo */
.op-card > * {
  position: relative;
  z-index: 1;
}

/* Indicador de Degrau / Aba na borda esquerda visível no desktop */
.card-tab-indicator {
  position: absolute;
  top: 19px;
  left: 0;
  width: 36px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(177, 183, 197, 0.65);
  z-index: 5;
  pointer-events: none;
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.op-card.is-active .card-tab-indicator {
  color: var(--blue);
  text-shadow: 0 0 10px rgba(37, 99, 255, 0.7);
}

.op-card .console-top {
  padding: 19px 24px 19px 38px;
  background: rgba(15, 23, 40, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.op-card .console-bottom {
  background: rgba(10, 14, 25, 0.45);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.op-card .op-record {
  margin-top: 20px;
  padding: 12px 18px;
  border-top: none;
  background: rgba(13, 20, 36, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(37, 99, 255, 0.12);
}

/* 4. BORDA COM GLOW SUTIL & ESTADO ATIVO */
.op-card.is-active {
  border-color: rgba(37, 99, 255, 0.42);
  background: rgba(13, 19, 34, 0.84);
  background-image: linear-gradient(145deg, rgba(20, 34, 62, 0.80) 0%, rgba(11, 15, 26, 0.92) 100%);
  box-shadow:
    -12px 0 32px rgba(0, 0, 0, 0.70),
    0 20px 48px -4px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(37, 99, 255, 0.08),
    inset 1px 0 0 rgba(96, 165, 250, 0.20),   /* Borda vertical chanfrada (#60A5FA) */
    inset 0 0 20px rgba(37, 99, 255, 0.03);  /* Halo difuso interno */
  pointer-events: auto;
}

.op-card.is-active::before {
  opacity: 0.85;
}

/* Highlight no topo esquerdo do card ativo */
.op-card.is-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 38%;
  height: 1.2px;
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.75) 0%, rgba(96, 165, 250, 0.35) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.op-card.is-active .status-dot {
  box-shadow: 0 0 8px #2563ff;
}

/* Cards inativos empilhados atrás */
.op-card:not(.is-active) {
  background: rgba(9, 13, 22, 0.82);
  background-image: linear-gradient(145deg, rgba(12, 18, 30, 0.75) 0%, rgba(7, 10, 17, 0.90) 100%);
  border-color: rgba(148, 163, 184, 0.08);
  box-shadow:
    -10px 0 28px rgba(0, 0, 0, 0.65),
    0 14px 30px rgba(0, 0, 0, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.op-card:not(.is-active) .op-title {
  color: #d1d5db;
}

/* 5. TRACK DE PROGRESSO INDIVIDUAL DE CADA CARD */
.op-card .signal-track i {
  display: block;
  height: 1px;
  background: var(--blue);
  transform-origin: left;
}

.op-card .signal-track b {
  position: absolute;
  width: 7px;
  height: 7px;
  top: -3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 0 10px #2563ff;
  transform: translateX(-50%);
}

/* 6. SINCRONIZAÇÃO E CONTRASTE DA PRIMEIRA COLUNA */
.flow-nav {
  display: flex;
  flex-direction: column;
}

.flow-cta {
  margin-top: 28px;
}
.flow-cta-mobile {
  display: none !important;
}

.flow-steps {
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.flow-steps li {
  counter-increment: steps;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.35s ease, border-color 0.35s ease, text-shadow 0.35s ease;
  position: relative;
  cursor: pointer;
}

.flow-steps li::before {
  content: '0' counter(steps);
  font-size: 9px;
  margin-right: 25px;
  color: var(--muted);
  transition: color 0.35s ease;
}

.flow-steps li.active {
  color: var(--white);
  border-bottom-color: rgba(37, 99, 255, 0.40);
  text-shadow: 0 0 12px rgba(37, 99, 255, 0.2);
}

.flow-steps li.active::before {
  color: var(--blue);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(37, 99, 255, 0.5);
}

.flow-steps li:not(.active) {
  color: rgba(177, 183, 197, 0.48);
  border-bottom-color: rgba(229, 231, 235, 0.08);
}

.flow-steps li:not(.active)::before {
  color: rgba(177, 183, 197, 0.4);
}

@media (hover: hover) and (pointer: fine) {
  .flow-steps li:not(.active):hover {
    color: rgba(248, 250, 252, 0.75);
    border-bottom-color: rgba(229, 231, 235, 0.18);
  }
}

/* 7. RESPONSIVIDADE - TABLET & TELAS MÉDIAS (max-width: 1100px) */
@media (max-width: 1100px) {
  .op-deck {
    height: 410px;
  }
  .op-card {
    width: calc(100% - 156px); /* 6 degraus de 26px */
    min-width: 360px;
    height: 400px;
  }
  .card-tab-indicator {
    width: 26px;
    font-size: 10px;
  }
  .op-card .console-top {
    padding: 18px 20px 18px 28px;
  }
}

/* 8. RESPONSIVIDADE - MOBILE (max-width: 767px) - STACKING VERTICAL DE CIMA PARA BAIXO */
@media (max-width: 767px) {
  .operation-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 18px;
  }

  .flow-nav {
    display: none !important;
  }

  .flow-steps {
    display: none !important;
  }

  .flow-cta-desktop {
    display: none !important;
  }

  .flow-cta-mobile {
    display: flex !important;
    margin-top: 24px;
    width: 100%;
    justify-content: flex-start;
  }

  .flow-cta-mobile .button {
    padding: 14px 22px;
    font-size: 12px;
    gap: 18px;
    min-height: 48px;
    width: fit-content;
  }

  .card-tab-indicator {
    display: none; /* No mobile, o topo (.console-top) atua como aba visível */
  }

  .op-deck {
    height: 400px;
    width: 100%;
  }

  .op-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-width: 0;
    height: 240px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow:
      0 -8px 24px rgba(0, 0, 0, 0.60), /* Sombra física projetada para cima sobre o card anterior */
      0 12px 28px rgba(0, 0, 0, 0.35);
  }

  .op-card.is-active {
    border-color: rgba(37, 99, 255, 0.42);
    box-shadow:
      0 -8px 24px rgba(0, 0, 0, 0.65),
      0 14px 32px rgba(0, 0, 0, 0.45),
      0 0 16px rgba(37, 99, 255, 0.06),
      inset 1px 0 0 rgba(96, 165, 250, 0.2);
  }

  .op-card .console-top {
    height: 28px;
    padding: 6px 14px;
    font-size: 9.5px;
    letter-spacing: 0.05em;
  }

  .op-card .op-content {
    padding: 16px 14px;
    min-height: 155px;
  }

  .op-card .op-title {
    font-size: 19px;
    margin-top: 8px;
  }

  .op-card .op-description {
    font-size: 11.5px;
    line-height: 1.5;
    min-height: 32px;
    margin-top: 8px;
  }

  .op-card .op-record {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 11px;
    border-top: none;
  }

  .op-card .console-bottom {
    padding: 8px 14px;
    font-size: 9px;
  }
}

/* 9. ACESSIBILIDADE - PREFERS-REDUCED-MOTION */
@media (prefers-reduced-motion: reduce) {
  .op-deck {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    perspective: none !important;
  }

  .op-card {
    position: static !important;
    width: 100% !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    border-color: rgba(55, 65, 81, 0.55) !important;
  }

  .op-card.is-active {
    border-color: rgba(37, 99, 255, 0.55) !important;
  }

  .flow-steps li {
    color: var(--white) !important;
  }
}
