/* Referral Section */
.referral-section {
    padding: 60px 0;
    background-color: #fdfdfd;
}

/* Header Card */
.referral-header-card {
    background: linear-gradient(135deg, #fdfbf7 0%, #f4eee5 100%);
    border-radius: 24px;
    padding: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.referral-content {
    max-width: 60%;
    z-index: 2;
}

.ref-badge {
    background-color: #fff;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: inline-block;
    margin-bottom: 20px;
}

.referral-header-card h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.referral-header-card p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 90%;
}

.ref-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary {
    background-color: #558b2f;
    /* Greenish/Natural tone for "Join" or keep Purple? Reference had Green. Let's stick to Brand Purple for consistency or Green for "Money"? User said "Match with header.. give professional look". I will use Brand Purple. */
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-outline {
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover,
.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Image Placeholder */
.referral-image {
    font-size: 180px;
    color: rgba(126, 75, 187, 0.1);
    /* Primary color faded */
    position: absolute;
    right: 50px;
    bottom: -20px;
    z-index: 1;
}

/* Process Steps */
.referral-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 50px 0;
    gap: 20px;
}

.step-item {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.step-icon {
    font-size: 28px;
    color: #b59f84;
    /* Goldish/Earth tone from reference, or purple? Let's use Gold/Bronze for Money vibe */
    color: var(--primary-color);
    margin-bottom: 15px;
}

.step-item h4 {
    font-size: 14px;
    color: #444;
    font-weight: 600;
    line-height: 1.4;
}

.step-arrow {
    color: #ddd;
    font-size: 20px;
}

/* Features Grid */
.referral-features {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

/* Wrapper for small cards to preserve grid on desktop */
.small-features-row {
    display: contents;
}

/* Wrapper for small cards to preserve grid on desktop */
.small-features-row {
    display: contents;
}

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.04);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Large Feature Specifics */
.large-feature {
    background: linear-gradient(135deg, #eecda3 0%, #dbb688 100%);
    /* Gold gradient */
    color: #4a3b2a;
    align-items: flex-start;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.large-feature .feature-bg-icon {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 120px;
    color: rgba(255, 255, 255, 0.2);
}

.large-feature h3 {
    font-size: 20px;
    margin: 15px 0;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.feature-list {
    list-style: none;
    margin-top: 10px;
}

.feature-list li {
    font-size: 13px;
    margin-bottom: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.feature-icon-circle.gold {
    color: #dbb688;
}

.feature-icon-circle.blue {
    color: #4facfe;
}

.feature-icon-circle.orange {
    color: #f093fb;
}

.feature-icon-circle.green {
    color: #43e97b;
}

.referral-features h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.referral-features p {
    font-size: 13px;
    color: #777;
}

/* Bottom CTA */
/* Bottom CTA Card */
.referral-bottom-cta {
    background: linear-gradient(135deg, #fdfbf7 0%, #f4eee5 100%);
    /* Match Header Card */
    padding: 60px 40px;
    border-radius: 24px;
    /* Rounded card */
    text-align: center;
    color: #333;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.cta-content h3 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #333;
    font-weight: 700;
}

.btn-cta {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    display: inline-block;
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(126, 75, 187, 0.3);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 75, 187, 0.4);
    background-color: #6a3da0;
    color: white;
}

.cta-content h3 {
    font-size: 28px;
    margin-bottom: 25px;
}

.btn-cta {
    background-color: #8dbf68;
    /* Light Green CTA */
    background-color: var(--primary-color);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    display: inline-block;
    margin-bottom: 30px;
    transition: transform 0.2s;
}

.btn-cta:hover {
    transform: scale(1.05);
    background-color: white;
    color: var(--primary-color);
}

.cta-footer {
    font-size: 12px;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 991px) {
    .referral-header-card {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }

    .referral-content {
        max-width: 100%;
    }

    .referral-image {
        position: static;
        margin-top: 30px;
        font-size: 100px;
    }

    .ref-buttons {
        justify-content: center;
    }

    .referral-steps {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 20px;
        /* Space for touch scroll */
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .referral-steps::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .step-item {
        min-width: 130px;
        width: 130px;
        flex-shrink: 0;
        padding: 15px 10px;
        min-height: 120px;
    }

    .step-item h4 {
        font-size: 13px;
    }

    .step-icon {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .step-arrow {
        display: block;
        /* Show arrows */
        min-width: 20px;
        flex-shrink: 0;
        color: #ddd;
    }

    .referral-bottom-cta {
        padding: 40px 20px;
    }

    .referral-features {
        grid-template-columns: 1fr 1fr;
    }

    .large-feature {
        grid-column: span 2;
    }
}

@media (max-width: 576px) {
    .referral-header-card h2 {
        font-size: 24px;
    }

    /* Keep horizontal scroll for process steps */

    /* Features Mobile Layout */
    .referral-features {
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow: visible;
        /* Disable scroll on parent */
        grid-template-columns: none;
        padding-bottom: 0;
    }

    .large-feature {
        width: 100%;
        min-width: 0;
        margin-bottom: 5px;
    }

    .small-features-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-left: -5px;
        /* Slight alignment fix */
        padding-left: 5px;
    }

    .small-features-row::-webkit-scrollbar {
        display: none;
    }

    /* Smaller Feature Cards for Mobile */
    .feature-card {
        min-width: 140px;
        /* Reduced size */
        padding: 20px 15px;
        border-radius: 16px;
        flex-shrink: 0;
    }

    .feature-card .feature-icon-circle {
        width: 45px;
        height: 45px;
        font-size: 20px;
        margin-bottom: 10px;
    }

    .feature-card h4 {
        font-size: 13px;
        margin-bottom: 4px;
        line-height: 1.3;
    }

    .feature-card p {
        font-size: 11px;
    }

    .referral-bottom-cta {
        border-radius: 30px 30px 0 0;
        padding: 40px 15px 20px;
    }

    .cta-content h3 {
        font-size: 22px;
    }
}