@if (session('warning'))
{{ session('warning') }}
@endif
{{-- ── Current subscription ── --}}
@if ($subscription) @php $activePlanFeatures = $subscription->features(); @endphp
{{ __('Current plan') }}

{{ $subscription->plan?->name ?? __('Plan') }}

{{ money($subscription->price, $subscription->currency) }} / {{ __(ucfirst($subscription->billing_period)) }}

{{ __('Active until') }}
{{ rf_date($subscription->current_period_end) }}
{{ __('Next charge') }}
{{ $subscription->next_charge_at ? rf_date($subscription->next_charge_at) : __('Never') }}
@if ($subscription->status === 'past_due')
{{ __('Your last payment failed. Top up and pay now to avoid suspension:date.', ['date' => $subscription->grace_ends_at ? ' ('.__('by :d', ['d' => rf_date($subscription->grace_ends_at)]).')' : '']) }}
@elseif ($subscription->status === 'suspended')
{{ __('Your subscription is suspended. Pay the balance owed to restore full access.') }}
@endif @else

{{ __('No active plan') }}

{{ __('Choose a plan below to unlock your storefront features.') }}

@endif
{{-- Available plans (self-serve upgrade, funded from the wallet) --}} {{ __('Available plans') }}
@foreach ($plans as $plan) @php $f = $plan->planFeatures(); $isCurrent = $subscription && $subscription->plan_id === $plan->id; @endphp

{{ $plan->name }}

@if ($isCurrent){{ __('Current') }}@endif
{{ money($plan->price, $plan->currency) }}/{{ __(ucfirst($plan->billing_period)) }}
{{-- The plan's own marketing lines, written by the owner in the plan editor. No quota is printed because none is enforced. --}}
@php $planLines = $f->highlights(); @endphp @if ($planLines !== [])
    @foreach ($planLines as $planLine)
  • {{ $planLine }}
  • @endforeach
@elseif ($plan->description)

{{ $plan->description }}

@endif @unless ($isCurrent) {{-- A past-due period blocks the plan switch (see the Billing\Index docblock): the button states why instead of sending a click that just bounces back rejected. The fix is "Pay now", right next to it. --}} @if ($switchLocked)

{{ __('Settle the amount owed before changing plan.') }}

@else {{-- The generic @rfconfirm was swapped for a modal that CALCULATES this plan's real impact on this panel. --}} @endif @endunless
@endforeach
{{-- Recent plan charges --}}
{{ __('Recent charges') }}
@forelse ($charges as $charge) @empty @endforelse
{{ __('Period') }} {{ __('Amount') }} {{ __('Status') }}
{{ rf_date($charge->period_start) }} – {{ rf_date($charge->period_end) }} {{ money($charge->amount, $charge->currency) }} @php $tone = ['paid' => 'success', 'pending' => 'warning', 'failed' => 'danger', 'refunded' => 'neutral'][$charge->status] ?? 'neutral'; @endphp {{ __(ucfirst($charge->status)) }}
{{-- ── Wallet + pay now ── --}}
{{ __('Wallet balance') }}
{{ money($balance, $panel->base_currency) }}
@if (\App\Support\Money::isPositive($owed))
{{ __('Amount owed') }}{{ money($owed, $panel->base_currency) }}
@if (\App\Support\Money::isPositive($shortfall))
{{ __('Add at least') }}{{ money($shortfall, $panel->base_currency) }}
@endif
@else

{{ __('You are all paid up.') }}

@endif {{ __('Add funds') }}
{{-- ── Plan-switch confirmation ───────────────────────────────────────── Not a "are you sure?": every line is calculated by the component with the SAME gates the product enforces (PlanFeatures for both plans, this panel's own domains and its saved designs). Server-driven modal: no closing by backdrop or Escape, only ✕ / Cancel. --}} @if ($confirmPlan)

{{ __('This is exactly what changes for you and for your clients.') }}

    @foreach ($impact as $line) @php $tone = ['good' => 'var(--color-success)', 'warn' => 'var(--color-warning)'][$line['tone']] ?? 'var(--color-text-subtle)'; @endphp
  • {{ $line['text'] }}
  • @endforeach
@endif