<x-layouts.site>
    <x-slot:title>Getting Out of Debt</x-slot:title>
    <x-slot:description>Understand good vs bad debt, choose between the snowball and avalanche methods, avoid the common blunders, and build your personal debt-free plan. No lectures, no shame.</x-slot:description>

    {{-- Hero --}}
    <section class="relative overflow-hidden bg-mesh">
        <div class="blob -left-24 top-10 h-80 w-80 bg-wise-300/35" data-parallax="0.2" aria-hidden="true"></div>
        <div class="container-site relative grid items-center gap-12 py-16 md:py-20 lg:grid-cols-[1.1fr,1fr]" data-hero>
            <div>
                <p class="eyebrow" data-hero-item>Debt management</p>
                <h1 class="mt-3 font-display text-display-sm font-bold text-navy-900 md:text-display" data-hero-item>
                    Debt isn't the end of the story. <span class="text-gradient">It's the start of a plan.</span>
                </h1>
                <p class="mt-4 max-w-xl text-lg leading-relaxed text-navy-600" data-hero-item>
                    No shame here. Whether it's mobile loans, a bank loan or something owed to family, there is a clear,
                    practical way out. Let's walk through it, then build your own debt-free plan.
                </p>
                <div class="mt-7 flex flex-wrap gap-3" data-hero-item>
                    <a href="{{ route('tools.show', 'debt-payoff') }}" class="btn-accent btn-lg">Build my debt-free plan <x-icon name="arrow-right" class="h-5 w-5" /></a>
                    <a href="#methods" class="btn-ghost btn-lg">Snowball vs avalanche</a>
                </div>
            </div>
            <div class="relative" data-hero-item>
                <div class="card-photo aspect-[4/3] w-full" data-tilt="4">
                    <img src="{{ asset('images/stock/mobile-money.jpg') }}" alt="Reviewing loans and repayments on a phone">
                </div>
            </div>
        </div>
    </section>

    {{-- Good vs bad debt --}}
    <section class="section bg-white">
        <div class="container-site">
            <div class="text-center" data-gsap="fade-up">
                <p class="eyebrow justify-center">First, a mindset shift</p>
                <h2 class="section-title mt-3">Not all debt is the same</h2>
                <p class="mx-auto mt-3 max-w-xl text-navy-600">Some debt builds your future. Some quietly steals it. Knowing the difference changes every borrowing decision.</p>
            </div>
            <div class="mt-10 grid gap-4 md:grid-cols-2" data-gsap="zoom">
                <div class="card border-t-4 border-emerald-400 p-7">
                    <h3 class="flex items-center gap-2 font-display text-lg font-bold text-emerald-700"><x-icon name="check-circle" class="h-6 w-6" /> Purposeful debt</h3>
                    <p class="mt-2 text-sm text-navy-500">Builds an asset or grows your income, and you can repay it comfortably.</p>
                    <ul class="mt-4 space-y-2.5 text-sm text-navy-700">
                        @foreach (['Working capital or equipment for a business', 'A reasonable mortgage on a home', 'Strategic investment you can pay off without maxing out'] as $g)
                            <li class="flex items-start gap-2.5"><span class="mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full bg-emerald-100 text-emerald-600"><x-icon name="check" class="h-3 w-3" /></span> {{ $g }}</li>
                        @endforeach
                    </ul>
                </div>
                <div class="card border-t-4 border-rose-300 p-7">
                    <h3 class="flex items-center gap-2 font-display text-lg font-bold text-navy-900"><x-icon name="alert-triangle" class="h-6 w-6 text-rose-400" /> Bad debt</h3>
                    <p class="mt-2 text-sm text-navy-500">Funds consumption or a decreasing-value thing, and stretches you thin.</p>
                    <ul class="mt-4 space-y-2.5 text-sm text-navy-700">
                        @foreach (['Clothes, holidays and weddings on credit', 'Borrowing to buy risky assets like crypto', 'Mobile loans to bridge the month, over and over'] as $b)
                            <li class="flex items-start gap-2.5"><span class="mt-0.5 text-rose-300">–</span> {{ $b }}</li>
                        @endforeach
                    </ul>
                </div>
            </div>
        </div>
    </section>

    {{-- Debt before investing --}}
    <section class="section bg-navy-50/60">
        <div class="container-site">
            <div class="grid items-start gap-8 lg:grid-cols-[0.9fr,1.1fr]">
                <div data-gsap="fade-right">
                    <p class="eyebrow">Before you chase returns</p>
                    <h2 class="section-title mt-3">Unmanaged debt can quietly cancel your investments</h2>
                    <p class="mt-4 leading-relaxed text-navy-600">
                        Saving protects your next emergency. Investing grows money you can leave alone. High-interest debt does the opposite:
                        it compounds against you, eats cash flow, and can force you to sell investments at the wrong time.
                    </p>
                    <p class="mt-3 leading-relaxed text-navy-600">
                        The practical sequence is simple: keep a small emergency buffer, stop new expensive borrowing, clear toxic debt,
                        then invest consistently from a calmer place.
                    </p>
                </div>
                <div class="grid gap-4 sm:grid-cols-3" data-gsap-stagger>
                    @foreach ([
                        ['icon' => 'shield-check', 'title' => 'Save first', 'desc' => 'Keep a starter buffer so one surprise bill does not push you back into loans.'],
                        ['icon' => 'unlink', 'title' => 'Clear toxic debt', 'desc' => 'Prioritize expensive consumer and lifestyle debt before chasing market returns.'],
                        ['icon' => 'trending-up', 'title' => 'Invest next', 'desc' => 'Once cash flow is stable, invest money that can stay invested long enough to grow.'],
                    ] as $item)
                        <div class="card p-5">
                            <span class="icon-tile !h-11 !w-11"><x-icon :name="$item['icon']" class="h-5 w-5" /></span>
                            <p class="mt-4 font-display font-bold text-navy-900">{{ $item['title'] }}</p>
                            <p class="mt-2 text-sm leading-relaxed text-navy-600">{{ $item['desc'] }}</p>
                        </div>
                    @endforeach
                </div>
            </div>
        </div>
    </section>

    {{-- Snowball vs Avalanche --}}
    <section id="methods" class="section bg-mesh">
        <div class="container-site">
            <div class="text-center" data-gsap="fade-up">
                <p class="eyebrow justify-center">Two ways out</p>
                <h2 class="section-title mt-3">Snowball or avalanche?</h2>
                <p class="mx-auto mt-3 max-w-2xl text-navy-600">Both work. One is built for motivation, the other for maths. Pick the one you'll actually stick with.</p>
            </div>
            <div class="mt-10 grid gap-6 lg:grid-cols-2" data-gsap-stagger>
                <div class="card p-7">
                    <span class="icon-tile"><x-icon name="snowflake" class="h-5 w-5" /></span>
                    <h3 class="mt-4 font-display text-xl font-bold text-navy-900">The Snowball</h3>
                    <p class="mt-2 leading-relaxed text-navy-600">List your debts from <strong>smallest to largest</strong>. Pay minimums on all, then throw every extra shilling at the smallest. When it clears, roll that whole payment onto the next one.</p>
                    <p class="mt-3 rounded-2xl bg-wise-50 px-4 py-3 text-sm font-semibold text-navy-700">Best when you struggle with consistency. The quick early wins keep you going.</p>
                </div>
                <div class="card p-7">
                    <span class="icon-tile"><x-icon name="mountain" class="h-5 w-5" /></span>
                    <h3 class="mt-4 font-display text-xl font-bold text-navy-900">The Avalanche</h3>
                    <p class="mt-2 leading-relaxed text-navy-600">List your debts by <strong>highest interest rate first</strong>. Pay minimums on all, then attack the most expensive one. Mathematically the cheapest route out.</p>
                    <p class="mt-3 rounded-2xl bg-wise-50 px-4 py-3 text-sm font-semibold text-navy-700">Best when you can stay disciplined. You save the most money overall.</p>
                </div>
            </div>
            <p class="mx-auto mt-6 max-w-2xl text-center text-sm text-navy-500" data-gsap="fade-up">
                Tip: in Kenya, mobile loans are often both the smallest <em>and</em> the most expensive, so the two methods usually agree, clear the app loans first.
            </p>
        </div>
    </section>

    {{-- The way out --}}
    <section class="section bg-white">
        <div class="container-site max-w-3xl">
            <div class="text-center" data-gsap="fade-up">
                <p class="eyebrow justify-center">The way out</p>
                <h2 class="section-title mt-3">Five steps to debt-free</h2>
            </div>
            <div class="mt-10 space-y-4" data-gsap-stagger>
                @foreach ([
                    ['t' => 'Face the number', 'd' => 'List every debt: Fuliza, app loans, SACCO, bank, family. Amount, interest rate, minimum payment. Naming it takes away its power.'],
                    ['t' => 'Stop the bleeding', 'd' => 'No new debt from today. If mobile loans are a monthly habit, the budget gap is the real problem, fix that first.'],
                    ['t' => 'Pick your strategy', 'd' => 'Snowball for momentum or avalanche for maths. Then find money to add: cut what you can, sell what you can, earn a little more.'],
                    ['t' => 'Restructure and renegotiate', 'd' => 'Call your bank to lengthen a term, or use a cheaper SACCO loan to buy off an expensive bank loan. Talk to your creditors, apologise, renegotiate, restart.'],
                    ['t' => 'Be consistent', 'd' => 'Keep the total payment steady. Every cleared loan frees up more for the next. Celebrate each win, it is human nature to keep going when you see progress.'],
                ] as $i => $step)
                    <div class="flex items-start gap-5 rounded-2xl bg-navy-50/60 p-5 ring-1 ring-navy-100/70">
                        <span class="grid h-11 w-11 shrink-0 place-items-center rounded-full bg-navy-900 font-display text-lg font-extrabold text-wise-300">{{ $i + 1 }}</span>
                        <div>
                            <p class="font-display font-bold text-navy-900">{{ $step['t'] }}</p>
                            <p class="mt-1 text-sm leading-relaxed text-navy-600">{{ $step['d'] }}</p>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </section>

    {{-- Consequences and mistakes --}}
    <section class="section bg-navy-50/60">
        <div class="container-site">
            <div class="grid gap-6 lg:grid-cols-2">
                <div class="card p-7" data-gsap="fade-right">
                    <p class="eyebrow">Why urgency matters</p>
                    <h2 class="mt-3 font-display text-2xl font-bold text-navy-900">The real cost is not only interest</h2>
                    <ul class="mt-5 space-y-3 text-sm leading-relaxed text-navy-700">
                        @foreach ([
                            'Stress and secrecy that spill into work, family and relationships.',
                            'Lower credit options later because missed payments follow you.',
                            'Less room for saving, investing, insurance and school fees.',
                            'Pressure to borrow again whenever an emergency appears.',
                        ] as $cost)
                            <li class="flex items-start gap-3"><span class="mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full bg-rose-100 text-rose-500"><x-icon name="alert-triangle" class="h-3 w-3" /></span> {{ $cost }}</li>
                        @endforeach
                    </ul>
                </div>
                <div class="card p-7" data-gsap="fade-left">
                    <p class="eyebrow">Common mistakes</p>
                    <h2 class="mt-3 font-display text-2xl font-bold text-navy-900">Avoid the traps that restart the cycle</h2>
                    <ul class="mt-5 space-y-3 text-sm leading-relaxed text-navy-700">
                        @foreach ([
                            'Paying whoever shouts loudest instead of following a written order.',
                            'Ignoring interest rates and fees because the balance looks small.',
                            'Clearing one loan, then spending the freed-up payment.',
                            'Borrowing to invest before the repayment plan is stable.',
                        ] as $mistake)
                            <li class="flex items-start gap-3"><span class="mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full bg-wise-100 text-wise-700"><x-icon name="x" class="h-3 w-3" /></span> {{ $mistake }}</li>
                        @endforeach
                    </ul>
                </div>
            </div>
        </div>
    </section>

    {{-- Video placeholder + CTA --}}
    <section class="section bg-mesh">
        <div class="container-site">
            <div class="card-glow mx-auto max-w-3xl bg-navy-900 bg-mesh-dark p-10 text-center" data-gsap="zoom">
                <span class="mx-auto grid h-14 w-14 place-items-center rounded-2xl bg-wise-400 text-navy-950"><x-icon name="unlink" class="h-7 w-7" /></span>
                <h2 class="mt-4 font-display text-3xl font-bold text-white">Ready to see your debt-free date?</h2>
                <p class="mx-auto mt-3 max-w-xl text-navy-200">Our free planner does the maths while you drag the sliders. Add your debts, pick a strategy, and watch the date move.</p>
                <div class="mt-8 flex flex-wrap justify-center gap-3">
                    <a href="{{ route('tools.show', 'debt-payoff') }}" class="btn-accent btn-lg">Build my debt-free plan <x-icon name="arrow-right" class="h-5 w-5" /></a>
                    <a href="{{ route('assessments.show', 'financial-health') }}" class="btn-white btn-lg">Take the free Financial Health Check</a>
                </div>
            </div>
        </div>
    </section>
</x-layouts.site>
