<!DOCTYPE html>
<html lang="ro">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Instrucțiuni transfer bancar — {{ $sub->invoice_number }}</title>
<style>
    body { font-family: system-ui, sans-serif; background: #f3f4f6; padding: 24px; color: #1f2937; }
    .box { max-width: 600px; margin: 0 auto; background:#fff; padding:24px; border-radius:12px; box-shadow:0 4px 12px rgba(0,0,0,.05); }
    h1 { font-size: 20px; margin-bottom: 12px; }
    .row { padding: 8px 0; border-bottom: 1px dashed #e5e7eb; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
    .row b { color:#111827; }
    .row code { background: #f9fafb; padding: 4px 8px; border-radius: 4px; font-family: ui-monospace, monospace; cursor: pointer; }
    .ref-box { background: #fef3c7; border-left: 4px solid #f59e0b; padding: 14px 16px; border-radius: 6px; margin-top: 16px; font-size: 13px; line-height: 1.6; }
    .btn-back { display:inline-block; margin-top: 16px; padding: 10px 20px; background: {{ $themeColor }}; color: #fff; border-radius: 8px; text-decoration: none; font-size: 14px; }
</style>
</head>
<body>
<div class="box">
    <h1>🏦 Instrucțiuni transfer bancar</h1>

    <div class="row"><span>Beneficiar:</span> <b>{{ $bank['beneficiary'] ?? '—' }}</b></div>
    <div class="row"><span>IBAN:</span> <code onclick="navigator.clipboard.writeText(this.textContent)">{{ $bank['iban'] ?? '—' }}</code></div>
    <div class="row"><span>BIC / SWIFT:</span> <code>{{ $bank['bic'] ?? '—' }}</code></div>
    <div class="row"><span>Banca:</span> {{ $bank['bank_name'] ?? '—' }}</div>
    <div class="row"><span>Sumă:</span> <b>{{ number_format($sub->amount, 2) }} {{ $sub->currency }}</b></div>

    <div class="ref-box">
        <b>⚠ Important — la „Detalii plată" / „Reference" scrie EXACT:</b><br>
        <code style="font-size:14px;font-weight:700;display:block;margin:8px 0;padding:8px;background:#fff;border-radius:4px;">{{ $sub->invoice_number ?? 'INV-' . $sub->id }}</code>
        Fără acest cod, plata va fi greu de identificat.
    </div>

    @if (! empty($bank['instructions']))
        <p style="margin-top:16px;font-size:13px;line-height:1.6;color:#4b5563;">{{ $bank['instructions'] }}</p>
    @endif

    <div style="margin-top:20px;padding-top:16px;border-top:1px solid #e5e7eb;font-size:12px;color:#6b7280;line-height:1.6;">
        După efectuarea transferului:
        <ul style="margin: 8px 0 0 20px;">
            <li>Plata apare în 1-3 zile lucrătoare</li>
            <li>Operatorul confirmă manual factura ca plătită</li>
            <li>Abonamentul se extinde automat</li>
        </ul>
    </div>

    <a href="/billing" class="btn-back">← Înapoi la facturi</a>
</div>
</body>
</html>
