{{-- Zwei Empfaengerkreise, eine Ansicht: `$hostName` gesetzt heisst
     Host-Sperre (an die Betreiber), null heisst Instanz-Sperre (an den
     Inhaber). Siehe App\Mail\SecurityBlockMail — dort steht, warum die beiden
     Faelle nicht denselben Text und nicht denselben Knopf bekommen duerfen. --}}
@php($istHost = $hostName !== null)

<x-mail.layout
    :heading="$istHost ? __('security.mail_heading_host') : __('security.mail_heading')"
    :preheader="$istHost ? __('security.mail_preheader_host', ['ip' => $ip, 'host' => $hostName]) : __('security.mail_preheader', ['ip' => $ip])"
    :greeting="! $istHost && $name !== '' ? __('security.mail_greeting', ['name' => $name]) : null"
>

<tr><td style="padding:0 24px 24px 24px;">
    <p style="margin:0;font-size:15px;line-height:24px;color:#43434e;">{{ $istHost ? __('security.mail_intro_host', ['ip' => $ip, 'attempts' => $attempts, 'host' => $hostName]) : __('security.mail_intro', ['ip' => $ip, 'attempts' => $attempts]) }}</p>
</td></tr>

{{-- Die Fakten, als Tabelle statt als Satz: eine Sperre wird nachgeschlagen,
     nicht gelesen wie eine Geschichte. --}}
<tr><td style="padding:0 24px;">
    <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;background-color:#fafafb;border:1px solid #e9e9ee;border-radius:8px;">
        @if ($istHost)
        <tr>
            <td style="padding:14px 16px 6px 16px;font-size:13px;line-height:20px;color:#6e6e7a;width:38%;">{{ __('security.field_host') }}</td>
            <td style="padding:14px 16px 6px 16px;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:20px;color:#17171c;font-weight:600;">{{ $hostName }}</td>
        </tr>
        <tr>
            <td style="padding:0 16px 6px 16px;font-size:13px;line-height:20px;color:#6e6e7a;width:38%;">{{ __('security.field_ip') }}</td>
            <td style="padding:0 16px 6px 16px;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:20px;color:#17171c;font-weight:600;">{{ $ip }}</td>
        </tr>
        @else
        <tr>
            <td style="padding:14px 16px 6px 16px;font-size:13px;line-height:20px;color:#6e6e7a;width:38%;">{{ __('security.field_ip') }}</td>
            <td style="padding:14px 16px 6px 16px;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:20px;color:#17171c;font-weight:600;">{{ $ip }}</td>
        </tr>
        @endif
        <tr>
            <td style="padding:0 16px 6px 16px;font-size:13px;line-height:20px;color:#6e6e7a;">{{ __('security.field_when') }}</td>
            <td style="padding:0 16px 6px 16px;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:20px;color:#43434e;">{{ $blockedAt?->local()->isoFormat('LLLL') }}</td>
        </tr>
        <tr>
            <td style="padding:0 16px 6px 16px;font-size:13px;line-height:20px;color:#6e6e7a;">{{ __('security.field_attempts') }}</td>
            <td style="padding:0 16px 6px 16px;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:20px;color:#43434e;">{{ $attempts }}</td>
        </tr>
        <tr>
            <td style="padding:0 16px 14px 16px;font-size:13px;line-height:20px;color:#6e6e7a;">{{ __('security.field_expires') }}</td>
            <td style="padding:0 16px 14px 16px;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:13px;line-height:20px;color:#43434e;">{{ $expiresAt?->local()->isoFormat('LLLL') }}</td>
        </tr>
    </table>
</td></tr>

<tr><td style="padding:24px 24px 0 24px;">
    <p style="margin:0 0 16px 0;font-size:15px;line-height:24px;color:#43434e;">{{ $istHost ? __('security.mail_note_host') : __('security.mail_note') }}</p>
    <table role="presentation" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
        <tr><td align="center" bgcolor="#b8500a" style="background-color:#b8500a;border-radius:8px;">
            <a href="{{ $securityUrl }}" style="display:inline-block;padding:13px 26px;font-family:'IBM Plex Sans',-apple-system,Helvetica,Arial,sans-serif;font-size:15px;line-height:20px;font-weight:600;color:#ffffff;text-decoration:none;border-radius:8px;">{{ $istHost ? __('security.mail_action_host') : __('security.mail_action') }}</a>
        </td></tr>
    </table>
</td></tr>

<tr><td style="padding:24px 24px 32px 24px;">
    <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
        <tr><td style="border-top:1px solid #e9e9ee;padding-top:20px;">
            <p style="margin:0;font-size:13px;line-height:20px;color:#6e6e7a;">{{ $istHost ? __('security.mail_false_alarm_host') : __('security.mail_false_alarm') }}</p>
        </td></tr>
    </table>
</td></tr>

</x-mail.layout>
