{{--
    Realistic ink "PAID" seal — a round notary/rubber-stamp, not a flat graphic.
    A4 print only; the 80mm receipt doesn't carry this seal.

    Every layer of the look is deliberate:
      - feTurbulence + feDisplacementMap roughen the crisp SVG edges into the
        ragged line ink makes when it soaks into paper fibres.
      - a second turbulence drives per-pixel alpha, so coverage is patchy
        (wet spots, dry spots) instead of uniformly solid.
      - a half-pixel Gaussian blur feathers the edges like ink bleed.
      - a radial "wash" darkens the ring where the stamp pressed hardest,
        leaving the middle lighter, the way a pad deposits ink.
      - a faint offset duplicate of the whole shape mimics a slightly
        double-struck stamp.
      - mix-blend-mode: multiply + ~95% opacity let the printed content
        beneath show through the ink, exactly like a translucent pad.

    Pass `sealDate` (a pre-formatted date + time string).
--}}
@php
    // issuedAt arrives as "14 Aug 2026, 14:32" — the seal carries the date
    // and the time, stamped in capitals like the pads stamp shops buy.
    $sealDate = strtoupper((string) ($sealDate ?? ''));
@endphp

<style>
    .paid-seal {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .paid-seal-svg {
        display: block;
        width: 100%;
        height: auto;
        mix-blend-mode: multiply;
        opacity: .96;
    }
</style>

<div class="paid-seal">
    <svg class="paid-seal-svg" viewBox="0 0 300 300"
        xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" role="img" aria-label="PAID">
        <defs>
            <filter id="paid-seal-ink" x="-25%" y="-25%" width="150%" height="150%" color-interpolation-filters="sRGB">
                {{-- Ragged ink edge: fractal noise pushes the shape's outline
                     around a few pixels in both axes. --}}
                <feTurbulence type="fractalNoise" baseFrequency="0.014 0.024" numOctaves="4" seed="17" result="edgeNoise"/>
                <feDisplacementMap in="SourceGraphic" in2="edgeNoise" scale="10" xChannelSelector="R" yChannelSelector="G" result="displaced"/>
                {{-- Patchy coverage: blotches of thin ink. Alpha is driven by
                     one noise channel, biased up so it never disappears. --}}
                <feTurbulence type="fractalNoise" baseFrequency="0.055 0.085" numOctaves="3" seed="9" result="patchNoise"/>
                <feColorMatrix in="patchNoise" type="matrix"
                    values="0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0.5 0 0 0 0.46"
                    result="patchMask"/>
                <feComposite in="displaced" in2="patchMask" operator="in" result="patched"/>
                {{-- Half-pixel bleed: ink wicks a touch past the stroke. --}}
                <feGaussianBlur in="patched" stdDeviation="0.5" result="ink"/>
            </filter>

            <radialGradient id="paid-seal-wash" cx="50%" cy="50%" r="52%">
                {{-- Heavier ink at the ring, thinner in the middle. --}}
                <stop offset="0%" stop-color="#8f1414" stop-opacity="0"/>
                <stop offset="72%" stop-color="#8f1414" stop-opacity="0.14"/>
                <stop offset="100%" stop-color="#7c1111" stop-opacity="0.38"/>
            </radialGradient>

            {{-- Paths for the circular text to ride on. The top arc runs
                 left-to-right over the crown, the bottom arc runs the same
                 direction along the floor of the circle, so both read
                 upright rather than upside down. --}}
            <path id="paid-seal-arc-top" d="M 46,150 A 104,104 0 0 1 254,150" fill="none"/>
            <path id="paid-seal-arc-bottom" d="M 254,150 A 104,104 0 0 1 46,150" fill="none"/>

            <g id="paid-seal-shape">
                <circle cx="150" cy="150" r="138" fill="none" stroke="#b71c1c" stroke-width="7"/>
                <circle cx="150" cy="150" r="123" fill="none" stroke="#d32f2f" stroke-width="2"/>
                <circle cx="150" cy="150" r="104" fill="none" stroke="#d32f2f" stroke-width="1.4"/>

                <text font-size="17.5" font-weight="700" letter-spacing="4.5"
                    font-family="'Segoe UI', Arial, sans-serif" fill="#b71c1c">
                    <textPath href="#paid-seal-arc-top" xlink:href="#paid-seal-arc-top" startOffset="50%" text-anchor="middle">FULLY SETTLED</textPath>
                </text>
                <text font-size="15.5" font-weight="900" letter-spacing="3"
                    font-family="'Segoe UI', Arial, sans-serif" fill="#b71c1c">
                    <textPath href="#paid-seal-arc-bottom" xlink:href="#paid-seal-arc-bottom" startOffset="50%" text-anchor="middle">{{ $sealDate }}</textPath>
                </text>

                <text x="150" y="120" text-anchor="middle" font-size="12" font-weight="700" letter-spacing="3"
                    font-family="'Segoe UI', Arial, sans-serif" fill="#c62828">&#9733;</text>
                <text x="150" y="197" text-anchor="middle" font-size="12" font-weight="700" letter-spacing="3"
                    font-family="'Segoe UI', Arial, sans-serif" fill="#c62828">&#9733;</text>

                <line x1="82" y1="150" x2="218" y2="150" stroke="#d32f2f" stroke-width="1" opacity="0.55"/>

                <text x="150" y="167" text-anchor="middle" font-size="58" font-weight="900" font-style="italic"
                    letter-spacing="2" font-family="'Arial Black', 'Segoe UI', Arial, sans-serif" fill="#c62828">PAID</text>
            </g>
        </defs>

        <g filter="url(#paid-seal-ink)">
            {{-- Slight double-strike: a faint copy offset a couple of pixels. --}}
            <use href="#paid-seal-shape" xlink:href="#paid-seal-shape" transform="translate(1.4, -1.1)" opacity="0.15"/>
            <use href="#paid-seal-shape" xlink:href="#paid-seal-shape"/>
            <circle cx="150" cy="150" r="138" fill="url(#paid-seal-wash)"/>
        </g>
    </svg>
</div>