/*
 * Custom CSS for the "How it Works" Section - FINAL REVISION with NEW BACKGROUND
 * - Individual cards now have a soft gray background (#f8f8f8).
 * - Hover transitions the card to pure white (#ffffff) for contrast.
*/

/* --- Equal Height Fix: Apply Flexbox to the container row and add gap --- */
.auto-container .row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch; 
    
    /* Reintroduce horizontal gutter spacing (standard Bootstrap) */
    margin-left: -15px;
    margin-right: -15px;
    
    /* Add vertical gap between rows */
    row-gap: 30px; 
}

/* Apply column padding (gutter) to compensate for the row's negative margin */
.auto-container .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* --- Process Step Styling (New Background: #f8f8f8) --- */
.process-step {
    padding: 40px 30px;
    box-shadow: 0 0 20px rgba(31, 45, 61, 0.1); 
    margin-bottom: 0 !important; 
    border-radius: 8px; 
    position: relative;
    z-index: 1;
    overflow: hidden; 
    text-align: center; 
    
    /* Default border */
    border: 2px solid #e0e0e0; 
    
    /* UPDATED: New Background Color for the card */
    background-color: #f8f8f8; 
    
    height: 100%;
    transition: all 0.3s ease-in-out;
}

/* --- Icon/Count Styling (Bolder Primary Accent) --- */
.process-step .icon {
    width: 80px; 
    height: 80px; 
    /* Primary Accent Color */
    background: #fa5754; 
    color: #ffffff;
    line-height: 80px;
    text-align: center;
    border-radius: 50%;
    margin: 0 auto 25px; 
    font-size: 32px; 
    font-weight: 700;
    position: relative;
    transition: all 0.3s ease-in-out;
}

.process-step .icon .count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    line-height: 80px;
    animation: none !important;
    visibility: visible !important;
}


/* --- Content Styling --- */
.process-step h5 {
    font-weight: 700; 
    margin-bottom: 10px;
    color: #333;
    transition: all 0.3s ease-in-out;
}

.process-step p {
    margin-bottom: 0;
    font-size: 14px;
    color: #666;
}


/* --- Hover Effect (Clean Lift + Border) --- */
.process-step:hover {
    transform: translateY(-5px); 
    box-shadow: 0 15px 45px rgba(31, 45, 61, 0.25); 
    
    /* Card changes to pure white on hover for high contrast */
    background-color: #ffffff; 
    
    /* Bold Border on Hover */
    border: 2px solid var(--primary-color, #fa5754);
}

.process-step:hover .icon {
    background: #d34b48; 
}

.process-step:hover h5 {
    color: #fa5754; 
}


/* --- Connecting Line (Fixed) --- */
@media (min-width: 992px) {
    /* Ensure vertical spacing is handled by row-gap on desktop */
    .row > [class*="col-"] {
        margin-bottom: 0 !important;
    }

    /* Apply line to the 1st and 2nd box of every row (3n+1 and 3n+2) */
    .row > .col-lg-4:nth-child(3n+1) .process-step::after,
    .row > .col-lg-4:nth-child(3n+2) .process-step::after {
        content: '';
        position: absolute;
        top: 70px; 
        right: 0; 
        width: 60px; 
        transform: translateX(100%); 
        height: 2px;
        background-color: #f0f0f0; 
        z-index: -1;
    }
    
    /* Ensure the line is hidden on the 3rd box of every row (3n) */
    .row > .col-lg-4:nth-child(3n) .process-step::after {
        content: none;
    }
}

/* Tablet/Mobile: Vertical Line connector */
@media (max-width: 991.98px) {
    /* Reintroduce margin for better vertical flow on stack */
    .row > [class*="col-"] {
        margin-bottom: 0px; 
    }
    
    /* Vertical line connector - applied to all steps except the last one */
    .row > [class*="col-"]:not(:last-child) .process-step::before {
        content: '';
        position: absolute;
        left: 50%; 
        bottom: -30px; 
        transform: translateX(-50%); 
        width: 2px;
        height: 30px; 
        background-color: #f0f0f0;
        z-index: -1;
    }
}