/* SVG Interactions */
.svg-interactive-box {
    height: 350px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: 0.4s;
    width: 100%;
}

.svg-interactive-box:hover {
    border-color: rgba(255, 111, 15, 0.3);
    box-shadow: 0 15px 40px rgba(255, 111, 15, 0.1);
}

.interaction-hint {
    position: absolute;
    bottom: 20px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 1;
    transition: 0.3s;
    pointer-events: none;
    z-index: 10;
}

.svg-interactive-box:hover .interaction-hint {
    opacity: 0;
    transform: translateY(20px);
}

/* --- 1. INFOGRÁFICO DE FLUXO --- */
.infographic-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 40px auto 0;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    cursor: pointer;
    width: 150px;
}

.step-icon-wrapper {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-300);
    transition: 0.4s;
    margin-bottom: 15px;
    font-size: 1.8rem;
    color: var(--gray-500);
}

.step-item.active .step-icon-wrapper,
.step-item:hover .step-icon-wrapper {
    border-color: var(--primary);
    background: #fff5ee;
    color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 111, 15, 0.2);
}

.connector-svg {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1;
}

.line-bg {
    stroke: var(--gray-300);
    stroke-width: 4;
}

.line-fill {
    stroke: var(--primary);
    stroke-width: 4;
    stroke-dasharray: 1000;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.8s ease;
}

@media (max-width: 768px) {
    .infographic-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
        padding-left: 50px;
    }

    .connector-svg {
        width: 4px;
        height: 80%;
        left: 88px;
        top: 20px;
    }

    .step-item {
        flex-direction: row;
        gap: 20px;
        width: 100%;
        text-align: left;
    }
}

/* --- 2. MÁQUINA DE LIQUIDEZ --- */
.conveyor-belt {
    width: 80%;
    height: 10px;
    background: var(--gray-300);
    border-radius: 5px;
    position: absolute;
    bottom: 30%;
    overflow: hidden;
}

.belt-lines {
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.1) 10px, rgba(0, 0, 0, 0.1) 20px);
    transition: transform 2s linear;
}

.svg-interactive-box:hover .belt-lines {
    transform: translateX(-50%);
}

.machine-core {
    width: 120px;
    height: 150px;
    background: var(--secondary);
    position: absolute;
    bottom: 30%;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: 0.3s;
}

.svg-interactive-box:hover .machine-core {
    background: var(--primary);
    box-shadow: 0 0 30px rgba(255, 111, 15, 0.4);
}

.machine-logo {
    color: white;
    font-size: 2rem;
}

.title-paper {
    position: absolute;
    bottom: 35%;
    left: 10%;
    width: 60px;
    height: 80px;
    background: white;
    border: 2px dashed var(--gray-500);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-weight: bold;
    font-size: 0.8rem;
    transition: all 1s ease-in;
    z-index: 4;
}

.cash-stack {
    position: absolute;
    bottom: 35%;
    right: 40%;
    width: 60px;
    height: 40px;
    background: #10b981;
    border-radius: 4px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 1s ease-out;
    z-index: 4;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.svg-interactive-box:hover .title-paper {
    left: 45%;
    transform: scale(0.2);
    opacity: 0;
}

.svg-interactive-box:hover .cash-stack {
    right: 15%;
    opacity: 1;
    transform: scale(1.2);
    transition-delay: 0.5s;
}

/* --- 3. GESTÃO DE CONTAS (PASTA) --- */
.chaos-doc {
    position: absolute;
    width: 40px;
    height: 50px;
    background: white;
    border: 2px solid #ef4444;
    /* danger */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.2rem;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.doc-1 {
    top: 15%;
    left: 10%;
    transform: rotate(-15deg);
}

.doc-2 {
    top: 60%;
    left: 20%;
    transform: rotate(25deg);
}

.doc-3 {
    top: 20%;
    right: 15%;
    transform: rotate(10deg);
}

.doc-4 {
    top: 65%;
    right: 25%;
    transform: rotate(-30deg);
}

.folder-organizer {
    position: absolute;
    color: var(--primary);
    font-size: 5rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.6s 0.2s;
    z-index: 2;
}

.svg-interactive-box:hover .chaos-doc {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    border-color: var(--primary);
    color: var(--primary);
}

.svg-interactive-box:hover .folder-organizer {
    opacity: 1;
    transform: scale(1);
}

.svg-interactive-box:hover .folder-bg-glow {
    width: 150px;
    height: 150px;
    background: rgba(255, 111, 15, 0.1);
    position: absolute;
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.2;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* --- 4. MALHARISTA (CICLO) --- */
.cycle-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 4px dashed var(--gray-300);
    position: relative;
    transition: 1s ease;
}

.cycle-item {
    position: absolute;
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-size: 1.5rem;
    color: var(--gray-500);
    transition: 0.5s;
}

.item-sell {
    top: -35px;
    left: 90px;
}

.item-pay {
    bottom: 40px;
    right: -25px;
}

.item-produce {
    bottom: 40px;
    left: -25px;
}

.center-speedcred {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: 0.5s 0.2s;
    z-index: 10;
}

.svg-interactive-box:hover .cycle-container {
    border-color: rgba(255, 111, 15, 0.3);
    border-style: solid;
    transform: rotate(180deg);
}

.svg-interactive-box:hover .cycle-item {
    color: var(--primary);
    transform: rotate(-180deg);
    border: 2px solid var(--primary);
}

.svg-interactive-box:hover .center-speedcred {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 20px rgba(255, 111, 15, 0.5);
}

/* --- 5. EMPRESÁRIO GERAL (CRESCIMENTO) --- */
.growth-chart {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    height: 150px;
}

.growth-bar {
    width: 40px;
    background: var(--gray-300);
    border-radius: 5px 5px 0 0;
    transition: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    justify-content: center;
}

.growth-bar-icon {
    position: absolute;
    top: -30px;
    color: var(--gray-500);
    font-size: 1.2rem;
    opacity: 0;
    transition: 0.4s;
}

.b1 {
    height: 40px;
}

.b2 {
    height: 60px;
}

.b3 {
    height: 50px;
    background: #ef4444;
}

.b4 {
    height: 55px;
}

.svg-interactive-box:hover .growth-chart .b3 {
    height: 100px;
    background: var(--primary);
}

.svg-interactive-box:hover .growth-chart .b4 {
    height: 140px;
    background: var(--primary-dark);
}

.svg-interactive-box:hover .growth-bar {
    background: var(--primary);
}

.svg-interactive-box:hover .growth-bar-icon {
    opacity: 1;
    color: var(--primary-dark);
}

/* ==================================================
   APPLE STYLE SCROLL REVEALS
   When Intersection Observer adds '.visible'
   these auto-play once smoothly!
   ================================================== */

/* 1. MÁQUINA DE LIQUIDEZ (NF-e -> R$) */
.svg-interactive-box.visible .belt-lines {
    animation: autoProcessBelt 3s linear;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .title-paper {
    animation: autoProcessTitle 3s ease-in-out;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .machine-core {
    animation: autoProcessGlow 3s ease-in-out;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .cash-stack {
    animation: autoProcessCash 3s ease-in-out;
    animation-delay: 0.5s;
}

@keyframes autoProcessBelt {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes autoProcessTitle {
    0% {
        left: 10%;
        transform: scale(1);
        opacity: 1;
    }

    40%,
    100% {
        left: 45%;
        transform: scale(0.2);
        opacity: 0;
    }
}

@keyframes autoProcessGlow {

    0%,
    100% {
        background: var(--secondary);
        box-shadow: none;
    }

    30%,
    80% {
        background: var(--primary);
        box-shadow: 0 0 30px rgba(255, 111, 15, 0.4);
    }
}

@keyframes autoProcessCash {

    0%,
    50% {
        right: 40%;
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        right: 15%;
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 2. GESTÃO DE CONTAS (PASTA) */
.svg-interactive-box.visible .folder-organizer {
    animation: autoFolder 3s ease-in-out;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .folder-bg-glow {
    animation: pulse-glow 2s infinite;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .chaos-doc {
    animation: autoChaos 3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-delay: 0.5s;
}

@keyframes autoFolder {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    30%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes autoChaos {
    0% {
        top: initial;
        left: initial;
        transform: rotate(0deg);
        opacity: 1;
        border-color: #ef4444;
        color: #ef4444;
    }

    30%,
    100% {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
        border-color: var(--primary);
        color: var(--primary);
    }
}

/* 3. MALHARISTA (CICLO) */
.svg-interactive-box.visible .cycle-container {
    animation: autoCycle 3s ease-in-out;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .cycle-item {
    animation: autoCycleItem 3s ease-in-out;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .center-speedcred {
    animation: autoCenterSpeed 3s ease-in-out;
    animation-delay: 0.5s;
}

@keyframes autoCycle {
    0% {
        border-color: var(--gray-300);
        transform: rotate(0deg);
    }

    30%,
    100% {
        border-color: rgba(255, 111, 15, 0.3);
        border-style: solid;
        transform: rotate(180deg);
    }
}

@keyframes autoCycleItem {
    0% {
        color: var(--gray-500);
        transform: rotate(0deg);
        border: none;
    }

    30%,
    100% {
        color: var(--primary);
        transform: rotate(-180deg);
        border: 2px solid var(--primary);
    }
}

@keyframes autoCenterSpeed {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
        box-shadow: none;
    }

    30%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 20px rgba(255, 111, 15, 0.5);
    }
}

/* 4. EMPRESÁRIO GERAL (CRESCIMENTO) */
.svg-interactive-box.visible .growth-chart .b3 {
    animation: autoGrowthB3 3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .growth-chart .b4 {
    animation: autoGrowthB4 3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .growth-bar {
    animation: autoGbarBg 3s ease;
    animation-delay: 0.5s;
}

.svg-interactive-box.visible .growth-bar-icon {
    animation: autoGbarIcon 3s ease;
    animation-delay: 0.5s;
}

@keyframes autoGrowthB3 {
    0% {
        height: 50px;
        background: #ef4444;
    }

    30%,
    100% {
        height: 100px;
        background: var(--primary);
    }
}

@keyframes autoGrowthB4 {
    0% {
        height: 55px;
        background: var(--gray-300);
    }

    30%,
    100% {
        height: 140px;
        background: var(--primary-dark);
    }
}

@keyframes autoGbarBg {
    0% {
        background: var(--gray-300);
    }

    30%,
    100% {
        background: var(--primary);
    }
}

@keyframes autoGbarIcon {
    0% {
        opacity: 0;
        color: var(--gray-500);
    }

    30%,
    100% {
        opacity: 1;
        color: var(--primary-dark);
    }
}