* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.referral_info {
    color: var(--color-font);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


/* Hero Section */
.hero {
    /* background: linear-gradient(135deg, rgba(22, 112, 133, 0.15) 0%, rgba(28, 167, 197, 0.15) 100%); */
    border-radius: 25px;
    /* border: 2px solid var(--color-primary); */
    box-shadow: 0 10px 40px rgba(22, 112, 133, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 0;
    min-height: 360px;
    /* background-image: url(../../images/referral/top_banner.webp); */
}

.hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url(../../images/referral/top_banner.webp);
    left: 0;
    top: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero_box {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 360px;
    background: rgba(0, 0, 0, 0.089);
    padding: 60px 30px 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    backdrop-filter: blur(1.5px); 
    -webkit-backdrop-filter: blur(1.5px);
}

.hero h1 {
    font-size: 3.5em;
    margin: 0px 0px 20px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-contrast);
}

.hero p {
    font-size: 1.3em;
    color: var(--color-contrast);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.cta_buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 60px;
}

.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn_primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
    color: var(--color-contrast);
    box-shadow: 0 5px 20px var(--color-primary);
}

.btn_primary:hover {
    transform: translateY(-3px);
    color: var(--color-contrast);
    box-shadow: 0 7px 20px var(--color-primary);
}


/* Why Section */
.why_section {
    margin-top: 60px;
    margin-bottom: 80px;
}

.section_title {
    font-size: 2.5em;
    margin-bottom: 50px;
    text-align: center;
    font-weight: 700;
}

.why_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.why_card {
    background: var(--color-window);
    border: 2px solid var(--color-element);
    border-radius: 18px;
    padding: 30px 45px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.why_card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(22, 112, 133, 0.08) 0%, rgba(28, 167, 197, 0.08) 100%);
    transition: top 0.35s ease;
}

.why_card:hover {
    border-color: var(--color-primary-font);
    box-shadow: 0 5px 10px rgba(22, 112, 133, 0.2);
}


.why_card .icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: end;
    justify-content: center;
    transition: transform 0.35s ease;
    position: relative;
    z-index: 2;
    margin: 0 auto 20px;
}

.why_card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.why_card .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.why_card h3 {
    margin-top: 20px;
    font-size: 20px;
    line-height: 24px;
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.why_card p {
    color: var(--color-secondary);
    line-height: 1.7;
    position: relative;
    z-index: 2;
}

/* Tiers Section */
.tiers_section {
    margin-bottom: 80px;
}

.tiers_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.tier_card {
    background: linear-gradient(135deg, var(--color-window) 0%, rgba(28, 167, 197, 0.05) 100%);
    border: 2px solid var(--color-element);
    border-radius: 18px;
    padding: 20px 35px;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
/* 
.tier_card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
} */

.tier_card::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(22, 112, 133, 0.1) 50%, transparent 100%);
}

.tier_card:hover {
    border-color: var(--color-primary-font);
    box-shadow: 0 5px 20px rgba(22, 112, 133, 0.25);
}



.tier_badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 20px;
}

.tier_title {
    font-size: 22px;
    line-height: 26px;
    font-weight: 700;
    /* margin-bottom: 10px; */
}

.tier_range {
    color: var(--color-secondary);
    /* margin-bottom: 20px; */
    margin-top: 10px;
    font-size: 0.95em;
}

.tier_percentage {
    font-size: 32px;
    line-height: 32px;
    font-weight: 800;
    color: var(--green);
    margin: 14px 0 0px;
    font-family: 'Courier New', monospace;
}

.tier_benefits {
    list-style: none;
    margin: 6px 0 0px;
}

.tier_benefits li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--color-secondary);
}

.tier_benefits li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: bold;
    font-size: 1.2em;
}

/* Stats Section */
.stats_section {
    background: linear-gradient(135deg, rgba(22, 112, 133, 0.1) 0%, rgba(28, 167, 197, 0.1) 100%);
    border: 1px solid var(--color-element);
    border-radius: 15px;
    padding: 60px 40px;
    margin-bottom: 80px;
    text-align: center;
}

.stats_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.stat {
    text-align: center;
}

.stat_number {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1.1;
    word-break: break-word;
}

.stat_label {
    color: var(--color-secondary);
    font-size: 0.95em;
}

/* How Section */
.how_section {
    margin-bottom: 80px;
}
.how_section a {
    display: block;
    width: max-content;
    margin: 50px auto 0px;
}
.how_steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    position: relative;
}

.step {
    text-align: center;
    position: relative;
}

.step_number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 800;
    color: white;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
}

.step p {
    color: var(--color-secondary);
    line-height: 1.6;
}

/* Features Section */
.features_section {
    margin-bottom: 80px;
}

.features_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature {
    background: var(--color-window);
    border: 1px solid var(--color-element);
    border-radius: 12px;
    padding: 30px 45px;
    transition: all 0.3s ease;
    text-align: center;
}

.feature:hover {
    border-color: var(--color-primary-font);
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.1);
}

.feature_icon {
    /* font-size: 2.5em;
    height: 16px;
    height: 30px; */
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: end;
    margin: 0 auto;
}

.feature_icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.feature h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
    margin-top: 20px;
}

.feature p {
    color: var(--color-secondary);
    font-size: 0.95em;
    line-height: 1.5;
}

/* CTA Section */
.cta_final {
    width: 100%;
    /* background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); */
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 0;
}

.cta_final::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: url(../../images/referral/top_banner.webp);
    z-index: 1;
}

.cta_final_box {
    width: 100%;
    height: max-content;
    position: relative;
    z-index: 2;
    text-align: center;

    background: rgba(0, 0, 0, 0.089);
    padding: 60px 30px 50px;

    backdrop-filter: blur(1.5px); 
    -webkit-backdrop-filter: blur(1.5px);

}

.cta_final h2 {
    font-size: 32px;
    line-height: 36px;
    color: white;
    margin-bottom: 20px;
    font-weight: 800;
}

.cta_final p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2em;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Top Partners Modal */
.top_partners_modal_overlay {
    position: fixed;
    top: 0px;
    right: 20px;
    bottom: 0;
    margin: auto;
    width: 380px;
    height: max-content;
    max-height: calc(100vh - 40px);
    background: var(--color-window);
    border: 1px solid var(--color-element);
    border-radius: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.top_partners_modal_overlay.hidden {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

.top_partners_modal {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.top_partners_modal_header_wrapper {
    padding: 25px;
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
    border-radius: 14px 14px 0 0;
}

.top_partners_modal_close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.top_partners_modal_close:hover {
    color: var(--primary);
    background: rgba(255, 107, 107, 0.15);
}

.top_partners_modal_header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.top_partners_modal_header_img {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.top_partners_modal_header_img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.top_partners_modal_header h2 {
    font-size: 1.5em;
    margin: 0;
}

.top_partners_modal_subtitle {
    color: var(--color-secondary);
    font-size: 0.85em;
    margin-top: 8px;
}

.top_partners_list_wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0px 20px 20px;
    min-height: 0;
}

.top_partners_list_wrapper::-webkit-scrollbar {
    width: 6px;
}

.top_partners_list_wrapper::-webkit-scrollbar-track {
    background: rgba(45, 53, 97, 0.3);
}

.top_partners_list_wrapper::-webkit-scrollbar-thumb {
    background: var(--color-primary-font);
    border-radius: 10px;
}

.top_partners_list_wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.top_partners_modal_footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    border-radius: 0 0 14px 14px;
    background: var(--color-window);
}

.become_partner_btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
    border: none;
    color: white;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 10px rgba(107, 188, 255, 0.3);
}

.become_partner_btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 10px rgba(107, 176, 255, 0.4);
}

.become_partner_btn:active {
    transform: translateY(-1px);
}

/* Floating Toggle Button */
.top_partners_toggle_btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-font) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(107, 201, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    animation: float 3s ease-in-out infinite;
}

.top_partners_toggle_btn img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

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

.top_partners_toggle_btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.top_partners_toggle_btn:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(98, 164, 250, 0.5);
}

.top_partners_list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.partner_item {
    background: rgba(78, 205, 196, 0.08);
    border-left: 3px solid var(--color-primary-font);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.partner_item:hover {
    background: rgba(78, 205, 196, 0.15);
    transform: translateX(5px);
}

.partner_rank {
    font-weight: 700;
    color: var(--green);
    font-size: 0.85em;
    margin-bottom: 5px;
}

.partner_name {
    font-weight: 600;
    color: var(--color-font);
    font-size: 0.95em;
    margin-bottom: 3px;
}

.partner_earnings {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.1em;
}

/* Income Chart Section */
.chart_section {
    margin-bottom: 80px;
}

.chart_container {
    background: var(--color-window);
    border: 1px solid var(--color-element);
    border-radius: 15px;
    padding: 40px;
    transition: all 0.3s ease;
}

.chart_container:hover {
    border-color: var(--color-primary-font);
    box-shadow: 0 10px 30px rgba(78, 205, 196, 0.1);
}

.chart_title {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.chart_description {
    color: var(--color-secondary);
    margin-bottom: 40px;
}

.chart_canvas {
    width: 100%;
    max-height: 400px;
}

.chart_legend {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.legend_item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend_color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Disclaimer */
.disclaimer {
    background: rgba(22, 112, 133, 0.08);
    border-left: 4px solid var(--color-primary-font);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 25px;
    font-size: 0.9em;
    color: var(--color-secondary);
    line-height: 1.6;
}

/* Modal responsive */
@media (max-width: 768px) {
    .top_partners_modal_overlay {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        max-height: 70vh;
    }

    .top_partners_modal_header_wrapper {
        padding: 20px;
    }

    .top_partners_modal_header h2 {
        font-size: 1.3em;
    }

    .top_partners_list_wrapper {
        padding: 15px;
    }

    .top_partners_modal_footer {
        padding: 15px;
    }

    .top_partners_toggle_btn {
        bottom: 25px;
        right: 25px;
        width: 55px;
        height: 55px;
        font-size: 1.6em;
    }
}

@media (max-width: 480px) {
    .top_partners_modal_overlay {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
        top: 15px;
        max-height: calc(100vh - 30px);
    }

    .top_partners_modal_header_wrapper {
        padding: 15px;
    }

    .top_partners_modal_header {
        gap: 8px;
    }

    .top_partners_modal_header h2 {
        font-size: 1.1em;
    }

    .top_partners_modal_subtitle {
        font-size: 0.8em;
    }

    .top_partners_list_wrapper {
        padding: 12px;
    }

    .partner_item {
        padding: 8px;
        font-size: 0.9em;
    }

    .become_partner_btn {
        padding: 12px;
        font-size: 1em;
    }

    .top_partners_toggle_btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.4em;
    }
}

@media (max-width: 1024px) {
    .hero {
        /* padding: 70px 25px; */
        min-height: 320px;
    }

    .hero::before {
        background-position: 62% center;
    }

    .hero_box {
        min-height: 320px;
    }

    .why_grid,
    .tiers_grid,
    .features_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .section_title {
        font-size: 2.2em;
        margin-bottom: 40px;
    }
}

@media (max-width: 768px) {
    .referral_info {
        padding: 15px;
    }

    .container {
        padding: 0 10px;
    }

    .hero {
        /* padding: 60px 25px; */
        margin-bottom: 60px;
        border-radius: 20px;
        min-height: 300px;
    }

    .hero::before {
        background-position: 68% center;
    }

    .hero_box {
        min-height: 300px;
        padding: 35px 20px 40px;
    }

    .hero h1 {
        font-size: 2.3em;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 1.05em;
        margin-bottom: 30px;
    }
    .cta_buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        padding: 12px 25px;
        font-size: 1em;
        margin-top: 40px;
    }

    .hero .cta_buttons {
        margin-top: 20px;
    }
    .hero .cta_buttons .btn {
        margin-top: 0px;
    }
    .section_title {
        font-size: 1.8em;
        margin-bottom: 35px;
    }

    .why_grid,
    .tiers_grid,
    .features_grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .why_card,
    .tier_card,
    .feature {
        padding: 30px;
    }

    .tier_percentage {
        font-size: 2.5em;
    }

    .stats_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .stat {
        padding: 20px 10px;
    }

    .stat_number {
        font-size: 1.8em;
    }

    .stat_label {
        font-size: 0.85em;
    }

    .how_steps {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .step_number {
        width: 70px;
        height: 70px;
        font-size: 1.8em;
    }

    .cta_final {
        /* padding: 60px 25px; */
        margin-bottom: 50px;
    }

    .cta_final h2 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .cta_final p {
        font-size: 1em;
        margin-bottom: 30px;
    }

    .chart_container {
        padding: 30px 20px;
        overflow: hidden;
    }

    .chart_title {
        font-size: 1.3em;
    }

    .chart_legend {
        gap: 20px;
        margin-top: 25px;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .hero {
        /* padding: 30px 15px; */
        min-height: 200px;
    }

    .hero::before {
        background-position: 72% center;
    }

    .hero_box {
        min-height: 220px;
        padding: 35px 15px 40px;
    }

    .hero h1 {
        font-size: 1.4em;
        margin-bottom: 13px;
    }

    .hero p {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .stats_section {
        padding: 10px 12px;
    }
    .stats_section .stat {
        padding: 15px 10px;
    }

    .why_grid,
    .tiers_grid,
    .features_grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .why_card,
    .tier_card,
    .feature {
        padding: 20px;
    }

    .tier_percentage {
        font-size: 2em;
    }

    .stats_grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stat_number {
        font-size: 1.8em;
    }

    .step_number {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }

    .step {
        padding: 0 10px;
    }

    .cta_final {
        /* padding: 40px 15px; */
    }

    .cta_final h2 {
        font-size: 1.5em;
    }

    .cta_buttons {
        flex-direction: column;
    }

    .cta_final_box .cta_buttons {
        margin-top: 0px;
    }
    .cta_final_box .cta_buttons .btn {
        margin-top: 0px;
    }

    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }

    .section_title {
        font-size: 1.5em;
        margin-bottom: 25px;
    }

    .chart_container {
        padding: 20px;
    }

    .chart_title {
        font-size: 1.2em;
    }

    .chart_legend {
        gap: 15px;
        justify-content: flex-start;
    }

    .legend_item {
        width: 100%;
    }
}
