/* --------------------------------------------------------------------------
   ARCANE FLOWCHART SYSTEM (Logic Visualization)
   -------------------------------------------------------------------------- */
:root {
    --flow-start: #10B981; /* Emerald */
    --flow-process: #0ea5e9; /* Sky */
    --flow-decision: #8b5cf6; /* Violet */
    --flow-end: #10B981;
    --flow-line: rgba(255, 255, 255, 0.2);
    --flow-glow: rgba(14, 165, 233, 0.5);
}

.arcane-flow-container {
    position: relative;
    padding: 40px 20px;
    background: rgba(5, 8, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Central Line */
.arcane-flow-container::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 50%;
    width: 2px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--flow-line) 10%, 
        var(--flow-line) 90%, 
        transparent 100%
    );
    transform: translateX(-50%);
    z-index: 0;
}

/* NODES */
.flow-node {
    position: relative;
    z-index: 2;
    padding: 12px 24px;
    border-radius: 8px;
    background: #090c14;
    border: 1px solid var(--flow-line);
    color: #e2e8f0;
    font-size: 0.9rem;
    text-align: center;
    max-width: 280px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.flow-node:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--flow-glow);
    border-color: var(--flow-process);
}

/* Node Types */
.node-start, .node-end {
    border-radius: 50px;
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--flow-start);
    color: var(--flow-start);
    font-weight: 600;
}

.node-process {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.3);
}

.node-decision {
    background: rgba(139, 92, 246, 0.05); /* Base tint */
    border-color: rgba(139, 92, 246, 0.5);
    transform: rotate(0deg); 
    /* CLIP PATH REMOVED FROM BASE - Default is a safe Card */
    /* clip-path: none; implicit */
    border-radius: 12px; /* Rounded corners by default */
    padding: 20px 24px;
    width: 100%; /* Flexible width by default */
    max-width: 340px; /* Max constraint */
    display: flex;
    flex-direction: column; /* Stack content by default */
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    overflow: visible; /* Ensure content isn't hidden */
}

/* DESKTOP ONLY: Upgrade to Diamond Shape */
@media (min-width: 1025px) {
    .node-decision {
        width: 320px; /* Fixed width for diamond */
        height: 320px; /* Box aspect ratio */
        clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
        border-radius: 0;
        flex-direction: column; /* Keep vertical stack */
        padding: 50px; /* More padding for diamond center */
    }
}
/* Fix text inside diamond */
.node-decision span {
    display: block;
    transform: scale(1);
}

/* BRANCHING (Visual Circuit Logic) */
.flow-branch-row {
    display: flex;
    justify-content: center;
    gap: 60px; /* Wider gap for clearer separation */
    width: 100%;
    position: relative;
    padding-top: 30px; /* Space for the "T" connector */
}

/* horizontal connector bar */
.flow-branch-row::before {
    content: '';
    position: absolute;
    top: 5px; 
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 60px); 
    max-width: 400px;
    height: 35px; /* Extended height to reach nodes */
    border-top: 2px solid var(--flow-line);
    border-left: 2px solid var(--flow-line);
    border-right: 2px solid var(--flow-line);
    border-radius: 20px 20px 0 0; 
    z-index: 1;
}

/* Central Block to hide/mask the main spine line behind the branch split */
.flow-branch-row::after {
    content: '';
    position: absolute;
    top: -20px; /* Taller mask */
    left: 50%;
    transform: translateX(-50%);
    width: 60px; /* Wider mask */
    height: 40px;
    background: #050816; 
    z-index: 1; /* Sit above the phase-group spine (z0) */
}

/* Vertical Connection from Decision Node to T-Bar */
.node-decision + .flow-branch-row {
    margin-top: 0;
    padding-top: 25px;
}
.node-decision + .flow-branch-row > .branch-center-connector {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: var(--flow-line);
    z-index: 2; /* Sit above mask */
}

.branch-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    z-index: 2;
    padding-top: 0px; /* Removed padding */
}

/* Vertical drop line for EACH column entry -> REMOVED per user request
.branch-column::before {
   Display none (Deleted)
}
*/

/* LABELS - Adjusted */
.flow-label {
    background: #050816; 
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    position: absolute;
    top: 20px; /* Moved DOWN to sit on the curve */
    z-index: 5;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.label-yes { 
    border: 1px solid var(--flow-start); 
    color: var(--flow-start);
    right: 10px; /* Close to curve */
    top: -12px;
}

.label-no { 
    border: 1px solid #ef4444; 
    color: #ef4444;
    left: 10px; 
    top: -12px;
}

/* REJECTION SPECIFIC */
.node-rejection {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-style: dashed;
}

/* END NODE - STOP */
.node-stop {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    margin-top: 10px;
    font-size: 1.2rem;
}

/* LOOP LOGIC (Re-added & Fixed) */
.flow-loop-indicator {
    position: absolute;
    right: -90px; /* Push far right outside the diamond */
    top: 50%;
    transform: translateY(-50%);
    width: 70px; /* Width of the 'u-turn' */
    height: 380px; /* EXTENDED HEIGHT to reach back up to 'Asignación de Roles' approx 3 nodes up */
    border-right: 2px dashed var(--flow-decision); /* Violet loop */
    border-top: 2px dashed var(--flow-decision);
    border-bottom: 2px dashed var(--flow-decision);
    border-radius: 0 20px 20px 0;
    opacity: 0.6;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-loop-indicator span {
    background: #050816;
    padding: 8px 4px;
    font-size: 0.65rem;
    color: var(--flow-decision);
    font-weight: bold;
    letter-spacing: 3px;
    /* Rotation handled here now */
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border-radius: 4px;
}

/* PHASE GROUPS - Refined */
.phase-group {
    background: transparent; /* Cleaner look */
    /* border: 1px dashed rgba(255, 255, 255, 0.1); -> Removed for aesthetics */
    border-radius: 12px;
    padding: 30px 20px;
    width: 100%;
    position: relative;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* FORCE CENTER */
}

/* Connect phases with a central glowing line */
.phase-group::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(180deg, 
        rgba(255,255,255,0.1) 0%, 
        var(--flow-glow) 50%, 
        rgba(255,255,255,0.1) 100%
    );
    transform: translateX(-50%);
    z-index: 0;
}

/* Add Directional Arrow to Spine */
.phase-group::after {
    content: '';
    position: absolute;
    bottom: -5px; /* Stick out slightly */
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--flow-glow); /* Down arrow */
    opacity: 0.7;
}

/* Loop Indicator Arrow - Pointing BACK to start */
.flow-loop-indicator::before {
    content: '';
    position: absolute;
    top: -6px; /* At the top of the loop line */
    left: 0; /* Align with left border (which is non-existent, so check positioning) */
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid var(--flow-decision); /* Pointing LEFT towards the node */
    transform: translateX(-100%); /* Move to visually touch the target node connection if possible */
}

/* Correction: Tweak loop arrow to point correctly relative to the box */
.flow-loop-indicator::after {
    /* Top horizontal line arrow pointing LEFT back into the flow */
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 0;
    height: 0; 
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid var(--flow-decision); /* Arrow pointing Left < */
}

/* Main Trunk Nodes - FORCE CENTER */
.phase-group > .flow-node {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px; /* Consistent spacing */
    z-index: 2; /* Above the line */
    background: #050816; /* Ensure line doesn't show through text */
    box-shadow: 0 0 15px rgba(0,0,0,0.5); /* Pop out */
}

/* Phase Label - Floating elegant tag */
.phase-label {
    position: absolute;
    top: 10px;
    left: 10px; /* Keep label to side so it doesn't cross center line */
    background: rgba(16, 185, 129, 0.1);
    color: var(--arcane-emerald);
    border: 1px solid var(--arcane-emerald);
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    z-index: 10;
}

/* Remove old connector overrides */
.phase-group + .phase-group::before {
    display: none; 
}

/* --------------------------------------------------------------------------
   RESPONSIVENESS (Mobile Flow) - ENHANCED
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Viewport adjustments */
    .flow-viewport-wrapper {
        height: auto !important; /* Remove fixed height */
        min-height: 400px;
        overflow-y: auto; /* Allow vertical scroll */
        overflow-x: hidden;
    }

    /* Container adjustments */
    .arcane-flow-container {
        max-width: 100% !important;
        padding: 20px 10px !important;
        gap: 20px !important;
    }

    /* Phase groups - more compact */
    .phase-group {
        padding: 20px 10px !important;
        margin: 5px 0 !important;
    }

    /* Phase labels - smaller */
    .phase-label {
        font-size: 0.6rem !important;
        padding: 3px 8px !important;
        top: 5px;
        left: 5px;
    }

    /* Nodes - more compact for mobile */
    .flow-node {
        max-width: 100% !important;
        width: calc(100% - 20px) !important;
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }

    /* Decision nodes - Change from Diamond to Card on Mobile for Button Space */
    .node-decision {
        width: 100% !important; /* Full width */
        max-width: 300px !important;
        padding: 20px !important;
        font-size: 0.9rem !important;
        clip-path: none !important; /* REMOVE DIAMOND SHAPE so buttons aren't cut */
        border-radius: 12px !important; /* Rounded card */
        background: rgba(139, 92, 246, 0.1) !important;
        border: 1px solid rgba(139, 92, 246, 0.5) !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Fix text inside decision card */
    .node-decision span {
        margin-bottom: 5px;
        font-weight: bold;
        color: var(--flow-decision);
    }

    /* Branch rows - stack vertically */
    .flow-branch-row {
        flex-direction: column;
        gap: 30px;
        align-items: center;
        padding-top: 15px !important; /* Reduced */
    }

    /* Hide the horizontal T-bar connector on mobile */
    .flow-branch-row::before,
    .flow-branch-row::after {
        display: none !important;
    }

    /* Branch columns - full width */
    .branch-column {
        width: 100% !important;
        padding-top: 0 !important;
    }

    /* Reset masking elements */
    .node-decision + .flow-branch-row {
        padding-top: 15px;
    }
    
    .node-decision + .flow-branch-row > .branch-center-connector {
        height: 15px !important; /* Shorter connector */
    }

    /* Labels - repositioned for vertical stack */
    .flow-label {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        margin-bottom: 10px;
        display: inline-block;
    }
    
    .label-yes, .label-no {
        left: auto !important;
        right: auto !important;
        top: auto !important;
    }

    /* Loop indicator - simplified for mobile */
    .flow-loop-indicator {
        right: 5px !important;
        width: 25px !important;
        height: 200px !important; /* Shorter */
        opacity: 0.4 !important;
    }

    .flow-loop-indicator span {
        font-size: 0.5rem !important;
        padding: 4px 2px !important;
    }

    /* Stop node - smaller */
    .node-stop {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    /* Zoom controls - larger touch targets */
    .btn-flow-control {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem;
    }

    .flow-controls {
        bottom: 10px !important;
        right: 10px !important;
        gap: 8px !important;
    }

    /* Phase spine line - thinner */
    .phase-group::before {
        width: 1px !important;
    }

    /* Central container line */
    .arcane-flow-container::before {
        width: 1px !important;
    }

    /* Nested branches (Approver) - ensure they stack too */
    .flow-branch-row .flow-branch-row {
        gap: 20px;
        margin-top: 10px;
    }
}

/* --------------------------------------------------------------------------
   ZOOM CONTROLS 
   -------------------------------------------------------------------------- */
.btn-flow-control {
    background: rgba(5, 8, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-flow-control:hover {
    background: var(--flow-process);
    border-color: var(--flow-process);
    transform: scale(1.1);
}

.flow-viewport-wrapper {
    /* Blueprint grid background effect */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --------------------------------------------------------------------------
   INTERACTIVE STATES ("Living Flowchart")
   -------------------------------------------------------------------------- */

/* Default State: Locked/Hidden Future */
.phase-locked {
    opacity: 0.1;
    filter: grayscale(100%) blur(2px);
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active State: The current focus */
.phase-active {
    opacity: 1;
    filter: none;
    pointer-events: all;
    transform: scale(1);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.1); /* Subtle glow */
}

/* Completed State: Done */
.phase-completed {
    opacity: 0.5;
    filter: grayscale(50%);
}

/* Connection Line Animation */
.phase-group::before {
    /* Override static gradient with variable for animation */
    height: 0%; /* Start empty */
    top: 0;
    transition: height 1s ease-in-out;
}

.phase-active::before,
.phase-completed::before {
    height: 100%; /* Fill line when active/done */
}

/* Pulse Animation for Decision Nodes */
@keyframes pulse-decision {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.node-decision.waiting-input {
    animation: pulse-decision 2s infinite;
    cursor: pointer;
    border-color: var(--flow-decision);
    background: rgba(139, 92, 246, 0.2);
}

/* Hover effects for interactive decisions */
.node-decision.waiting-input:hover {
    transform: scale(1.1) rotate(0deg); /* Maintain text rotation if needed */
    z-index: 10;
}

/* Success/Fail Path Highlighting */
.path-highlight-success {
    opacity: 1 !important;
    filter: drop-shadow(0 0 8px var(--flow-start));
}

.path-dimmed {
    opacity: 0.05 !important;
}

/* --------------------------------------------------------------------------
   DECISION BUTTONS (Interactive System)
   -------------------------------------------------------------------------- */

.decision-buttons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-decision {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.btn-decision ion-icon {
    font-size: 1.3rem;
}

.btn-yes {
    color: var(--flow-start);
    border-color: var(--flow-start);
}

.btn-yes:hover {
    background: var(--flow-start);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-no {
    color: var(--flow-rejection);
    border-color: var(--flow-rejection);
}

.btn-no:hover {
    background: var(--flow-rejection);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Mobile: Larger touch targets - INCREASED RANGE (Tablets + Phones) */
@media (max-width: 1024px) {
    /* Viewport adjustments */
    .flow-viewport-wrapper {
        height: auto !important; /* Remove fixed height */
        min-height: 400px;
        overflow-y: auto; /* Allow vertical scroll */
        overflow-x: hidden;
    }

    /* Container adjustments */
    .arcane-flow-container {
        max-width: 100% !important;
        padding: 20px 10px !important;
        gap: 20px !important;
    }

    /* Phase groups - more compact */
    .phase-group {
        padding: 20px 10px !important;
        margin: 5px 0 !important;
    }

    /* Phase labels - smaller */
    .phase-label {
        font-size: 0.6rem !important;
        padding: 3px 8px !important;
        top: 5px;
        left: 5px;
    }

    /* Nodes - more compact for mobile */
    .flow-node {
        max-width: 100% !important;
        width: calc(100% - 20px) !important;
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }

    /* Decision nodes - Change from Diamond to Card on Mobile for Button Space */
    .node-decision {
        width: 100% !important; /* Full width */
        max-width: 320px !important;
        padding: 20px !important;
        font-size: 0.9rem !important;
        clip-path: none !important; /* REMOVE DIAMOND SHAPE so buttons aren't cut */
        -webkit-clip-path: none !important; /* Safari/Chrome fix */
        border-radius: 12px !important; /* Rounded card */
        background: rgba(139, 92, 246, 0.1) !important;
        border: 1px solid rgba(139, 92, 246, 0.5) !important;
        display: flex;
        flex-direction: column;
        gap: 15px; /* More space */
        overflow: visible !important; /* Prevent cutting */
    }

    /* Fix text inside decision card */
    .node-decision span {
        margin-bottom: 5px;
        font-weight: bold;
        color: var(--flow-decision);
    }
    
    .decision-buttons {
        flex-direction: row; /* Horizontal layout requested */
        width: 100%;
        gap: 10px;
        justify-content: space-between;
    }
    
    .btn-decision {
        flex: 1; /* Share space equally */
        width: auto;
        padding: 12px 10px;
        font-size: 0.9rem;
        justify-content: center;
        white-space: nowrap;
    }
    
    .btn-decision ion-icon {
        font-size: 1.2rem;
    }

    /* Branch rows - stack vertically */
    .flow-branch-row {
        flex-direction: column;
        gap: 30px;
        align-items: center;
        padding-top: 15px !important; /* Reduced */
    }

    /* Hide the horizontal T-bar connector on mobile */
    .flow-branch-row::before,
    .flow-branch-row::after {
        display: none !important;
    }

    /* Branch columns - full width */
    .branch-column {
        width: 100% !important;
        padding-top: 0 !important;
    }

    /* Reset masking elements */
    .node-decision + .flow-branch-row {
        padding-top: 15px;
    }
    
    .node-decision + .flow-branch-row > .branch-center-connector {
        height: 15px !important; /* Shorter connector */
    }

    /* Labels - repositioned for vertical stack */
    .flow-label {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        margin-bottom: 10px;
        display: inline-block;
    }
    
    .label-yes, .label-no {
        left: auto !important;
        right: auto !important;
        top: auto !important;
    }

    /* Loop indicator - simplified for mobile */
    .flow-loop-indicator {
        right: 5px !important;
        width: 25px !important;
        height: 200px !important; /* Shorter */
        opacity: 0.4 !important;
    }

    .flow-loop-indicator span {
        font-size: 0.5rem !important;
        padding: 4px 2px !important;
    }

    /* Stop node - smaller */
    .node-stop {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    /* Zoom controls - larger touch targets */
    .btn-flow-control {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem;
    }

    .flow-controls {
        bottom: 10px !important;
        right: 10px !important;
        gap: 8px !important;
    }

    /* Phase spine line - thinner */
    .phase-group::before {
        width: 1px !important;
    }

    /* Central container line */
    .arcane-flow-container::before {
        width: 1px !important;
    }

    /* Nested branches (Approver) - ensure they stack too */
    .flow-branch-row .flow-branch-row {
        gap: 20px;
        margin-top: 10px;
    }
}

/* --------------------------------------------------------------------------
   VISUAL FEEDBACK ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes shakeAnomaly {
    0% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

.shake-anomaly {
    animation: shakeAnomaly 0.5s ease;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
}

.visual-rejection {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3) !important;
}

/* --------------------------------------------------------------------------
   CRITICAL MOBILE OVERRIDES (Specificity Hammer)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    /* FORCE card shape on mobile/tablet overrides EVERYTHING else */
    div.node-decision {
        width: 100% !important;
        max-width: 340px !important;
        clip-path: none !important;
        -webkit-clip-path: none !important;
        border-radius: 12px !important;
        background: rgba(139, 92, 246, 0.15) !important;
        padding: 24px !important;
        aspect-ratio: auto !important;
    }

    /* Force buttons horizontal */
    div.decision-buttons {
        flex-direction: row !important;
        gap: 15px !important;
    }
}

/* --------------------------------------------------------------------------
   ENHANCED NEXT BUTTON (Biopunk Style)
   -------------------------------------------------------------------------- */
.btn-flow-next {
    margin-top: 25px;
    background: rgba(5, 8, 22, 0.9) !important;
    border: 1px solid var(--flow-process) !important;
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
    animation: pulseGlow 3s infinite;
    position: relative;
    z-index: 10;
}

.btn-flow-next:hover {
    background: var(--flow-process) !important;
    color: #000 !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.6);
}

.btn-flow-next ion-icon {
    font-size: 1.2rem;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(14, 165, 233, 0.2); }
    50% { box-shadow: 0 0 25px rgba(14, 165, 233, 0.5); }
    100% { box-shadow: 0 0 15px rgba(14, 165, 233, 0.2); }
}
