<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= htmlspecialchars($SITE_TITLE ?? 'Jasiri Dynamics System') ?> | Reactivate License</title>
    <link rel="stylesheet" href="<?= htmlspecialchars($theme_link ?? '') ?>bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<?= htmlspecialchars($theme_link ?? '') ?>css/font-awesome-4.7.0/css/font-awesome.min.css">
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f5f5f5;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .license-box {
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            max-width: 480px;
            width: 100%;
            overflow: hidden;
        }
        .license-header {
            background: #1e3a8a;
            color: #fff;
            padding: 24px;
            text-align: center;
        }
        .license-header h1 { font-size: 22px; margin-bottom: 6px; }
        .license-header p { font-size: 13px; opacity: 0.9; }
        .license-body { padding: 28px; }
        .form-group { margin-bottom: 18px; }
        .form-group label { font-weight: 600; color: #333; display: block; margin-bottom: 6px; }
        .form-control {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 14px;
        }
        .alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }
        .alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
        .alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
        .btn-primary {
            width: 100%;
            padding: 12px;
            background: #1e3a8a;
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
        }
        .btn-primary:hover { background: #163072; color: #fff; }
        .back-link { text-align: center; margin-top: 16px; }
        .back-link a { color: #1e3a8a; }
        .license-note { font-size: 12px; color: #666; margin-bottom: 18px; padding: 10px 12px; background: #f8f9fa; border-radius: 8px; border-left: 3px solid #1e3a8a; }
    </style>
</head>
<body>
    <div class="license-box">
        <div class="license-header">
            <h1><i class="fa fa-key"></i> Reactivate License</h1>
            <p>Kindly enter your valid license details below to reactivate your system.</p>
        </div>
        <div class="license-body">
            <p class="license-note"><i class="fa fa-info-circle"></i> Use a <strong>new</strong> license key. Old or expired keys will not be accepted.</p>
            <?php if (!empty($message)): ?>
                <div class="alert alert-success"><?= htmlspecialchars($message) ?></div>
            <?php endif; ?>
            <?php if (!empty($error)): ?>
                <div class="alert alert-danger"><?= htmlspecialchars($error) ?></div>
            <?php endif; ?>
            <form action="<?= htmlspecialchars(site_url('license/do_reactivate')) ?>" method="post">
                <div class="form-group">
                    <label for="license_key">License Key <span class="text-danger">*</span></label>
                    <input type="text" id="license_key" name="license_key" class="form-control" required
                           placeholder="Enter your license key" value="<?= htmlspecialchars(set_value('license_key', '')) ?>">
                </div>
                <div class="form-group">
                    <label for="name">Name <span class="text-danger">*</span></label>
                    <input type="text" id="name" name="name" class="form-control" required
                           placeholder="License holder name" value="<?= htmlspecialchars(set_value('name', '')) ?>">
                </div>
                <div class="form-group">
                    <label for="email">Email <span class="text-danger">*</span></label>
                    <input type="email" id="email" name="email" class="form-control" required
                           placeholder="License holder email" value="<?= htmlspecialchars(set_value('email', '')) ?>">
                </div>
                <button type="submit" class="btn btn-primary">Activate License</button>
            </form>
        </div>
        <div class="license-body" style="padding-top: 0;">
            <p class="back-link">
                <a href="<?= htmlspecialchars(site_url('login')) ?>"><i class="fa fa-arrow-left"></i> Back to Login</a>
            </p>
        </div>
    </div>
</body>
</html>
