<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Your Login Code</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f8f9fa;
        }
        .container {
            background: white;
            border-radius: 8px;
            padding: 40px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
        }
        .logo {
            font-size: 24px;
            font-weight: bold;
            color: #2563eb;
            margin-bottom: 10px;
        }
        .otp-code {
            background: #f1f5f9;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            margin: 30px 0;
        }
        .code {
            font-size: 32px;
            font-weight: bold;
            color: #1e40af;
            letter-spacing: 4px;
            font-family: 'Courier New', monospace;
        }
        .warning {
            background: #fef3c7;
            border-left: 4px solid #f59e0b;
            padding: 15px;
            margin: 20px 0;
            border-radius: 4px;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e5e7eb;
            color: #6b7280;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo">🔐 {{ site_name }}</div>
            <h1>Your Login Code</h1>
        </div>

        <p>Hello {{ user.get_full_name|default:user.username }},</p>
        
        <p>You requested a login code for your account. Use the code below to sign in:</p>

        <div class="otp-code">
            <div class="code">{{ otp_code }}</div>
            <p style="margin: 10px 0 0 0; color: #64748b;">Enter this code to continue</p>
        </div>

        <div class="warning">
            <strong>⚠️ Important:</strong> This code will expire in {{ expires_minutes }} minutes. 
            If you didn't request this code, please ignore this email.
        </div>

        <p>If you're having trouble, you can request a new code or contact our support team.</p>

        <div class="footer">
            <p>This is an automated message from {{ site_name }}.</p>
            <p>Please do not reply to this email.</p>
        </div>
    </div>
</body>
</html>
