<!doctype html>
<html lang="bn">
  <head>
    <meta charset="utf-8">
    <title>Admin Password Reset OTP</title>
    @php
      /** @var \App\Models\GeneralSetting|null $gs */
      $gs   = \App\Models\GeneralSetting::first();
      $name = $gs->site_name     ?? config('app.name', 'SMART EARNING BD');
      $g1   = $gs->icon_color    ?? '#0B5D1E';  // primary
      $g2   = $gs->hover_color   ?? '#0F7A2E';  // secondary
      $g3   = $gs->accent_color  ?? '#E4002B';  // accent
      $ink  = $gs->text_color    ?? '#0f172a';  // text
      $logo = $gs?->logo ? (preg_match('/^https?:\/\//',$gs->logo) ? $gs->logo : asset(ltrim($gs->logo,'/'))) : null;

      // fallback
      $minutes = $minutes ?? 10;
      $otp     = $otp     ?? '123456';
    @endphp
  </head>
  <body style="margin:0;padding:0;background:#f6f7fb;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;">
    <!-- Preheader (hidden preview text) -->
    <div style="display:none;max-height:0;overflow:hidden;opacity:0;">
      Admin password reset OTP for {{ $name }} — valid for {{ $minutes }} minutes.
    </div>

    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background:#f6f7fb;padding:20px 12px;">
      <tr>
        <td align="center">
          <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="max-width:560px;">
            <!-- Header -->
            <tr>
              <td align="center" style="padding:10px 8px 14px 8px;">
                <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background:linear-gradient(90deg, {{ $g1 }}, {{ $g2 }});border-radius:14px;">
                  <tr>
                    <td align="center" style="padding:18px 16px;">
                      @if($logo)
                        <img src="{{ $logo }}" alt="{{ $name }}" width="64" height="64" style="display:block;border:0;outline:none;text-decoration:none;background:#ffffff;border-radius:12px;padding:8px;max-width:64px;max-height:64px;box-shadow:0 6px 16px rgba(0,0,0,.18)" />
                      @endif
                      <div style="font-family:Arial,Helvetica,sans-serif;color:#ffffff;font-size:18px;font-weight:700;margin-top:10px;">
                        {{ $name }}
                      </div>
                      <div style="font-family:Arial,Helvetica,sans-serif;color:#eaf7ee;font-size:12px;margin-top:2px;">
                        Admin Password Reset OTP
                      </div>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>

            <!-- Card -->
            <tr>
              <td style="padding:0 4px;">
                <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background:#ffffff;border:1px solid #eceff3;border-radius:12px;">
                  <tr>
                    <td style="padding:18px 18px 6px 18px;">
                      <h2 style="margin:0 0 8px 0;font-family:Arial,Helvetica,sans-serif;font-size:18px;line-height:1.3;color:{{ $ink }};font-weight:800;">
                        Verify your request
                      </h2>
                      <p style="margin:0 0 10px 0;font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.6;color:#475569;">
                        নিচের ৬-সংখ্যার OTP টি ব্যবহার করে আপনার অ্যাডমিন পাসওয়ার্ড রিসেট রিকোয়েস্টটি নিশ্চিত করুন।
                      </p>
                    </td>
                  </tr>

                  <!-- OTP block -->
                  <tr>
                    <td align="center" style="padding:6px 18px 14px 18px;">
                      <table role="presentation" cellspacing="0" cellpadding="0" border="0" style="margin:6px auto 0 auto;">
                        <tr>
                          <td style="background:linear-gradient(90deg, {{ $g1 }}, {{ $g2 }});color:#ffffff;
                                     font-family:Arial,Helvetica,sans-serif;font-size:28px;letter-spacing:6px;font-weight:800;
                                     padding:12px 16px;border-radius:12px;text-align:center;box-shadow:0 8px 24px rgba(0,0,0,.12);">
                            {{ $otp }}
                          </td>
                        </tr>
                      </table>
                      <div style="font-family:Arial,Helvetica,sans-serif;font-size:12px;color:#64748b;margin-top:10px;">
                        কোডটি <strong style="color:{{ $ink }};">{{ $minutes }} মিনিট</strong> পরে অকার্যকর হবে।
                      </div>
                    </td>
                  </tr>

                  <!-- Tips / Note -->
                  <tr>
                    <td style="padding:6px 18px 16px 18px;">
                      <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0"
                             style="background:linear-gradient(#fff,#fff) padding-box, linear-gradient(90deg, {{ $g1 }}, {{ $g2 }}) border-box; border:1px solid transparent;border-radius:10px;">
                        <tr>
                          <td style="padding:12px 12px;">
                            <p style="margin:0;font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:1.6;color:#334155;">
                              • কারও সাথে এই কোড শেয়ার করবেন না।<br/>
                              • আপনি যদি এই রিকোয়েস্ট না করে থাকেন, তাহলে এই ইমেইলটি উপেক্ষা করুন অথবা আপনার সিকিউরিটি সেটিংস আপডেট করুন।
                            </p>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>

                  <!-- CTA (optional link to verify page) -->
                  {{-- 
                  <tr>
                    <td align="center" style="padding:0 18px 18px 18px;">
                      <a href="{{ url('/admin/password/verify') }}" target="_blank"
                         style="display:inline-block;background:linear-gradient(90deg, {{ $g1 }}, {{ $g2 }});color:#fff;
                                font-family:Arial,Helvetica,sans-serif;font-size:14px;font-weight:700;text-decoration:none;
                                padding:10px 16px;border-radius:10px;">
                        Verify OTP
                      </a>
                    </td>
                  </tr>
                  --}}

                </table>
              </td>
            </tr>

            <!-- Footer -->
            <tr>
              <td align="center" style="padding:12px 8px 0 8px;">
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:12px;color:#94a3b8;">
                  &copy; {{ now()->year }} {{ $name }} — All rights reserved
                </div>
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:11px;color:#9aa6b2;margin-top:4px;">
                  This is an automated message; please do not reply.
                </div>
              </td>
            </tr>

          </table>
        </td>
      </tr>
    </table>
  </body>
</html>