/* --- Mobile Navigation: "Invest Now" Bottom + Auto-Fit Others --- */
@media (max-width: 768px) {

    /* 1. Container ko Wrap allow karenge */
    nav div[style*="text-align: center"] {
        display: flex !important;
        flex-wrap: wrap !important;    /* Buttons ko multiple lines mein aane do */
        justify-content: space-between !important;
        gap: 8px !important;           /* Buttons ke beech thoda gap */
        padding: 5px !important;
    }

    /* 2. "Invest Now" Button (Sabse Neeche & Bada) */
    nav .btn-primary {
        width: 100% !important;        /* Pura screen width lega */
        order: 10 !important;          /* Flexbox mein sabse end mein bhej dega */
        font-size: 1.1rem !important;  /* Font bada */
        padding: 12px !important;      /* Height badi */
        margin-top: 5px !important;    /* Thoda gap upar wale buttons se */
    }

    /* 3. Baki Sare Buttons (Outline Wale) */
    nav .btn-outline {
        flex: 1 0 40% !important;      /* Minimum 40% width lega (2 button per row) */
        /* Note: Agar aap chahte hain 4 ek line mein aaye to 40% ko hata kar 20% kar dein */
        
        order: 1 !important;           /* Ye sab pehle aayenge */
        font-size: 0.9rem !important;  /* Font thoda readable size */
        padding: 10px 5px !important;  /* Click area bada */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}









@media (max-width: 768px) {

    /* 1. Container ko Swipe-able Row banana */
    .flow-container {
        flex-direction: row !important;    /* Stack hone se rokega */
        overflow-x: auto !important;       /* Horizontal Scroll On */
        justify-content: flex-start !important;
        gap: 0 !important;                 /* Gap hataya taaki line judi rahe */
        padding-bottom: 30px !important;   /* Scroll karne ke liye finger space */
        
        /* Smooth scroll feel */
        -webkit-overflow-scrolling: touch; 
        scroll-behavior: smooth;
    }

    /* Scrollbar chupana (Clean Look) */
    .flow-container::-webkit-scrollbar {
        display: none;
    }

    /* 2. Har Step (Card) ka Size Fix karna */
    .flow-step {
        min-width: 260px !important;  /* Card ki chaudai fix (Readable) */
        flex-shrink: 0 !important;    /* Card pichkega nahi */
        padding: 0 15px !important;   /* Text ke liye breathing space */
        text-align: center !important;
        position: relative;           /* Line connect karne ke liye */
    }

    /* 3. Line Logic Change (Purani Line Hide) */
    .flow-container::before {
        display: none !important; /* Global line hata di */
    }

    /* 4. New Mobile Line (Har card ke baad line) */
    .flow-step::after {
        content: '';
        position: absolute;
        top: 30px;          /* Icon ke center mein */
        right: -50%;        /* Right side aadha cover karega */
        width: 100%;        /* Agle card tak jayega */
        height: 2px;
        background: #cbd5e1;
        z-index: -1;        /* Icon ke peeche */
    }

    /* Aakhri card par line nahi honi chahiye */
    .flow-step:last-child::after {
        display: none;
    }

    /* 5. Icon Styling (Mobile Specific) */
    .flow-icon {
        margin: 0 auto 15px auto !important;
        position: relative;
        z-index: 2; /* Line ke upar */
        background: var(--primary); /* Ensure background covers line */
        box-shadow: 0 0 0 8px var(--white); /* White border taaki line cut ho jaye */
    }
}
  
  
  



/* --- Mobile: Horizontal Scroll (Smart Sizing) --- */
@media (max-width: 768px) {

    /* 1. Container Row */
    .steps-grid {
        display: flex !important;
        overflow-x: auto !important;
        gap: 15px !important;            /* Gap thoda kam kiya */
        padding: 10px 20px 30px 20px !important;
        
        scroll-snap-type: x mandatory;   /* Magnetic Stop Effect */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .steps-grid::-webkit-scrollbar { display: none; }

    /* 2. Card Size (Portrait / Normal View) */
    .step-card {
        height: 300px;
        width: 300px;
            /* Screen ka 85% width lega */
        flex-shrink: 0 !important;
        scroll-snap-align: center;       /* Center mein rukega */
        
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }
}

/* --- Special: Landscape Mode (Phone Tedha karne par) --- */
@media (max-width: 768px) and (orientation: landscape) {
    .step-card {
        min-width: 40vw !important;      /* Screen ka 40% (Ek baar mein 2 cards dikhenge) */
    }
}





/* --- Mobile: 2x2 Grid for Ledger Stats --- */
@media (max-width: 768px) {

    .ledger-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 2 Barabar Columns */
        gap: 40px 20px !important; /* Upar-Niche gap 40px, Side gap 20px */
    }

    /* Optional: Agar stats mobile par too heavy lag rahe ho */
    .ledger-num {
        font-size: 2rem !important; /* Font thoda chota kiya taaki fit rahe */
    }
    
    .ledger-label {
        font-size: 0.8rem !important;
    }
}






/* --- Mobile: Horizontal Scroll for Investor & Vendor Grids --- */
@media (max-width: 768px) {

    /* 1. Convert the Grid to a Scrolling Row */
    .grid-3 {
        display: flex !important;        /* Force Row Layout */
        overflow-x: auto !important;     /* Enable Swipe */
        gap: 15px !important;            /* Space between cards */
        padding-bottom: 30px !important; /* Space for scroll/shadow */
        
        /* Smooth Scroll Physics */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar (Firefox) */
    }

    /* Hide Scrollbar (Chrome/Safari) */
    .grid-3::-webkit-scrollbar {
        display: none;
    }

    /* 2. Investor & Vendor Card Sizing */
    .investor-card, .story-card {
        height: 220px;
        width: 250px;                     /* Fixed width for better swipe experience */
        min-width: 85vw !important;      /* Card takes 85% of screen width */
        flex-shrink: 0 !important;       /* Prevent shrinking */
        scroll-snap-align: center;       /* Stop exactly in center */
        margin-bottom: 0 !important;     /* Remove bottom margin if any */
    }
}







/* --- Calculator Gap & Spacing Fix --- */

/* 1. Desktop & General Layout */
div[style*="margin: 30px 0"] {
    display: flex;             /* Flexbox on karein */
    justify-content: center;   /* Center mein layein */
    gap: 15px;                 /* Desktop par 15px ka gap */
    align-items: center;
    flex-wrap: wrap;           /* Taaki mobile par tut kar niche aa sake */
}

/* 2. Mobile Specific (Max Width 768px) */
@media (max-width: 768px) {
    
    div[style*="margin: 30px 0"] {
        flex-direction: column !important; /* Ek ke niche ek (Stack) */
        gap: 25px !important;              /* Mobile par Bada Gap (25px) */
    }

    /* Input Field Full Width */
    input#investInput {
        width: 100% !important;
        margin: 0 !important;      /* Extra margin hatayein */
    }

    /* Button Full Width */
    button[onclick="calculateROI()"] {
        font-size: 0.8.5rem !important; /* Thoda chota font */
        width: 60% !important;
        margin-left: 0 !important; /* Inline margin hatana zaroori hai */
    }
}





/* --- Footer Audit Box Responsive --- */

/* 1. Mobile Layout (Max Width 768px) */
@media (max-width: 768px) {
    
    /* Main Box Stack */
    .audit-box {
        flex-direction: column !important;  /* Text upar, Buttons neeche */
        text-align: center !important;      /* Text center kiya */
        gap: 25px !important;               /* Beech mein gap */
        align-items: stretch !important;    /* Items ko full width stretch karega */
        padding: 20px !important;
    }

    /* Button Container (Right side div) */
    .audit-box > div:last-child {
        display: flex !important;
        flex-direction: column !important;  /* Buttons ko vertical stack karega */
        gap: 15px !important;               /* Buttons ke beech gap */
        width: 100% !important;
    }

    /* Report Links (Buttons) */
    .report-link {
        display: block !important;          /* Block element (New line) */
        width: 100% !important;             /* Full Screen Width */
        margin: 0 !important;               /* Purana margin-left hataya */
        padding: 12px 0 !important;         /* Height badhai taaki click easy ho */
        text-align: center !important;
        background: rgba(255, 255, 255, 0.05); /* Halka background diya */
        border-radius: 8px !important;
    }
    
    .report-link:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}










  
  
  
  /* GUARANTOR BADGE STYLE */
        .guarantor-link {
            display: flex; 
            align-items: center; 
            gap: 7px; 
            color: var(--primary) !important; 
            font-weight: 700;
            font-size: 1rem;
        }
        .guarantor-link:hover { color: #d97706 !important; }
        .new-badge {
            background: var(--wealth); 
            color: white; 
            font-size: 0.7rem; 
            padding: 2px 6px; 
            border-radius: 10px; 
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3);
        }



/* --- NEW: ESCROW FLOW DIAGRAM --- */
        .flow-section { padding: 80px 0; background: var(--white); }
        .flow-container { display: flex; justify-content: space-between; align-items: center; max-width: 1000px; margin: 40px auto 0; position: relative; }




/* The connecting line */
        .flow-container::before {
            content: ''; position: absolute; top: 50px; left: 50px; right: 50px; height: 4px; 
            background: #e2e8f0; z-index: 0;
        }
        .flow-step { position: relative; z-index: 1; text-align: center; flex: 1; }
        .flow-icon { 
            width: 100px; height: 100px; background: var(--white); border: 4px solid var(--primary); 
            border-radius: 50%; display: flex; align-items: center; justify-content: center; 
            font-size: 2.5rem; margin: 0 auto 20px; color: var(--primary);
            transition: 0.3s;
        }
        .flow-step:hover .flow-icon { border-color: var(--accent); color: var(--accent); transform: scale(1.1); }
        .flow-title { font-weight: 700; margin-bottom: 5px; }
        .flow-desc { font-size: 0.85rem; color: #64748b; padding: 0 10px; }


  /* FOOTER & AUDIT */
        footer { background: #020617; color: #94a3b8; padding: 60px 0 20px; border-top: 1px solid #1e293b; }
        .audit-box { background: #1e293b; padding: 20px; border-radius: 8px; margin-bottom: 40px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
        .report-link { color: var(--accent); text-decoration: none; border: 1px solid var(--accent); padding: 5px 15px; border-radius: 4px; font-size: 0.9rem; transition: 0.2s; }
        .report-link:hover { background: var(--accent); color: var(--primary); }

        @media (max-width: 768px) {
            .hero h1 { font-size: 2.2rem; }
            .flow-container { flex-direction: column; gap: 30px; }
            .flow-container::before { width: 4px; height: 100%; left: 50%; top: 0; margin-left: -2px; }
            .shield-card, .audit-box { flex-direction: column; text-align: center; }
            .ledger-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
            nav { flex-direction: column; gap: 15px; }
            .btn-outline { width: 100%; margin-bottom: 10px; }
        }



:root {
            --primary: #0F172A;   /* Deep Navy */
            --accent: #10B981;    /* Growth Green */
            --bg: #F8FAFC;        /* Clean White/Grey */
            --text: #334155;      /* Readable Grey */
            --white: #ffffff;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background-color: var(--bg);
            color: var(--text);
            line-height: 1.6;
        }

        /* Utility */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .btn {
            display: inline-block;
            padding: 12px 30px;
            background-color: var(--accent);
            color: var(--white);
            text-decoration: none;
            border-radius: 8px;
            font-weight: 600;
            transition: transform 0.2s, box-shadow 0.2s;
            border: none;
            cursor: pointer;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        /* Header */
        header {
            background: var(--white);
            padding: 20px 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--primary);
        }

        .logo span { color: var(--accent); }

        /* Hero Section */
        .hero {
            background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.8)), url('https://thumbs.dreamstime.com/b/abstract-fintech-background-soft-gradients-expressing-digital-security-financial-stability-abstract-fintech-background-435219095.jpg');
            background-size: cover;
            background-position: center;
            color: var(--white);
            padding: 100px 0;
            text-align: center;
        }

        .hero h1 {
            font-size: 3rem;
            margin-bottom: 20px;
            line-height: 1.2;
        }

        .hero p {
            font-size: 1.2rem;
            opacity: 0.9;
            max-width: 700px;
            margin: 0 auto 30px;
        }

        /* About Section */
        .section {
            padding: 80px 0;
        }

        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 50px;
            align-items: center;
        }

        .card {
            background: var(--white);
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            border: 1px solid #e2e8f0;
        }

        .tag {
            background: #ecfdf5;
            color: var(--accent);
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 700;
            text-transform: uppercase;
            margin-bottom: 15px;
            display: inline-block;
        }

        /* Steps */
        .steps-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            margin-top: 40px;
        }

        .step-card {
            text-align: center;
            padding: 30px;
            background: var(--white);
            border-radius: 12px;
            transition: 0.3s;
        }

        .step-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        }

        .step-icon {
            font-size: 2.5rem;
            margin-bottom: 20px;
            background: #f1f5f9;
            width: 80px;
            height: 80px;
            line-height: 80px;
            border-radius: 50%;
            margin-left: auto;
            margin-right: auto;
        }

        /* Calculator */
        .calc-box {
            background: var(--primary);
            color: var(--white);
            border-radius: 16px;
            padding: 40px;
            text-align: center;
            max-width: 800px;
            margin: 0 auto;
        }

        .input-group {
            margin: 30px 0;
            display: flex;
            justify-content: center;
            gap: 10px;
        }

        input[type="number"] {
            padding: 15px;
            font-size: 1.2rem;
            border-radius: 8px;
            border: none;
            width: 200px;
            text-align: center;
        }

        .results {
            display: flex;
            justify-content: space-around;
            margin-top: 30px;
            border-top: 1px solid rgba(255,255,255,0.1);
            padding-top: 30px;
        }

        .res-item h3 { font-size: 2rem; color: var(--accent); }
        .res-item p { opacity: 0.7; font-size: 0.9rem; }

        /* Footer */
        footer {
            background: #0f172a;
            color: #94a3b8;
            padding: 50px 0 20px;
            text-align: center;
        }
        
        footer a { color: var(--accent); text-decoration: none; }

        @media (max-width: 768px) {
            .grid-2 { grid-template-columns: 1fr; }
            .hero h1 { font-size: 2.2rem; }
            .results { flex-direction: column; gap: 20px; }
        }

        /* extra adjustments for smaller phones */
        @media (max-width: 480px) {
            body { font-size: 0.9rem; }
            header nav { flex-direction: column; gap: 10px; }
            .btn, .btn-outline { width: 100%; text-align: center; padding: 10px 0; }
            .hero { padding: 60px 0; }
            .hero h1 { font-size: 1.8rem; }
            .hero p { font-size: 1rem; }
            .ticker-wrap { height: 30px; line-height: 30px; }
            .ticker-item { font-size: 0.8rem; padding: 0 10px; }
            .flow-icon { width: 80px; height: 80px; font-size: 2rem; }
            .flow-desc { font-size: 0.75rem; }
            .ledger-grid { flex-direction: column; }
            .ledger-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
            .investor-card, .story-card { margin-bottom: 20px; }
            .steps-grid { grid-template-columns: 1fr; }
            .calc-box { padding: 20px; }
            .audit-box { flex-direction: column; text-align: center; }
        }