/* ============================================================
   SHGT - Blocos 3D + Cabos - Secao "Como Funciona"
   Arquivo: enhance/steps-3d.css
   ============================================================ */

/* Grid horizontal */

.fx-steps-3d {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 28px;
  align-items: start;
  position: relative;
  max-width: none;
  flex-direction: unset;
}

.fx-steps-3d::before {
  display: none !important;
}

.fx-steps-3d .step {
  display: block;
  padding: 0;
  gap: unset;
  align-items: unset;
  position: relative;
  z-index: 1;
}

/* Float wrapper */

.fx-step-float {
  will-change: transform;
  animation-name: fx-card-float;
  animation-duration: var(--float-dur, 5s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: var(--float-delay, 0s);
  animation-fill-mode: both;
}

@keyframes fx-card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* Bloco 3D com faces reais */

.fx-step-3d-scene {
  perspective: 900px;
  transform-style: preserve-3d;
  position: relative;
}

.fx-step-3d-scene::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 5%;
  width: 90%;
  height: 24px;
  background: radial-gradient(ellipse, rgba(30, 10, 78, 0.40), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.fx-step-3d-box {
  transform-style: preserve-3d;
  width: 100%;
  position: relative;
  transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -4deg));
  transition: transform 0.4s ease;
  cursor: default;
}

.fx-step-3d-box:hover {
  transform: rotateX(1deg) rotateY(0deg);
}

.fx-step-face--front {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  border: 2px solid rgba(192, 96, 240, 0.55);
  background: #1E0A4E;
}

.fx-step-face--right {
  position: absolute;
  top: 4px;
  right: -27px;
  width: 28px;
  height: calc(100% - 8px);
  background: linear-gradient(180deg, #3B1080, #1E0A4E);
  transform-origin: left center;
  transform: rotateY(90deg);
  border-radius: 0 8px 8px 0;
  pointer-events: none;
}

.fx-step-face--bottom {
  position: absolute;
  bottom: -27px;
  left: 4px;
  width: calc(100% - 8px);
  height: 28px;
  background: linear-gradient(90deg, #2A0A5C, #1A0640);
  transform-origin: top center;
  transform: rotateX(-90deg);
  border-radius: 0 0 8px 8px;
  pointer-events: none;
}

/* Corpo branco */

.fx-step-body {
  padding: 30px 26px 24px;
  flex: 1;
  background: #FFFFFF;
  border-radius: 16px 16px 0 0;
}

.fx-steps-3d .step-num {
  /* Reset completo do badge circular */
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
  align-items: unset;
  justify-content: unset;
  flex-shrink: 0;
  position: relative;
  z-index: 2;

  /* Tipografia — número grande como elemento gráfico */
  font-size: 72px;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.03em;
  color: var(--violet-500);
  margin-top: -6px;
  margin-left: -4px;
  margin-bottom: 16px;

  /* Extrusão 3D: 9 camadas de sombra diagonal, do brilho ao escuro */
  text-shadow:
    1px 1px 0 #8B30F0,
    2px 2px 0 #7C3AED,
    3px 3px 0 #6D28D9,
    4px 4px 0 #5E20C6,
    5px 5px 0 #4F18B3,
    6px 6px 0 #40129F,
    7px 7px 0 #320D8C,
    8px 8px 0 #240878,
    9px 9px 0 #180560,
    10px 10px 22px rgba(0, 0, 0, 0.45);
}

.fx-steps-3d .step-content {
  margin-top: 0;
}

.fx-steps-3d .step-content h3 {
  color: var(--ink, #231435);
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 14px;
  line-height: 1.45;
}

.fx-steps-3d .step-content p {
  color: var(--ink-soft, #4F4264);
  font-size: 12.5px;
  line-height: 1.78;
  margin-bottom: 0;
}

/* Terminal de logs */

.fx-step-logs {
  background: rgba(0, 0, 0, 0.72);
  border-top: 1px solid rgba(192, 96, 240, 0.22);
  padding: 13px 18px 16px;
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 10.5px;
  line-height: 1.95;
  min-height: 80px;
}

.fx-log {
  display: block;
  color: rgba(192, 96, 240, 0.84);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-log--ok { color: rgba(74, 222, 128, 0.92); }
.fx-log--warn { color: rgba(251, 191, 36, 0.92); }
.fx-log--pending { color: rgba(255, 255, 255, 0.40); }

.fx-log--pending::after {
  content: '>';
  animation: fx-cursor-blink 1s step-end infinite;
}

@keyframes fx-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* SVG dos cabos */

.fx-cables {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.fx-cables path,
.fx-cables circle {
  pointer-events: none;
}

.fx-cable-flow {
  stroke-dasharray: 7 18;
  animation: fx-cable-flow 1.8s linear infinite;
}

@keyframes fx-cable-flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -50; }
}

/* Mobile */

@media (max-width: 960px) {
  .fx-steps-3d {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
    gap: 28px 0;
  }

  .fx-cables { display: none; }
  .fx-step-float { animation: none; }
  .fx-step-3d-box { transform: rotateX(4deg) rotateY(-2deg); }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .fx-step-float { animation: none !important; }
  .fx-step-3d-box { transform: none !important; transition: none !important; }
  .fx-cable-flow { animation: none !important; }
  .fx-log--pending::after { animation: none !important; }
}
